Win a copy of Head First Android this week in the Android 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Rob Spoor
  • Devaka Cooray
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
  • Tim Holloway
Bartenders:
  • Jj Roberts
  • Al Hobbs
  • Piet Souris

how can generate view without controller in spring

 
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,

As in struts we can display jsp page without going to action class ,for example in struts I have
url http://localhost:7001/testapplication/info.do
As I click on this url the request goes to struts-config.xml
where it found <action path="/info" forward="/information.jsp"/> then it display information.jsp in response,
but in spring for each request it goes through with controller then it controller returns corresponding view. I have some simple information jsp , how can i avoid controller part.how i can display jsp directly ?
Please help me , i need it urgently.

Thanks in advance
-nuri
 
Sheriff
Posts: 14691
16
Eclipse IDE VI Editor Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You can use the ParameterizableViewController, which redirects the request to the view set in the "viewName" attribute. Let's assume you are using a BeanNameUrlHandlerMapping.

This will redirect "/hello.do" to "WEB-INF/jsp/hello.jsp".
 
Nuri Jain
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for your reply ,its working fine I am able to get simple jsp page without calling any controller.
but the next problem comes if I want to submit that jsp page .
Actually my concern was like , i want to generate a login page without calling any controller. once user fill username and password then i want to submit that page with userid and pwd value(as i did in struts)

If i use SimpleUrlHandlerMapping then it calls controller 2 time
1.befor formview generation
2.after jsp submit

Please let me know if there is any way in spring

Thanks in advance
Nuri
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE VI Editor Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

If i use SimpleUrlHandlerMapping then it calls controller 2 time


What did you set the form's action to ?
 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic