Total members 11864 |It is currently Thu Dec 09, 2021 6:13 am Login / Join Codemiles

Java

C/C++

PHP

C#

HTML

CSS

ASP

Javascript

JQuery

AJAX

XSD

Python

Matlab

R Scripts

Weka





hi....any one help regarding this code...
i used <%@include file=" "%> directive code..the code is executing well...but this include code nt working i.e it is nt executing..but simple code with include working well
plz plz any one provide me the solution very soon


Code:
<%@ page import="java.sql.*" %>
<%@ 
page import="java.io.*" %>
<
body bgcolor=568945>
<
center><span style="background-color:green;font-size:45;border-style:solid;">Virtual Medical Home</h1></span></center>
<%!
 
String funame,query;
String fpwd;
 
Connection con;
 
Statement st;
 
ResultSet rs;
%>
<%
        
funame=request.getParameter("uname");
        
fpwd=request.getParameter("pwd");
                
    
        try
            {
                Class.
forName("sun.jdbc.odbc.JdbcOdbcDriver");
                
con=DriverManager.getConnection("Jdbc:Odbc:vmh");
                
st=con.createStatement();
                
query="select * from login where uid='"+funame+"' and pwd='"+fpwd+"' ";
                
rs=st.executeQuery(query);
        

                if(
rs.next())
               {
String role=rs.getString(3);

%>
                    
                    <
h1>WelCome <font face="Comic Sans MS" color=purple><%=rs.getString(1)%></font></h1>
<%
session.setAttribute("funame"funame);
session.setAttribute("role"role);
%>
<%
if(
funame.equals("patient"))
{
%>
<%@include 
file="patientpage.html"%>
<%
}
else if(
funame.equals("admin"))
{

%>
<%@include 
file="adminpage.html"%>
<%
}
%>

<%
                }
                else
                {
        
                    %>
                    <
h1><%=funame%> Invalid User</h1>
                   <%
                }
        } 
    catch(
Exception e)
              {
               
out.println(e);
            }%>

</
body





Last edited by saics on Sun Jan 09, 2011 4:47 pm, edited 1 time in total.

Author:
Beginner
User avatar Posts: 54
Have thanks: 0 time

how not working ??? <%@include %> should be working !? are u sure of the file path.

_________________
M. S. Rakha, Ph.D.
Queen's University
Canada


Author:
Mastermind
User avatar Posts: 2715
Have thanks: 74 time

ya sure the file path is correcet...
and i test a simple code with <%@include...%> it is working fine


Author:
Beginner
User avatar Posts: 54
Have thanks: 0 time

plz...any body will help????


Author:
Beginner
User avatar Posts: 54
Have thanks: 0 time

hey brother ,
i don't see your problem clearly , <%@include not working with u ?

_________________
M. S. Rakha, Ph.D.
Queen's University
Canada


Author:
Mastermind
User avatar Posts: 2715
Have thanks: 74 time

sry brother first i write code with <%@ incllude... code it is jst skip the out put containing include file
And then i replace the <%@ ... code vth actual html file code also it shows the same out put
Is there any logical or syntatical errors in this code??


Author:
Beginner
User avatar Posts: 54
Have thanks: 0 time

just use .
Code:
<%@include file="yourfile.jsp" %>


_________________
M. S. Rakha, Ph.D.
Queen's University
Canada


Author:
Mastermind
User avatar Posts: 2715
Have thanks: 74 time

that means...cann't we use HTML(static) files in <%@include....?


Author:
Beginner
User avatar Posts: 54
Have thanks: 0 time

good question ... i think yes, you can but i can't remember.

_________________
M. S. Rakha, Ph.D.
Queen's University
Canada


Author:
Mastermind
User avatar Posts: 2715
Have thanks: 74 time
Post new topic Reply to topic  [ 9 posts ] 

  Related Posts  to : jsp include directive not working
 PHP Include     -  
 Require vs Include in php     -  
 Using include() Within a Loop     -  
 Using include function     -  
 get include path     -  
 javap is not working     -  
 SSI.php on other websites, Not working     -  
 ScrollableTable is not working in the firefox     -  
 video conference is nt working     -  
 working of bitwise ~ operator     -  



Topic Tags

Servlets/JSP






Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
All copyrights reserved to codemiles.com 2007-2011
mileX v1.0 designed by codemiles team
Codemiles.com is a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for sites to earn advertising fees by advertising and linking to Amazon.com