Win a copy of Rust Web Development this week in the Other Languages forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Jesse Silverman
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Frits Walraven

Problem With jsp:forward

 
Greenhorn
Posts: 21
Android Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Sheriff
Posts: 67618
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Shashank Acharya wrote:Please Reply Faster


You might want to rethink posting things like this.
 
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
<% %> and <%= %> are different things.
 
Ranch Hand
Posts: 672
4
Eclipse IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

<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...
 
Ranch Hand
Posts: 112
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic