File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JSP and the fly likes Problem With jsp:forward Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "Problem With jsp:forward" Watch "Problem With jsp:forward" New topic
Author

Problem With jsp:forward

Shashank Acharya
Greenhorn

Joined: Mar 20, 2010
Posts: 21

Hi Friends,

I am making a web application on project management system.In that I used index.jsp, validation.jsp.

The problem is that when check username & password in validation.jsp,it just sends it welcome.jsp with Username as null without checking whether username or password is null or not.

Here My Each & Every JSP page I used please help me about how to I reslove this problem.Also tell me how to send username to welcome.jsp page using this code or another.

INDEX.JSP


VALIDATION.JSP


WELCOME.JSP


Thanks In Advance
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60057
    
  65

Shashank Acharya wrote:Please Reply Faster

You might want to rethink posting things like this.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

<% %> and <%= %> are different things.
Prasad Krishnegowda
Ranch Hand

Joined: Apr 25, 2010
Posts: 507

<h4>Welcome <%request.getParameter("loginname");%></h4>


The above line should be, <%= session.getAttribute("loginname") %>, i guess...

Also, I can't understand why you are checking the username and password null condition in an JSP, you could just check it in an servlet and then forward to welcome.jsp, if the condition is met, which would make the code and logic more clear...


Regards, Prasad
SCJP 5 (93%)
dileep keely
Ranch Hand

Joined: Jun 28, 2010
Posts: 91
Can you try doing this:
In VALIDATION.JSP replace 18th line
<jsp:param name="loginname" value="${param.loginname}"></jsp:param>

with <jsp:param name="loginname" value="${sessionScope.loginname}"></jsp:param>

because "
"param" will act as request.getParameter(String XXXX);
"sessionScope" as session.getAttribute(String XXXX);

The above should solve the problm
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Problem With jsp:forward
 
Similar Threads
Text Box Validation
Internal Error while Validating username and password
Exception in JSP
Using response.setContentType to switch HTML to Word
error showing while retrieving the data from drop down list