• 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
  • paul wheaton
  • Ron McLeod
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

How to write ActionServlet which should act like a controller?

 
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,
I have a web application in which i've a jsp like One.jsp.In that jsp i've a form,when ui submit it should go to another jsp.But in the action field of the first jsp,I shouldn't mention the second jsp name.I should mention some thing like "welcome".When i submit the form, it should go to a servlet which sends the form to the second jsp,that means the servlet acts like a controller which sends the request to the corresponding jsp.How can i do that? Can anyone help me??
Thanks,
Sandhya.
[ January 17, 2007: Message edited by: Bear Bibeault ]
 
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You should read up on request dispatchers:
http://java.sun.com/j2ee/1.4/docs/api/javax/servlet/RequestDispatcher.html

Also, in my signature, there is a link to the servlet spec, in it there is a section on servlet-mappings.

What you want to do can be done with a controller or it can be done by giving your JSP a servlet entry and a servlet-mapping with the url-pattern of your choice.
 
Sandhya Deekonda
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
In my first jsp,when form is submitted the server checks for the requested url in the web.xml .If it finds that url it goes to that particular jsp or servlet.This shouldn't happen.It should go to some other servlet,that servlet should point to some other configuratopn file like config.xml.From there it should go to the requested servlet.How can i do that?
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Why don't you show us what you've got so far?
Have you read the links that I posted?
 
Sandhya Deekonda
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ya I went through the links which you posted.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic