Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Call JSP page

 
jay yu
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • 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
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64980
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • 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
  • 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?
 
Devaka Cooray
ExamLab Creator
Marshal
Pie
Posts: 4512
274
Chrome Eclipse IDE Google App Engine IntelliJ IDE jQuery Postgres Database Tomcat Server
  • Mark post as helpful
  • send pies
  • 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
  • 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??
 
Paul Clapham
Sheriff
Posts: 21142
32
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • 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.
 
Haina Minawa
Ranch Hand
Posts: 119
  • Mark post as helpful
  • send pies
  • 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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic