You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Xibin Liu <Xi...@pwgsc.gc.ca> on 2008/01/02 20:26:32 UTC

Attribute name in tag param cannot be dynamic in struts 2.0.11

In tld of 2.0.11:

  <tag>
    <name>param</name>
    <tag-class>org.apache.struts2.views.jsp.ParamTag</tag-class>
    <body-content>JSP</body-content>
    <description><![CDATA[Parametrize other tags]]></description>
    <attribute>
      <name>name</name>
      <required>false</required>
      <rtexprvalue>false</rtexprvalue>
      <description><![CDATA[Name of Parameter to set]]></description>
    </attribute>


In tld of 2.0.9:

  <tag>
    <name>param</name>
    <tag-class>org.apache.struts2.views.jsp.ParamTag</tag-class>
    <body-content>JSP</body-content>
    <description><![CDATA[Parametrize other tags]]></description>
    <attribute>
      <name>name</name>
      <required>false</required>
      <rtexprvalue>true</rtexprvalue>
      <description><![CDATA[Name of Parameter to set]]></description>
    </attribute>

Is the change made this way intentionally?
Jps pages working under 2.0.9 have to be changed before being imported
to 2.0.11.

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: noobie .. breaking struts.xml ...

Posted by Dave Newton <ne...@yahoo.com>.
--- Adam Ruggles <a....@gmail.com> wrote:
> Looking at this pretty quickly it looks like you left out the class for
> your action="test"

It will just forward to the "success" result if no class is specified, like
S1's ForwardAction, but implicit.

d.

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: noobie .. breaking struts.xml ...

Posted by Mufaddal Khumri <mk...@allegrocentral.com>.
Dave,

I managed to get it working. The problem was that I had my struts.xml  
and struts-cw.xml inside of WEB-INF/ instead of WEB-INF/classes/

Thanks.

On Jan 2, 2008, at 8:50 PM, Dave Newton wrote:

> --- Mufaddal Khumri <mk...@allegrocentral.com> wrote:
>>    <package name="cw" namespace="/cw" extends="struts-default">
>>
>> The error I get:
>> ----------------
>> 8188 ERROR org.apache.struts2.dispatcher.Dispatcher serviceAction
>> [512] - Could not find action or result
>> There is no Action mapped for action name test. - [unknown location]
>
> That's a different error, no? You're going to /cw/test.action?
>
> Have you turned up S2 and XWork logging?
>
> You have the FreeMarker libs in the classpath?
>
> d.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: noobie .. breaking struts.xml ...

Posted by Dave Newton <ne...@yahoo.com>.
--- Mufaddal Khumri <mk...@allegrocentral.com> wrote:
>    <package name="cw" namespace="/cw" extends="struts-default">
> 
> The error I get:
> ----------------
> 8188 ERROR org.apache.struts2.dispatcher.Dispatcher serviceAction  
> [512] - Could not find action or result
> There is no Action mapped for action name test. - [unknown location]

That's a different error, no? You're going to /cw/test.action?

Have you turned up S2 and XWork logging?

You have the FreeMarker libs in the classpath?

d.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: noobie .. breaking struts.xml ...

Posted by Mufaddal Khumri <mk...@allegrocentral.com>.
Here are all the files with the TestAction as well. I still get the  
Exception. Any idea as to whats going on?

struts.xml
----------
<!DOCTYPE struts PUBLIC
     "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
     "http://struts.apache.org/dtds/struts-2.0.dtd">

<struts>
   <constant name="struts.devMode" value="true" />
   <include file="struts2-cw.xml"/>
</struts>

struts-cw.xml
-------------
<!DOCTYPE struts PUBLIC
     "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
     "http://struts.apache.org/dtds/struts-2.0.dtd">

<struts>
   <package name="cw" namespace="/cw" extends="struts-default">
	<action name="test" class="com.ac.web.actions.cw.TestAction">
	    <result name="success" type="freemarker">/cw/test.ftl</result>
	</action>	  		
   </package>

</struts>

Action class:
-------------

package com.ac.web.actions.cw;

import com.opensymphony.xwork2.ActionSupport;

public class TestAction extends ActionSupport
{
	private static final long serialVersionUID = 1L;

   public String execute() throws Exception
   {
     return SUCCESS;
   }

}



The error I get:
----------------
8188 ERROR org.apache.struts2.dispatcher.Dispatcher serviceAction  
[512] - Could not find action or result
There is no Action mapped for action name test. - [unknown location]
         at com.opensymphony.xwork2.DefaultActionProxy.prepare 
(DefaultActionProxy.java:186)
         at  
org.apache.struts2.impl.StrutsActionProxyFactory.createActionProxy 
(StrutsActionProxyFactory.java:41)
         at org.apache.struts2.dispatcher.Dispatcher.serviceAction 
(Dispatcher.java:494)
         at org.apache.struts2.dispatcher.FilterDispatcher.doFilter 
(FilterDispatcher.java:419)


Any clues as to what I may be doing wrong?

On Jan 2, 2008, at 6:17 PM, Adam Ruggles wrote:

> Looking at this pretty quickly it looks like you left out the class  
> for your
> action="test"
>
> On Jan 2, 2008 2:03 PM, Mufaddal Khumri  
> <mk...@allegrocentral.com> wrote:
>
>> I need to break my struts.xml into modules. So I came across this
>> page: http://struts.apache.org/2.x/docs/can-we-break-up-a-large-
>> strutsxml-file-into-smaller-pieces.html
>>
>> Accordingly, I tried this:
>>
>> struts.xml:
>> ==========
>> <!DOCTYPE struts PUBLIC
>>     "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
>>     "http://struts.apache.org/dtds/struts-2.0.dtd">
>>
>> <struts>
>>        <include file="struts-default.xml"/>
>>        <include file="struts2-cw.xml"/>
>> </struts>
>>
>> struts2-cw.xml:
>> ==============
>>
>> <!DOCTYPE struts PUBLIC
>>     "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
>>     "http://struts.apache.org/dtds/struts-2.0.dtd">
>>
>> <struts>
>>        <package name="default" extends="struts-default">
>>
>>        <action name="test">
>>            <result name="success" type="freemarker">/cw/test.ftl</ 
>> result>
>>        </action>
>>
>>        </package>
>>
>> </struts>
>>
>> Restarted my app and made a request like such:
>>
>> http://localhost/mywebapp/test.action
>>
>> I get this exception in my catalina.out under tomcat:
>>
>> 188419 ERROR org.apache.struts2.dispatcher.Dispatcher serviceAction
>> [512] - Could not find action or result
>> There is no Action mapped for namespace / and action name test. -
>> [unknown location]
>>         at com.opensymphony.xwork2.DefaultActionProxy.prepare
>> (DefaultActionProxy.java:186)
>>         at
>> org.apache.struts2.impl.StrutsActionProxyFactory.createActionProxy
>> (StrutsActionProxyFactory.java:41)
>>         at org.apache.struts2.dispatcher.Dispatcher.serviceAction
>> (Dispatcher.java:494)
>>         at org.apache.struts2.dispatcher.FilterDispatcher.doFilter
>> (FilterDispatcher.java:419)
>>
>> Any pointers as to where I am going wrong?
>>
>> Thanks.
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> For additional commands, e-mail: user-help@struts.apache.org
>>
>>


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: noobie .. breaking struts.xml ...

Posted by Adam Ruggles <a....@gmail.com>.
Looking at this pretty quickly it looks like you left out the class for your
action="test"

On Jan 2, 2008 2:03 PM, Mufaddal Khumri <mk...@allegrocentral.com> wrote:

> I need to break my struts.xml into modules. So I came across this
> page: http://struts.apache.org/2.x/docs/can-we-break-up-a-large-
> strutsxml-file-into-smaller-pieces.html
>
> Accordingly, I tried this:
>
> struts.xml:
> ==========
> <!DOCTYPE struts PUBLIC
>     "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
>     "http://struts.apache.org/dtds/struts-2.0.dtd">
>
> <struts>
>        <include file="struts-default.xml"/>
>        <include file="struts2-cw.xml"/>
> </struts>
>
> struts2-cw.xml:
> ==============
>
> <!DOCTYPE struts PUBLIC
>     "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
>     "http://struts.apache.org/dtds/struts-2.0.dtd">
>
> <struts>
>        <package name="default" extends="struts-default">
>
>        <action name="test">
>            <result name="success" type="freemarker">/cw/test.ftl</result>
>        </action>
>
>        </package>
>
> </struts>
>
> Restarted my app and made a request like such:
>
> http://localhost/mywebapp/test.action
>
> I get this exception in my catalina.out under tomcat:
>
> 188419 ERROR org.apache.struts2.dispatcher.Dispatcher serviceAction
> [512] - Could not find action or result
> There is no Action mapped for namespace / and action name test. -
> [unknown location]
>         at com.opensymphony.xwork2.DefaultActionProxy.prepare
> (DefaultActionProxy.java:186)
>         at
> org.apache.struts2.impl.StrutsActionProxyFactory.createActionProxy
> (StrutsActionProxyFactory.java:41)
>         at org.apache.struts2.dispatcher.Dispatcher.serviceAction
> (Dispatcher.java:494)
>         at org.apache.struts2.dispatcher.FilterDispatcher.doFilter
> (FilterDispatcher.java:419)
>
> Any pointers as to where I am going wrong?
>
> Thanks.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>

noobie .. breaking struts.xml ...

Posted by Mufaddal Khumri <mk...@allegrocentral.com>.
I need to break my struts.xml into modules. So I came across this  
page: http://struts.apache.org/2.x/docs/can-we-break-up-a-large- 
strutsxml-file-into-smaller-pieces.html

Accordingly, I tried this:

struts.xml:
==========
<!DOCTYPE struts PUBLIC
     "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
     "http://struts.apache.org/dtds/struts-2.0.dtd">

<struts>
   	<include file="struts-default.xml"/>
   	<include file="struts2-cw.xml"/>
</struts>

struts2-cw.xml:
==============

<!DOCTYPE struts PUBLIC
     "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
     "http://struts.apache.org/dtds/struts-2.0.dtd">

<struts>
	<package name="default" extends="struts-default">

	<action name="test">
	    <result name="success" type="freemarker">/cw/test.ftl</result>
	</action>	
		
	</package>

</struts>

Restarted my app and made a request like such:

http://localhost/mywebapp/test.action

I get this exception in my catalina.out under tomcat:

188419 ERROR org.apache.struts2.dispatcher.Dispatcher serviceAction  
[512] - Could not find action or result
There is no Action mapped for namespace / and action name test. -  
[unknown location]
         at com.opensymphony.xwork2.DefaultActionProxy.prepare 
(DefaultActionProxy.java:186)
         at  
org.apache.struts2.impl.StrutsActionProxyFactory.createActionProxy 
(StrutsActionProxyFactory.java:41)
         at org.apache.struts2.dispatcher.Dispatcher.serviceAction 
(Dispatcher.java:494)
         at org.apache.struts2.dispatcher.FilterDispatcher.doFilter 
(FilterDispatcher.java:419)

Any pointers as to where I am going wrong?

Thanks.

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Attribute name in tag param cannot be dynamic in struts 2.0.11

Posted by Laurie Harper <la...@holoweb.net>.
Xibin Liu wrote:
> In tld of 2.0.11:
> 
>   <tag>
>     <name>param</name>
>     <tag-class>org.apache.struts2.views.jsp.ParamTag</tag-class>
>     <body-content>JSP</body-content>
>     <description><![CDATA[Parametrize other tags]]></description>
>     <attribute>
>       <name>name</name>
>       <required>false</required>
>       <rtexprvalue>false</rtexprvalue>
>       <description><![CDATA[Name of Parameter to set]]></description>
>     </attribute>
> 
> 
> In tld of 2.0.9:
> 
>   <tag>
>     <name>param</name>
>     <tag-class>org.apache.struts2.views.jsp.ParamTag</tag-class>
>     <body-content>JSP</body-content>
>     <description><![CDATA[Parametrize other tags]]></description>
>     <attribute>
>       <name>name</name>
>       <required>false</required>
>       <rtexprvalue>true</rtexprvalue>
>       <description><![CDATA[Name of Parameter to set]]></description>
>     </attribute>
> 
> Is the change made this way intentionally?
> Jps pages working under 2.0.9 have to be changed before being imported
> to 2.0.11.

It's not very clearly called out in the release notes, but yes, this is 
an intentional change. The reason is that there is a security hole with 
rtexprvalue set to true. I can't find the relevant JIRA ticket off hand, 
but hopefully someone else will be able to supply that.

L.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org