Jahia Dev Forum > problem of using...

0 (0 Good)
0 (0 Bad)

problem of using struts with Jahia6

by  ouldam »  2011/06/07 20:43

Hello
I would like to know if anyone among you who knows the problem of using struts 1.2.9 with eclipse in jahia6 I described below, it will save me life.

the process I followed is as follows:

1)I declared my "ActionServlet" in the "web.xml" to my project as below:

<servlet>
<servlet-name>action</servlet-name>

<servlet-class>org.apache.struts.action.ActionServlet</servlet-class>
<init-param>
<param-name>config</param-name>
<param-value>/Web-INF/struts-config.xml</param-value>
</init-param>
</servlet>
<servlet-mapping>
<servlet-name>action</servlet-name>
<url-pattern>*.do</url-pattern>
</servlet-mapping>

2)Then I created the file "struts-config.xml in the directory
/ Web-INF project and I set a GlobalForward as below name "forgottenPasswordGlobalForward".


<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE struts-config PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration
1.2//EN"
"http://struts.apache.org/dtds/struts-config_1_2.dtd">
<struts-config>
...
<global-forwards >
<forward name="forgottenPasswordGlobalForward" path="/forgotten_password.jsp"></forward>
</global-forwards>

...
</struts-config>

3)I created a hyper link in my jsp as below:

<a href="forgottenPasswordGlobalForward.do">
Mon Lien hypertexte
</a>

And I have this error :


2010-04-26 17:41:36,019: WARN [ErrorLoggingFilter] - Access denied for
resource: /cms
2010-04-26 17:41:42,060: WARN [ErrorLoggingFilter] - Access denied for
resource: /forgottenPasswordGlobalForward.do


Thank you in advance .

  • problem of using struts with Jahia6
    2011/07/08 14:30

    ouldam <p> Hello<br /> I would like to know if anyone among you who knows the problem of using struts 1.2.9 with eclipse in jahia6 I described below, it will save me life.<br /> <br /> the process I followed is as follows:<br /> <br /> 1)I declared my &quot;ActionServlet&quot; in the &quot;web.xml&quot; to my project as below:<br /> <br /> &lt;servlet&gt;<br /> &lt;servlet-name&gt;action&lt;/servlet-name&gt;<br /> <br /> &lt;servlet-class&gt;org.apache.struts.action.ActionServlet&lt;/servlet-class&gt;<br /> &lt;init-param&gt;<br /> &lt;param-name&gt;config&lt;/param-name&gt;<br /> &lt;param-value&gt;/Web-INF/struts-config.xml&lt;/param-value&gt;<br /> &lt;/init-param&gt;<br /> &lt;/servlet&gt;<br /> &lt;servlet-mapping&gt;<br /> &lt;servlet-name&gt;action&lt;/servlet-name&gt;<br /> &lt;url-pattern&gt;*.do&lt;/url-pattern&gt;<br /> &lt;/servlet-mapping&gt;<br /> <br /> 2)Then I created the file &quot;struts-config.xml in the directory<br /> / Web-INF project and I set a GlobalForward as below name &quot;forgottenPasswordGlobalForward&quot;.<br /> <br /> <br /> &lt;?xml version=&quot;1.0&quot; encoding=&quot;ISO-8859-1&quot; ?&gt;<br /> &lt;!DOCTYPE struts-config PUBLIC<br /> &quot;-//Apache Software Foundation//DTD Struts Configuration<br /> 1.2//EN&quot;<br /> &quot;http://struts.apache.org/dtds/struts-config_1_2.dtd&quot;&gt;<br /> &lt;struts-config&gt;<br /> ...<br /> &lt;global-forwards &gt;<br /> &lt;forward name=&quot;forgottenPasswordGlobalForward&quot; path=&quot;/forgotten_password.jsp&quot;&gt;&lt;/forward&gt;<br /> &lt;/global-forwards&gt;<br /> <br /> ...<br /> &lt;/struts-config&gt;<br /> <br /> 3)I created a hyper link in my jsp as below:<br /> <br /> &lt;a href=&quot;forgottenPasswordGlobalForward.do&quot;&gt;<br /> Mon Lien hypertexte<br /> &lt;/a&gt;<br /> <br /> And I have this error :<br /> <br /> <br /> 2010-04-26 17:41:36,019: WARN [ErrorLoggingFilter] - Access denied for<br /> resource: /cms<br /> 2010-04-26 17:41:42,060: WARN [ErrorLoggingFilter] - Access denied for<br /> resource: /forgottenPasswordGlobalForward.do<br /> <br /> <br /> Thank you in advance .</p>

  • Number of messages  3
    Registration date Jun 7, 2011
    0 (0 Good)
    0 (0 Bad)

    Re: problem of using struts with Jahia6

    by  pap@commaro.com »  2011/06/07 20:43

    Hello,

    I think the problem lies in the first step. You are defining an ActionServlet in the web.xml, although Jahia already has a Struts ActionServlet defined. You should not overwrite that, but you can add your additional struts-config.xml in the config parameter list (delimited with commas).

    What is the outcome if you try that ?

    Regards,
    Benjamin

    Benjamin Papez (pap@commaro.com)

    Number of messages  220
    Registration date
    Contact
    Share
    Feedback

    Get in touch

    Whether you are a current user or if you are just evaluating Jahia, we are here to help.

    Contact us

    Share this page