• 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
  • Liutauras Vilda
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Junilu Lacar
  • Tim Cooke
Saloon Keepers:
  • Carey Brown
  • Stephan van Hulst
  • Tim Holloway
  • Peter Rooke
  • Himai Minh
Bartenders:
  • Piet Souris
  • Mikalai Zaikin

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 ?
 
I like you because you always keep good, crunchy cereal in your pantry. This tiny ad agrees:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
reply
    Bookmark Topic Watch Topic
  • New Topic