Page 2 of 2 FirstFirst 12
Results 11 to 16 of 16

Thread: struts2 + spring + hibernate

  1. #11

    Default

    And sheetal in the case of transactions we used a facade. I think may be this will be a good solution for this.

  2. #12
    Join Date
    Jun 2007
    Posts
    18

    Default

    hello Lijin,
    actually i'm still learning these. so there's very littile that i could help.
    steps u have to follow are :
    1. write the web.xml file like this:
    <?xml version="1.0" encoding="UTF-8"?>
    <web-app id="person" version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
    <display-name>person</display-name>
    <filter>
    <filter-name>struts2</filter-name>
    <filter-class>
    org.apache.struts2.dispatcher.FilterDispatcher
    </filter-class>


    </filter>
    <filter-mapping>
    <filter-name>struts2</filter-name>
    <url-pattern>/*</url-pattern>
    </filter-mapping>


    <welcome-file-list>
    <welcome-file>/login.jsp</welcome-file>
    </welcome-file-list>
    <!-- this step is to add spring with struts2 -->
    <listener>
    <listener-class>
    org.springframework.web.context.ContextLoaderListe ner
    </listener-class>
    </listener>


    </web-app>
    2. write applicationContext.xml. it should empty for now. place it in the same folder as ur web.xml
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN"
    "http://www.springframework.org/dtd/spring-beans.dtd">

    <!--
    - Application context definition
    -->
    <beans>

    </beans>
    if u've used struts2 others things are same as before. jars u r gonna need are :
    1.spring.jar
    2.struts2-spring-plugin.jar

  3. #13

    Default

    Thank you very much Sheetal for your help. Thanks for giving the config help.

    In our project we are working on Spring currently. We want to integrate Struts2 to spring. But when i tried to configure struts 2.. its not working for me. I think struts can directly access / read application context beans. But my struts2 configuration is not working..

    Will post more outcomes in the future here.

    Thanks for your support friend..
    Lijin

  4. #14
    Join Date
    Jun 2007
    Posts
    18

    Default

    can u post the errors u r getting? is that the dreadful error filterStart?

  5. #15

    Default

    Hi Sheetal,

    Actually I had configured struts with Zero configuration like specifing the struts action namespace in the web.xml. At that time it worked.

    But when i declare the actions in struts.xml it is not redirecting to the corresponding jsp page. No error is coming but just dont getting that action in browser

    Thanking you
    Lijin

  6. #16

    Default

    Hi sheetal,

    Its worked now. Just i missed to include WEB_INF directory path to the resulting jsp. Thxs for all your help frnd. Your tips helped me a lot. Thxs

    Lijin

Posting Permissions

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