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

How to call the servlet without form action

 
P Arunkumar
Ranch Hand
Posts: 119
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

I have designed login page by using jsp,script and iam verifying to user name and password from the server by using servlet mapping its working fine. but i need to change some modification, after i click submit button its wants to open one jsp page how i wants to code i don't know.

In form action i have given action to myservlet class, please help me how i wants to code. Iam beginner and new for this field, below i have attached my code.

Login.jsp




WelcomeServlet.java



web.xml:



now my servlet code also wants to work and in the same time after i click submit button one jsp page wants to open.


Please help me.

Thanks in advance.
 
Tarun Bolla
Ranch Hand
Posts: 89
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What i understood -
You want to submit your form to a servlet and then display a JSP
You can do that, You need to do servlet mapping in web.xml as usual and in the servlet after your business logic is dealt with use the view as jsp. Heres how...

Read more about MVC pattern
 
P Arunkumar
Ranch Hand
Posts: 119
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you so much. its working fine
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic