Announcement Announcement Module
Collapse
No announcement yet.
Property in springxml Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Property in springxml

    hai

    I am developing spring application. In my apps

    LoginCommand acts a bean

    LoginController acts as a controller. In this controller based on the return string sI have to forward to different pages..

    Like "LoginSucess" means welcome.jsp
    Like "LoginFailure" means error.jsp
    Like "LoginAdmin" means adminhome.jsp

    But in springxml

    <beans>


    <bean id="simpleUrlMapping" class = "org.springframework.web.servlet.handler.SimpleUrl HandlerMapping">
    <property name ="mappings">
    <props>

    <prop key ="/login.html">loginBankController</prop>
    </props>
    </property>
    </bean>
    <bean id="loginBankController" class="LoginBankController">
    <!-- <property name="sessionForm"><value>true</value></property> -->
    <property name="commandName"><value>loginCommand</value></property>
    <property name="commandClass"><value>LoginCommand</value></property>
    <property name="formView">
    <value>login</value>
    </property>
    <property name="successView">
    <value>welcome</value>
    </property>

    </bean>

    <bean id="viewResolver" class = "org.springframework.web.servlet.view.InternalReso urceViewResolver">
    <property name="viewClass"><value>org.springframework.web.se rvlet.view.JstlView</value></property>
    <property name ="prefix"><value>jsp/</value></property>
    <property name ="suffix"><value>.jsp</value></property>
    </bean>

    </beans>

    -----------------

    In the above spring xml we have only sucessview and formview this will usefull only welcome.jsp and forview for login.jsp.

    How i can set property name for other pages like i have to forward to adminhome.jsp, error.jsp etc.

    Pls help. I studied documentation but i can't find it.

    Thanks

  • #2
    we have only sucessview and formview
    The corresponding setters are defined in SimpleFormController:
    void setFormView(String formView)
    void setSuccessView(String successView)

    How i can set property name for other pages like i have to forward to adminhome.jsp, error.jsp
    When subclassing you can add any other properties or other pages you need.

    Comment


    • #3
      Hi Thanks for update. I am having more doubts abt springconfig.xml. I had posted in this forum. pl reply

      Comment

      Working...
      X