Announcement Announcement Module
No announcement yet.
Clarification on hrefs within a jsp please Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Clarification on hrefs within a jsp please

    In my springapplet-servlet.xml file I have the following url mappings,

    <bean id="loginController" class="ui.action.Login"/>
    <bean id="listPortfoliosController" class="ui.action.ListPortfolios"/>

    <bean id="urlMapping" class="org.springframework.web.servlet.handler.Sim pleUrlHandlerMapping">
    <property name="mappings">
    <prop key="/">loginController</prop>
    <prop key="/">listPortfoliosController</prop>

    and in my web.xml I have:
    <servlet-class>org.springframework.web.servlet.DispatcherSe rvlet</servlet-class>


    These work fine for getting my appliaction going.

    Now within the listportfolio.jsp which provides the view for the listportfoliocontroller and hence I have a form and also some hrefs. Originally these were referring to / which seemed to work but thinking about it didnt make much sense to me as I am already on the page so I changed them to call /listPortfolioController but this doesnt work.

    Which is the correct method, and if it is the second method how do I configure my xml files to get it to work.

    Also can I just check the AbstractFormController class is only meant to be used when users are using a form in an add/edit screen rather than any page which uses the <form> tag to pass user entered parameters.

  • #2
    You are doing it correctly by linking to / .

    The AbstractFormController should be used if you need to prepare the data to be shown in the form. So, like you said, it is good for add/edit type forms. If you just want to get a value passed in the form POST or as a querystring param, you extend AbstractController and user request.getParameter("paramName). And if you want to have the data bound to a command object and possibly validated, extend BaseCommandController.


    • #3
      Originally posted by dgynn
      You are doing it correctly by linking to / .
      Ok thanks, I suppose thinking about this call will go straight way go to the specfied controller