Clarice Lin

Greenhorn
+ Follow
since Jan 16, 2003
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Clarice Lin

I have some problems with passing control between jsp pages. Was trying out a controller page.What i have come up with.
testcontroller.jsp page will haf a hyperlink n a session attribute passed to test1.jsp.
When the user clicks on the hyperlink, it is supposed to go to test1.jsp.
on test1.jsp, i have included the page scontroller.jsp.
in scontroller.jsp, it is supposed to test whether the session attribute exists. If it is null, the page will be redirected to another page called index.jsp(instead of showing the page test1.jsp)
the main problem is when a user clicks on a hyperlink for eg test.jsp, on test.jsp itself, unless the user is identified, the page will not be shown to the user. that is y i have come up with the code though i think somehow the passing and checking of session attribute is unsuccessful.
thank you for helping=)
below is the code for testcontroller.jsp
<%@ page contentType="text/html; charset=iso-8859-1" language="java" import="java.sql.*" errorPage="" %>
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<% session.setAttribute("allowUserId","");%>
<a href="test1.jsp">click here</a>
</body>
</html>
here is the code for scontroller.jsp
<%@ page language = "java" import = "java.sql.*" import = "java.lang.*","java.sql.*"
import="javax.servlet.http.HttpSession.*"%>
<jsp:useBean id = "db" class = "javabeans.DbAccess" scope = "session" />
<%-- check to see if user has logged in yet
note: login is not part of this application,
so user is redirected to the login application
--%>
<% if (((String)session.getAttribute("allowUserId")) == null) { %>
<jsp aram name="action" value="failed" />
<jsp:forward url="index.jsp" />
<% } %>

here is the code for test1.jsp
<%@ page contentType="text/html; charset=iso-8859-1" language="java" import="java.sql.*" errorPage="" %>
<jsp:include page="scontroller.jsp"/>
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<%=session.getAttribute("allowUserId")%>
letz c this!
</body>
</html>
21 years ago
JSP
hiz..got confused with all the different versions of apache and tomcat.need to connect both of them to work together. I have downloaded apache 2.0 and tomcat 4.1.18.
what is the best connector for both of them to work?Is there any page that have simple to follow steps?coz i read a few pages and got really confused by the whole lot.
thankz=)
21 years ago
JSP
If I'm using mysql for my database, can i use JDBC as the connector?Or is there other connector?
Currently I'm comin up with a internet portal for my final year project.Got some problems in understanding about system architecture.
When we talk about system architecture and the n-tier model,is javabeans included as a tier?
for example,The tiers used for this example include the client, presentation, business logic, integration, and data.
if i want to include a chat room or discussion forum in my structure, which tier does it fall under?
i used this site as reference
http://www.macromedia.com/desdev/articles/ntier.html
Can anyone kindly explain to mi?Or some reference sites that will enhance my understandin on this?
thank you.
yeah!done at last....am able to run tomcat,now gotta try to connect apache n tomcat together...
thankz everyone for ur help=)
21 years ago
JSP
This java_home directory environment variable is not defined correctly.
>>but isn't it supposed to be define as the same directory as where i store my SDK?
another error is the system cannot find the file -Djava.endorsed.dirs=.
Decided to download another SDK version and try again but how to solve the second error?
21 years ago
JSP
There is a problem though. I went to start up services. However Tomcat is not on the list. So how am I actually able to start up Tom cat?
21 years ago
JSP
How do i check whether I have any other programs running on port number 8080?
21 years ago
JSP
checked :tomcat is not running
I have two versions of tomcat.becoz I couldnt get it running so i downloaded another version.
21 years ago
JSP
hi. I juz downloaded tomcat 4.1 version.but somehow i cannot seem to run it at all..have tried changing environment variables and reinstall n but i cant seem to run it at all.Coz i followed the instructions here http://www.onjava.com/pub/a/onjava/2002/11/20/tomcat.html and http://jakarta.apache.org/tomcat/tomcat-4.0-doc/RUNNING.txt
Reason why I know it is still not running.
when i typed http://localhost:8080 , nothin comes on the browser window. I'm currently using winXP
Should I install tomcat in the same directory as apache?
thank you.
21 years ago
JSP