• 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:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Call JSP page

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi there, quick question

how can I call a jsp page from anther jsp page?

I have a simple math calculation jsp page (A.jsp) and i want another tester jsp page (T.jsp) to call A.jsp a multiple times, but each time i want T.jsp to wait until the calculation is done before calling A.jsp the second time. what is the best way to do?
also I want to pass some random number to the A.jsp.

many thanks.
Jay
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Except for the "wait" part (which makes no sense -- JSPs execute sequentially just like any other code), it sounds like you want to create a tag file or a custom tag.
 
jay yu
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Bear Bibeault wrote:Except for the "wait" part (which makes no sense -- JSPs execute sequentially just like any other code), it sounds like you want to create a tag file or a custom tag.



no i don't want to create a tag file or custom tag. so it is possible to call another JSP file and wait til it finished?
 
Sheriff
Posts: 7134
1360
IntelliJ IDE jQuery Eclipse IDE Postgres Database Tomcat Server Chrome Google App Engine
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

jay yu wrote:so it is possible to call another JSP file and wait til it finished?


No. As Bear said, it doesn't make any sense. If what you need is performing some calculation after the page has rendered, JavaScript might be the best way to go.
 
jay yu
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Devaka Cooray wrote:

jay yu wrote:so it is possible to call another JSP file and wait til it finished?


No. As Bear said, it doesn't make any sense. If what you need is performing some calculation after the page has rendered, JavaScript might be the best way to go.



right,i know what you mean now. first i have to use JSP, and second mostly i am just calling for testing purpose to see how long does it take to call 10K times, so actually i don't need to have the calculation but for the performance test i want to wait unti the calculation is done before calling another one that's all. am i making sense now??
 
Marshal
Posts: 28193
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Not really, no. If you do something 10,000 times in a row on a computer, it's hard NOT to do them sequentially.
 
Ranch Hand
Posts: 119
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

jay yu wrote:
right,i know what you mean now. first i have to use JSP, and second mostly i am just calling for testing purpose to see how long does it take to call 10K times, so actually i don't need to have the calculation but for the performance test i want to wait unti the calculation is done before calling another one that's all. am i making sense now??



Yes, it is possible. Convert the A.jsp page into a servlet, says AServlet. The servlet must return a value. Run a for loop in a test app to invoke AServlet multiple times sequentially, make sure to check the response from AServlet for each invocation. If the servlet returns a valid response, run the next invocation.
reply
    Bookmark Topic Watch Topic
  • New Topic