• Post Reply Bookmark Topic Watch Topic
  • New Topic

JSP hidden label display

 
skevin scott
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I want to know how to insert a label after button click.

I try to create a user login using JSP and Java

This is a label, I want to display after wrong login.
<a id="alt">Unrecognized User, Try again </a>

How it display in my user interface for wrong login using java.

In here, I am using control servlet for handle the user.

response.sendRedirect("index.jsp");
this is used to go back to the main page.
I want to add a above massage with second loading.

Thank you.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65530
108
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Add a scoped variable with the message to the request. On the JSP, test for its presence with <c:if> to display the message only when it exists.
 
skevin scott
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thank you and can you explain how to add a scope variable with the message? please.
 
skevin scott
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here, I can't pass the variable servlet to JSP file. Can anyone solve this?
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65530
108
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A scoped variable on the request is created with the setAttribute() method of the request instance.
 
skevin scott
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thank you very much. I solve problem.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!