Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Please help me

 
Krishna Tota
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello friends,

I am developing a jsp page by providing components like RegisterHear and Login using
<input type="submit" value="RegisterHear"> and
<input type="submit" value="Login">

And at the top i used <form action="form/registration.jsp">

Now my quetion is where should i keep Login.jsp to open login page when we press login button.Please explain with code.

And also explain using Java script and using href.

which way is bettor for creating Login page

If there is any source code for developing Login module using struts please give me.

Thanks,
krishna
 
kappiil patel
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can write a java script function for that. This java script function should be called onClick event of both buttons.
function openPage(var s)
{
if(s=='Login')
document.YourFormName.action = 'Login.jsp';
else
document.YourFormName.action = 'Register.jsp';

document.YourFormName.submit();

}
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Krishna,

It would take an awful lot of typing to answer all of these questions.
Have you worked through any JSP tutorials or books on the subject?
If not, this might be a better way to start than asking for this much information from a web forum.

Also, if you're using Struts, we have a forum dedicated to that subject.

-Ben
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65113
89
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please be sure to take the time to compose descriptive subjects for your posts; read this for more information.

You can go back and change your post to add a more meaningful subject by clicking the .
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic