Results 1 to 3 of 3

Thread: Clarification on hrefs within a jsp please

Hybrid View

  1. #1

    Default 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">
    <props>
    <prop key="/start.do">loginController</prop>
    <prop key="/listportfolios.do">listPortfoliosController</prop>
    </props>
    </property>
    </bean>

    and in my web.xml I have:
    <servlet>
    <servlet-name>springapp</servlet-name>
    <servlet-class>org.springframework.web.servlet.DispatcherSe rvlet</servlet-class>
    <load-on-startup>1</load-on-startup>
    </servlet>

    <servlet-mapping>
    <servlet-name>springapp</servlet-name>
    <url-pattern>*.do</url-pattern>
    </servlet-mapping>

    These work fine for getting my appliaction going.

    Now within the listportfolio.jsp which provides the view for the listportfoliocontroller and hence listportfolios.do I have a form and also some hrefs. Originally these were referring to /listportfolio.do which seemed to work but thinking about it didnt make much sense to me as I am already on the listportfolio.do 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. #2
    Join Date
    Mar 2005
    Location
    San Francisco, CA
    Posts
    114

    Default

    You are doing it correctly by linking to /listportfolios.do .

    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. #3

    Default

    Quote Originally Posted by dgynn
    You are doing it correctly by linking to /listportfolios.do .
    Ok thanks, I suppose thinking about this call will go straight way go to the specfied controller

Similar Threads

  1. Filter config clarification and best practices
    By yukster in forum Security
    Replies: 1
    Last Post: Oct 10th, 2005, 05:56 PM
  2. Need a clarification
    By john017 in forum Security
    Replies: 5
    Last Post: May 17th, 2005, 05:49 AM
  3. Acegi - Login Tapestry another clarification
    By john017 in forum Security
    Replies: 1
    Last Post: Feb 4th, 2005, 01:36 AM
  4. terminology clarification
    By jbetancourt in forum Container
    Replies: 4
    Last Post: Jan 24th, 2005, 08:37 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •