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 update a JSP

 
trupti nigam
Ranch Hand
Posts: 627
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a main JSP page, where the user can input all the request parameters and it displays response on the same JSP page.

I also have a global listener java class which automatically gets notifications when a new record gets added to the system. When this notification is received I want to send the output to a second JSP page. And put a tab or any kind of link on the main JSP (above) to view the contents of the second JSP. How can I achieve this? Any pointers. I am using simple servlet and jsp technology.


thanks
Trupti
 
Piyush Mangal
Ranch Hand
Posts: 196
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I also have a global listener java class which automatically gets notifications when a new record gets added to the system. When this notification is received I want to send the output to a second JSP page. And put a tab or any kind of link on the main JSP (above) to view the contents of the second JSP. How can I achieve this? Any pointers. I am using simple servlet and jsp technology.


Well, you can have multiple tabs on your main jsp. You can have first tab enabled by default( means the content of the first tab is only visible), you can then put all the input fields in the first tab and submit the form. When you process the request, have your servlet dispatch the request to the same jsp with some selected tab index.

As far as listener is concerned, you can add something in application scope, then when the next request comes, you put additional data to request attribute. You can not directly send output from the listener itself. Have a filter or some kind of Wrapper object that can enrich your request and response object.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic