Total members 10262 | Gratitudes |It is currently Thu May 24, 2012 10:20 am Login / Join Codemiles


All times are UTC [ DST ]




Post new topic Reply to topic  Quick reply  [ 9 posts ] 
Author Question
 Question subject: jsp include directive not working
PostPosted: Sun Jan 09, 2011 2:28 pm 
Offline
Beginner
User avatar

Joined: Sun Jan 09, 2011 2:16 pm
Posts: 56
Has thanked: 1 time
Have thanks: 0 time

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

_________________
technoyouth


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

TOP
 Profile Send private message  
Reply with quote  
 Question subject: Re: jsp include directive not working
PostPosted: Sun Jan 09, 2011 3:52 pm 
Offline
Mastermind
User avatar

Joined: Tue Mar 27, 2007 10:55 pm
Posts: 2279
Location: Earth
Has thanked: 39 time
Have thanks: 61 time
how not working ??? <%@include %> should be working !? are u sure of the file path.

_________________
Currenlty programming with : java , html , php , and javascript . (OCJP-6 certified )


TOP
 Profile Send private message  
Reply with quote  
 Question subject: Re: jsp include directive not working
PostPosted: Sun Jan 09, 2011 4:46 pm 
Offline
Beginner
User avatar

Joined: Sun Jan 09, 2011 2:16 pm
Posts: 56
Has thanked: 1 time
Have thanks: 0 time
ya sure the file path is correcet...
and i test a simple code with <%@include...%> it is working fine

_________________
technoyouth


TOP
 Profile Send private message  
Reply with quote  
 Question subject: Re: jsp include directive not working
PostPosted: Mon Jan 10, 2011 2:16 pm 
Offline
Beginner
User avatar

Joined: Sun Jan 09, 2011 2:16 pm
Posts: 56
Has thanked: 1 time
Have thanks: 0 time
plz...any body will help????

_________________
technoyouth


TOP
 Profile Send private message  
Reply with quote  
 Question subject: Re: jsp include directive not working
PostPosted: Mon Jan 10, 2011 10:56 pm 
Offline
Mastermind
User avatar

Joined: Tue Mar 27, 2007 10:55 pm
Posts: 2279
Location: Earth
Has thanked: 39 time
Have thanks: 61 time
hey brother ,
i don't see your problem clearly , <%@include not working with u ?

_________________
Currenlty programming with : java , html , php , and javascript . (OCJP-6 certified )


TOP
 Profile Send private message  
Reply with quote  
 Question subject: Re: jsp include directive not working
PostPosted: Tue Jan 11, 2011 1:35 pm 
Offline
Beginner
User avatar

Joined: Sun Jan 09, 2011 2:16 pm
Posts: 56
Has thanked: 1 time
Have thanks: 0 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??

_________________
technoyouth


TOP
 Profile Send private message  
Reply with quote  
 Question subject: Re: jsp include directive not working
PostPosted: Tue Jan 11, 2011 2:27 pm 
Offline
Mastermind
User avatar

Joined: Tue Mar 27, 2007 10:55 pm
Posts: 2279
Location: Earth
Has thanked: 39 time
Have thanks: 61 time
just use .
Code:
<%@include file="yourfile.jsp" %>

_________________
Currenlty programming with : java , html , php , and javascript . (OCJP-6 certified )


TOP
 Profile Send private message  
Reply with quote  
 Question subject: Re: jsp include directive not working
PostPosted: Thu Jan 13, 2011 2:54 pm 
Offline
Beginner
User avatar

Joined: Sun Jan 09, 2011 2:16 pm
Posts: 56
Has thanked: 1 time
Have thanks: 0 time
that means...cann't we use HTML(static) files in <%@include....?

_________________
technoyouth


TOP
 Profile Send private message  
Reply with quote  
 Question subject: Re: jsp include directive not working
PostPosted: Thu Jan 13, 2011 4:20 pm 
Offline
Mastermind
User avatar

Joined: Tue Mar 27, 2007 10:55 pm
Posts: 2279
Location: Earth
Has thanked: 39 time
Have thanks: 61 time
good question ... i think yes, you can but i can't remember.

_________________
Currenlty programming with : java , html , php , and javascript . (OCJP-6 certified )


TOP
 Profile Send private message  
Reply with quote  
Post new topic Reply to topic Quick reply  [ 9 posts ] 
Quick reply


  

 Similar topics
 ScrollableTable is not working in the firefox
 HELP: JAVA not working in TEXTPAD
 javap is not working
 working of bitwise ~ operator
 SSI.php on other websites, Not working
 Working with menus, Label links and files in C#
 $2500 per month working with Multi-million dollar companies
 Challenges of Working at Home
 Working on hotel class
 get include path

All times are UTC [ DST ]


Users browsing similar posts

Users browsing this forum: No registered users and 1 guest



Jump to:  
Previous Question | Next Question 




Home
General Talks
Finished Projects
Code Library
Games
Tutorials

Java
C/C++
C-sharp
php
Script
JSP/Servlets
Ajax
ASP/ASP.net
Google SEO
Database
Communications
Phpbb3 styles
Photoshop tutorials
Flash tutorials
Find a job






Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
All copyrights reserved to codemiles.com 2007-2011
mileX v1.0 designed by codemiles team