Only 48 hours left in the trailboss' kickstarter!

New rewards and stretch goals. CLICK HERE!



  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Create new JSP page dynamically  RSS feed

 
Anne Abraham
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
New to JSP I am working with Spring MVC with annotations and Hibernate.

My question is: I select an item from the drop down menu (populated by Controller). Summary regarding this item is displayed as hrefs. On clicking on this href, I want a page to by created dynamically which will display the details of this selected item. So I want to know if it is possible to get a jsp page to be created dynamically without it actually being physically present.

The main controller class annotated with /test that populates the drop down box with Get method. This controller class has a method which will handle the url /test/about-test - this is invoked when the href is clicked.. I hope you understand my question. If its easier, you could also tell me how I can redirect the results to a particular page (already created) from within this method. thanks in advance for any help!
 
Vijitha Kumara
Bartender
Posts: 3972
24
Chrome Fedora Hibernate
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the Ranch!
... I want a page to by created dynamically which will display the details of this selected item. So I want to know if it is possible to get a jsp page to be created dynamically without it actually being physically present.

Why you want to create a JSP at runtime? Can't you create a JSP and use that to display data according to the params/data for that particular item? Is there anything other than this you are trying to accomplish here...?
...you could also tell me how I can redirect the results to a particular page (already created) from within this method

You have to forward the request to the required resource (Servlet/JSP). Note that this happens within the server (I guess you didn't mean the *Redirect the request* here?)
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65824
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As you are new to JSP, there is much you need to learn about how JSPs work. Your question about "dynamic JSPs" shows that you have yet to grasp how to effectively use JSPs.

I'd recommend reading over a few articles that might help you get started:

The Secret Life of JSPs

The Front Man
 
Anne Abraham
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for asking me to go back and take a look at JSP. Ive come pretty far with it and correcting a lot of wrong impression I had about JSP
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65824
134
IntelliJ IDE Java jQuery Mac Mac OS X
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!