This week's book giveaway is in the Jython/Python forum.
We're giving away four copies of Hands On Software Engineering with Python and have Brian Allbey on-line!
See this thread for details.
Win a copy of Hands On Software Engineering with Python this week in the Jython/Python 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Bear Bibeault
  • Knute Snortum
  • Liutauras Vilda
Sheriffs:
  • Tim Cooke
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Tim Moores
  • Frits Walraven
  • Ron McLeod
  • Ganesh Patekar
  • salvin francis
Bartenders:
  • Tim Holloway
  • Carey Brown
  • Stephan van Hulst

submitting page to itself  RSS feed

 
Ranch Hand
Posts: 476
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi guys,
I have a JSP with a form in it, the action page does not do much so I was wondering, is it possible to make the action page the calling page? If yes then how?
thanks,
Alex
 
Marshal
Posts: 67191
169
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

is it possible to make the action page the calling page?


Could you be more explicit about what you mean by "action" and "calling" pages?
(If you just want the page to submit to itself using the same URL, I think that leaving off the action attribute of the form tag may accomplish that, but that might be a better question for the HTML forum).
bear
 
Ranch Hand
Posts: 15304
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So you want a something like:

page.jsp

Well, PHP users do this a lot because PHP is like using JSP without actual Servlets. This is not a good idea, but can be done. You will need a lot of logic and scriplets in your JSP page to detmerine when to do what with any data you may or may not have. A better approach would be the following:
I have a form called employeelookup.jsp. It begins with a text field for the employee ID. When I click the Lookup button I call a Servlet that gets the employee info from a DB and fills an EmployeeBean with some initial data. I then forward back to employeelookup.jsp.
I have another form on that same page that is encoumpassed with jstl's c:test= where I test for the presence of that EmployeeBean. If it exists, I display some info about the employee for verification and also provide a Continue button to move on to the Call Log form.
[ January 16, 2004: Message edited by: Gregg Bolinger ]
 
Alex Kravets
Ranch Hand
Posts: 476
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks, but actually after snooping on google i got it:

P.S.


Gregg Bolinger

One of these days, I am going to teach a 'How to search the web using Google' class


I searched google before I read your signature LOL
[ January 16, 2004: Message edited by: Alex Kravets ]
[ January 16, 2004: Message edited by: Alex Kravets ]
 
You can't have everything. Where would you put it?
RavenDB is an Open Source NoSQL Database that’s fully transactional (ACID) across your database
https://coderanch.com/t/704633/RavenDB-Open-Source-NoSQL-Database
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!