Java Mailing List Archive

http://www.gg3721.com/

Home » Struts Users Mailing List »

user Digest 23 Dec 2009 16:10:45 -0000 Issue 8967

user-digest-help

2009-12-23


Author LoginPost Reply

user Digest 23 Dec 2009 16:10:45 -0000 Issue 8967

Topics (messages 204372 through 204392):

Re: Strusts Error - no Action mapped for action name HelloWorld
 204372 by: Pawe³ Wielgus
 204373 by: dhammikas
 204374 by: dhammikas
 204375 by: dhammikas

if tag with #parameters
 204376 by: foo bar
 204377 by: Saeed Iqbal
 204378 by: foo bar
 204379 by: Gabriel Belingueres
 204382 by: xerax nono
 204387 by: Wes Wannemacher

best practices in struts 2.1 - Tiles and Convention - clean URLs with minimum number of actions
 204380 by: Charles Parker

[S2] <s:select> can't use ENUM type
 204381 by: mailtolouis2020-struts.yahoo.com
 204383 by: Steven Yang
 204389 by: mailtolouis2020-struts.yahoo.com

how do I use absolute url actions in html:form tag with struts 1.3.8
 204384 by: Jason Novotny

UI Component - ${parameters.paramName} not working
 204385 by: Vitor E. Silva Souza
 204386 by: Gabriel Belingueres
 204388 by: Wes Wannemacher

Struts 1.2.x and File I/O
 204390 by: davargas123
 204391 by: Pawe³ Wielgus
 204392 by: davargas123

Administrivia:

---------------------------------------------------------------------
To post to the list, e-mail: user@(protected)
To unsubscribe, e-mail: user-digest-unsubscribe@(protected)
For additional commands, e-mail: user-digest-help@(protected)

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


Attachment: user_204372.ezm (zipped)
Hi Dham,
use config browser plugin to verify your configuration:
http://poulwiel.blogspot.com/2009/09/config-browser-plugin-in-struts2.html

Also try to first run blank or demo app from struts_apps.zip and then
modify it to suit your needs.

Best greetings,
Paweł Wielgus.

2009/12/22 dhammikas <dhammikas@(protected)>:
>
> Dear All,
> I am very new to strusts 2.1 and just struggling with up and running the
> hello world app. Following is the error that i am getting
>
> ------------------------------------------------------------------------------------
> WARNING: Could not find action or result
> There is no Action mapped for action name HelloWorld. - [unknown location]
>        at
> com.opensymphony.xwork2.DefaultActionProxy.prepare (DefaultActionProxy.java:178)
>        at
> org.apache.struts2.impl.StrutsActionProxy.prepare (StrutsActionProxy.java:61)
>        at
> org.apache.struts2.impl.StrutsActionProxyFactory.createActionProxy (StrutsActionProxyFactory.java:39)
>        at
> com.opensymphony.xwork2.DefaultActionProxyFactory.createActionProxy (DefaultActionProxyFactory.java:47)
>        at
> org.apache.struts2.dispatcher.Dispatcher.serviceAction (Dispatcher.java:478)
>        at
> org.apache.struts2.dispatcher.ng.ExecuteOperations.executeAction (ExecuteOperations.java:77)
>        at
> org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter (StrutsPrepareAndExecuteFilter.java:91)
>        at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter (ApplicationFilterChain.java:235)
>        at
> org.apache.catalina.core.ApplicationFilterChain.doFilter (ApplicationFilterChain.java:206)
>        at
> org.apache.catalina.core.StandardWrapperValve.invoke (StandardWrapperValve.java:233)
>        at
> org.apache.catalina.core.StandardContextValve.invoke (StandardContextValve.java:191)
>        at
> org.apache.catalina.core.StandardHostValve.invoke (StandardHostValve.java:128)
>        at
> org.apache.catalina.valves.ErrorReportValve.invoke (ErrorReportValve.java:102)
>        at
> org.apache.catalina.core.StandardEngineValve.invoke (StandardEngineValve.java:109)
>        at
> org.apache.catalina.connector.CoyoteAdapter.service (CoyoteAdapter.java:286)
>        at
> org.apache.coyote.http11.Http11Processor.process (Http11Processor.java:845)
>        at
> org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
>        at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
>        at java.lang.Thread.run(Unknown Source)
>
> ------------------------------------------------------------------------------------
> Following is the mapping at web.xml
>
>
>  <display-name>hw</display-name>
>
>
>  <filter>
>        <filter-name>struts2</filter-name>
>
> <filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class>
>        <init-param>
>                <param-name>actionPackages</param-name>
>                <param-value>sample</param-value>
>        </init-param>
>    </filter>
>
>
>  <filter-mapping>
>      <filter-name>struts2</filter-name>
>      <url-pattern>/*</url-pattern>
>  </filter-mapping>
>
>
> ------------------------------------------------------------------------------------
> Following is the strusts.xml mapping
>
> <struts>
>    <constant name="struts.enable.DynamicMethodInvocation" value="false"/>
>    <constant name="struts.devMode" value="false"/>
>
>    <package name="sample" namespace="/sample" extends="struts-default">
>        <action name="HelloWorld" class="sample.HelloWorld">
>            <result>/pages/helloWorld.jsp</result>
>        </action>
>    </package>
> </struts>
>
>
> ------------------------------------------------------------------------------------
> Following is the sample.HelloWorld.java
>
> package sample;
>
> import com.opensymphony.xwork2.ActionSupport;
>
> public class HelloWorld extends ActionSupport{
>
>    private String message;
>
>    public String getMessage() {
>        return message;
>    }
>
>    public void setMessage(String message) {
>        this.message = message;
>    }
>
>    public String execute() throws Exception {
>        setMessage("Hello World!");
>        return SUCCESS;
>    }
>
>
> }
>
>
> ------------------------------------------------------------------------------------
> Following is the /pages/helloWorld.jsp
>
> <%@(protected)" %>
>
> <html>
> <head>
> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
> <title>Hello World</title>
>
> </head>
> <body>
> <div align=left>To your information this is your helloWorld.jsp page under
> WebContent directiory.</div>
> <br>
> <br>
> <center><h1><s:property value="message"/></h1></center>
> </body>
> </html>
>
>
> ------------------------------------------------------------------------------------
> Following is the url being used to access the helloWorld.jsp
>
> http://localhost:8080/hw/sample/HelloWorld.action
> http://localhost:8080/hw/sample/HelloWorld.action
>
>
>
> ------------------------------------------------------------------------------------
>
> ANYBODY, PLEASE BE KIND ENOUGH TO HELP ME TO GET RID OF THIS TERRIBLE DAMN
> ERROR.
>
> Thanking and please let me know any concerns/thoughts.
> Dham
>
> --
> View this message in context: http://old.nabble.com/Strusts-Error----no-Action-mapped-for-action-name-HelloWorld-tp26884710p26884710.html
> Sent from the Struts - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>


Attachment: user_204373.ezm (zipped)

Dear Paweł,

Thanks a lot for the kind reply, i got in with the browser plugin feature
and it shows nothing with the "Actions in default namespace ", so i guess
there should be some basic mismatch in my app though it seems ok and nice..
btw i found a better post about browser plugin here,
http://devtalks.blogspot.com/2009/10/struts2-config-browser-plugin.html
http://devtalks.blogspot.com/2009/10/struts2-config-browser-plugin.html


Well, now i am on with ur second suggestion, modifying the blank demo and
try to make up and running.. let me come back with any good news..
Thanks a lot for advice.
Dham





Paweł Wielgus wrote:
>
> Hi Dham,
> use config browser plugin to verify your configuration:
> http://poulwiel.blogspot.com/2009/09/config-browser-plugin-in-struts2.html
>
> Also try to first run blank or demo app from struts_apps.zip and then
> modify it to suit your needs.
>
> Best greetings,
> Paweł Wielgus.
>
> 2009/12/22 dhammikas <dhammikas@(protected)>:
>>
>> Dear All,
>> I am very new to strusts 2.1 and just struggling with up and running the
>> hello world app. Following is the error that i am getting
>>
>> ------------------------------------------------------------------------------------
>> WARNING: Could not find action or result
>> There is no Action mapped for action name HelloWorld. - [unknown
>> location]
>>        at
>> com.opensymphony.xwork2.DefaultActionProxy.prepare (DefaultActionProxy.java:178)
>>        at
>> org.apache.struts2.impl.StrutsActionProxy.prepare (StrutsActionProxy.java:61)
>>        at
>> org.apache.struts2.impl.StrutsActionProxyFactory.createActionProxy (StrutsActionProxyFactory.java:39)
>>        at
>> com.opensymphony.xwork2.DefaultActionProxyFactory.createActionProxy (DefaultActionProxyFactory.java:47)
>>        at
>> org.apache.struts2.dispatcher.Dispatcher.serviceAction (Dispatcher.java:478)
>>        at
>> org.apache.struts2.dispatcher.ng.ExecuteOperations.executeAction (ExecuteOperations.java:77)
>>        at
>> org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter (StrutsPrepareAndExecuteFilter.java:91)
>>        at
>> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter (ApplicationFilterChain.java:235)
>>        at
>> org.apache.catalina.core.ApplicationFilterChain.doFilter (ApplicationFilterChain.java:206)
>>        at
>> org.apache.catalina.core.StandardWrapperValve.invoke (StandardWrapperValve.java:233)
>>        at
>> org.apache.catalina.core.StandardContextValve.invoke (StandardContextValve.java:191)
>>        at
>> org.apache.catalina.core.StandardHostValve.invoke (StandardHostValve.java:128)
>>        at
>> org.apache.catalina.valves.ErrorReportValve.invoke (ErrorReportValve.java:102)
>>        at
>> org.apache.catalina.core.StandardEngineValve.invoke (StandardEngineValve.java:109)
>>        at
>> org.apache.catalina.connector.CoyoteAdapter.service (CoyoteAdapter.java:286)
>>        at
>> org.apache.coyote.http11.Http11Processor.process (Http11Processor.java:845)
>>        at
>> org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
>>        at
>> org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
>>        at java.lang.Thread.run(Unknown Source)
>>
>> ------------------------------------------------------------------------------------
>> Following is the mapping at web.xml
>>
>>
>>  <display-name>hw</display-name>
>>
>>
>>  <filter>
>>        <filter-name>struts2</filter-name>
>>
>> <filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class>
>>        <init-param>
>>                <param-name>actionPackages</param-name>
>>                <param-value>sample</param-value>
>>        </init-param>
>>    </filter>
>>
>>
>>  <filter-mapping>
>>      <filter-name>struts2</filter-name>
>>      <url-pattern>/*</url-pattern>
>>  </filter-mapping>
>>
>>
>> ------------------------------------------------------------------------------------
>> Following is the strusts.xml mapping
>>
>> <struts>
>>    <constant name="struts.enable.DynamicMethodInvocation" value="false"/>
>>    <constant name="struts.devMode" value="false"/>
>>
>>    <package name="sample" namespace="/sample" extends="struts-default">
>>        <action name="HelloWorld" class="sample.HelloWorld">
>>            <result>/pages/helloWorld.jsp</result>
>>        </action>
>>    </package>
>> </struts>
>>
>>
>> ------------------------------------------------------------------------------------
>> Following is the sample.HelloWorld.java
>>
>> package sample;
>>
>> import com.opensymphony.xwork2.ActionSupport;
>>
>> public class HelloWorld extends ActionSupport{
>>
>>    private String message;
>>
>>    public String getMessage() {
>>        return message;
>>    }
>>
>>    public void setMessage(String message) {
>>        this.message = message;
>>    }
>>
>>    public String execute() throws Exception {
>>        setMessage("Hello World!");
>>        return SUCCESS;
>>    }
>>
>>
>> }
>>
>>
>> ------------------------------------------------------------------------------------
>> Following is the /pages/helloWorld.jsp
>>
>> <%@(protected)" %>
>>
>> <html>
>> <head>
>> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
>> <title>Hello World</title>
>>
>> </head>
>> <body>
>> <div align=left>To your information this is your helloWorld.jsp page
>> under
>> WebContent directiory.</div>
>> <br>
>> <br>
>> <center><h1><s:property value="message"/></h1></center>
>> </body>
>> </html>
>>
>>
>> ------------------------------------------------------------------------------------
>> Following is the url being used to access the helloWorld.jsp
>>
>> http://localhost:8080/hw/sample/HelloWorld.action
>> http://localhost:8080/hw/sample/HelloWorld.action
>>
>>
>>
>> ------------------------------------------------------------------------------------
>>
>> ANYBODY, PLEASE BE KIND ENOUGH TO HELP ME TO GET RID OF THIS TERRIBLE
>> DAMN
>> ERROR.
>>
>> Thanking and please let me know any concerns/thoughts.
>> Dham
>>
>> --
>> View this message in context:
>> http://old.nabble.com/Strusts-Error----no-Action-mapped-for-action-name-HelloWorld-tp26884710p26884710.html
>> Sent from the Struts - User mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@(protected)
>> For additional commands, e-mail: user-help@(protected)
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>
>

--
Sent from the Struts - User mailing list archive at Nabble.com.



Attachment: user_204374.ezm (zipped)

Please return later to see if your message was accepted by the mailing list.
If there is a problem, Nabble will alert you by email and provide additional
instructions.
Dear Paweł,

Thanks a lot for the kind reply, i got in with the browser plugin feature
and it shows nothing with the "Actions in default namespace ", so i guess
there should be some basic mismatch in my app though it seems ok and nice..
btw i found a better post about browser plugin here,
http://devtalks.blogspot.com/2009/10/struts2-config-browser-plugin.html
http://devtalks.blogspot.com/2009/10/struts2-config-browser-plugin.html


Well, now i am on with ur second suggestion, modifying the blank demo and
try to make up and running.. let me come back with any good news..
Thanks a lot for advice.
Dham





Paweł Wielgus wrote:
>
> Hi Dham,
> use config browser plugin to verify your configuration:
> http://poulwiel.blogspot.com/2009/09/config-browser-plugin-in-struts2.html
>
> Also try to first run blank or demo app from struts_apps.zip and then
> modify it to suit your needs.
>
> Best greetings,
> Paweł Wielgus.
>
> 2009/12/22 dhammikas <dhammikas@(protected)>:
>>
>> Dear All,
>> I am very new to strusts 2.1 and just struggling with up and running the
>> hello world app. Following is the error that i am getting
>>
>> ------------------------------------------------------------------------------------
>> WARNING: Could not find action or result
>> There is no Action mapped for action name HelloWorld. - [unknown
>> location]
>>        at
>> com.opensymphony.xwork2.DefaultActionProxy.prepare (DefaultActionProxy.java:178)
>>        at
>> org.apache.struts2.impl.StrutsActionProxy.prepare (StrutsActionProxy.java:61)
>>        at
>> org.apache.struts2.impl.StrutsActionProxyFactory.createActionProxy (StrutsActionProxyFactory.java:39)
>>        at
>> com.opensymphony.xwork2.DefaultActionProxyFactory.createActionProxy (DefaultActionProxyFactory.java:47)
>>        at
>> org.apache.struts2.dispatcher.Dispatcher.serviceAction (Dispatcher.java:478)
>>        at
>> org.apache.struts2.dispatcher.ng.ExecuteOperations.executeAction (ExecuteOperations.java:77)
>>        at
>> org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter (StrutsPrepareAndExecuteFilter.java:91)
>>        at
>> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter (ApplicationFilterChain.java:235)
>>        at
>> org.apache.catalina.core.ApplicationFilterChain.doFilter (ApplicationFilterChain.java:206)
>>        at
>> org.apache.catalina.core.StandardWrapperValve.invoke (StandardWrapperValve.java:233)
>>        at
>> org.apache.catalina.core.StandardContextValve.invoke (StandardContextValve.java:191)
>>        at
>> org.apache.catalina.core.StandardHostValve.invoke (StandardHostValve.java:128)
>>        at
>> org.apache.catalina.valves.ErrorReportValve.invoke (ErrorReportValve.java:102)
>>        at
>> org.apache.catalina.core.StandardEngineValve.invoke (StandardEngineValve.java:109)
>>        at
>> org.apache.catalina.connector.CoyoteAdapter.service (CoyoteAdapter.java:286)
>>        at
>> org.apache.coyote.http11.Http11Processor.process (Http11Processor.java:845)
>>        at
>> org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
>>        at
>> org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
>>        at java.lang.Thread.run(Unknown Source)
>>
>> ------------------------------------------------------------------------------------
>> Following is the mapping at web.xml
>>
>>
>>  <display-name>hw</display-name>
>>
>>
>>  <filter>
>>        <filter-name>struts2</filter-name>
>>
>> <filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class>
>>        <init-param>
>>                <param-name>actionPackages</param-name>
>>                <param-value>sample</param-value>
>>        </init-param>
>>    </filter>
>>
>>
>>  <filter-mapping>
>>      <filter-name>struts2</filter-name>
>>      <url-pattern>/*</url-pattern>
>>  </filter-mapping>
>>
>>
>> ------------------------------------------------------------------------------------
>> Following is the strusts.xml mapping
>>
>> <struts>
>>    <constant name="struts.enable.DynamicMethodInvocation" value="false"/>
>>    <constant name="struts.devMode" value="false"/>
>>
>>    <package name="sample" namespace="/sample" extends="struts-default">
>>        <action name="HelloWorld" class="sample.HelloWorld">
>>            <result>/pages/helloWorld.jsp</result>
>>        </action>
>>    </package>
>> </struts>
>>
>>
>> ------------------------------------------------------------------------------------
>> Following is the sample.HelloWorld.java
>>
>> package sample;
>>
>> import com.opensymphony.xwork2.ActionSupport;
>>
>> public class HelloWorld extends ActionSupport{
>>
>>    private String message;
>>
>>    public String getMessage() {
>>        return message;
>>    }
>>
>>    public void setMessage(String message) {
>>        this.message = message;
>>    }
>>
>>    public String execute() throws Exception {
>>        setMessage("Hello World!");
>>        return SUCCESS;
>>    }
>>
>>
>> }
>>
>>
>> ------------------------------------------------------------------------------------
>> Following is the /pages/helloWorld.jsp
>>
>> <%@(protected)" %>
>>
>> <html>
>> <head>
>> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
>> <title>Hello World</title>
>>
>> </head>
>> <body>
>> <div align=left>To your information this is your helloWorld.jsp page
>> under
>> WebContent directiory.</div>
>> <br>
>> <br>
>> <center><h1><s:property value="message"/></h1></center>
>> </body>
>> </html>
>>
>>
>> ------------------------------------------------------------------------------------
>> Following is the url being used to access the helloWorld.jsp
>>
>> http://localhost:8080/hw/sample/HelloWorld.action
>> http://localhost:8080/hw/sample/HelloWorld.action
>>
>>
>>
>> ------------------------------------------------------------------------------------
>>
>> ANYBODY, PLEASE BE KIND ENOUGH TO HELP ME TO GET RID OF THIS TERRIBLE
>> DAMN
>> ERROR.
>>
>> Thanking and please let me know any concerns/thoughts.
>> Dham
>>
>> --
>> View this message in context:
>> http://old.nabble.com/Strusts-Error----no-Action-mapped-for-action-name-HelloWorld-tp26884710p26884710.html
>> Sent from the Struts - User mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@(protected)
>> For additional commands, e-mail: user-help@(protected)
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>
>

--
Sent from the Struts - User mailing list archive at Nabble.com.



Attachment: user_204375.ezm (zipped)

Hello All,

I was able to bring the strusts's blank demo up and running :) , but my
previous app is also holding the same piece of architecture, i went thourhg
and checked twice, the structure/features and syntax are totally identical
and am not able to find out where the actual fault is..

Anyway I have done what I need in a alternative way... Thanks a lot Pawel
for the tips..

Cheers


Dear Paweł,

Thanks a lot for the kind reply, i got in with the browser plugin feature
and it shows nothing with the "Actions in default namespace ", so i guess
there should be some basic mismatch in my app though it seems ok and nice..
btw i found a better post about browser plugin here,
http://devtalks.blogspot.com/2009/10/struts2-config-browser-plugin.html
http://devtalks.blogspot.com/2009/10/struts2-config-browser-plugin.html


Well, now i am on with ur second suggestion, modifying the blank demo and
try to make up and running.. let me come back with any good news..
Thanks a lot for advice.
Dham





Paweł Wielgus wrote:
>
> Hi Dham,
> use config browser plugin to verify your configuration:
> http://poulwiel.blogspot.com/2009/09/config-browser-plugin-in-struts2.html
>
> Also try to first run blank or demo app from struts_apps.zip and then
> modify it to suit your needs.
>
> Best greetings,
> Paweł Wielgus.
>
> 2009/12/22 dhammikas <dhammikas@(protected)>:
>>
>> Dear All,
>> I am very new to strusts 2.1 and just struggling with up and running the
>> hello world app. Following is the error that i am getting
>>
>> ------------------------------------------------------------------------------------
>> WARNING: Could not find action or result
>> There is no Action mapped for action name HelloWorld. - [unknown
>> location]
>>        at
>> com.opensymphony.xwork2.DefaultActionProxy.prepare (DefaultActionProxy.java:178)
>>        at
>> org.apache.struts2.impl.StrutsActionProxy.prepare (StrutsActionProxy.java:61)
>>        at
>> org.apache.struts2.impl.StrutsActionProxyFactory.createActionProxy (StrutsActionProxyFactory.java:39)
>>        at
>> com.opensymphony.xwork2.DefaultActionProxyFactory.createActionProxy (DefaultActionProxyFactory.java:47)
>>        at
>> org.apache.struts2.dispatcher.Dispatcher.serviceAction (Dispatcher.java:478)
>>        at
>> org.apache.struts2.dispatcher.ng.ExecuteOperations.executeAction (ExecuteOperations.java:77)
>>        at
>> org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter (StrutsPrepareAndExecuteFilter.java:91)
>>        at
>> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter (ApplicationFilterChain.java:235)
>>        at
>> org.apache.catalina.core.ApplicationFilterChain.doFilter (ApplicationFilterChain.java:206)
>>        at
>> org.apache.catalina.core.StandardWrapperValve.invoke (StandardWrapperValve.java:233)
>>        at
>> org.apache.catalina.core.StandardContextValve.invoke (StandardContextValve.java:191)
>>        at
>> org.apache.catalina.core.StandardHostValve.invoke (StandardHostValve.java:128)
>>        at
>> org.apache.catalina.valves.ErrorReportValve.invoke (ErrorReportValve.java:102)
>>        at
>> org.apache.catalina.core.StandardEngineValve.invoke (StandardEngineValve.java:109)
>>        at
>> org.apache.catalina.connector.CoyoteAdapter.service (CoyoteAdapter.java:286)
>>        at
>> org.apache.coyote.http11.Http11Processor.process (Http11Processor.java:845)
>>        at
>> org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
>>        at
>> org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
>>        at java.lang.Thread.run(Unknown Source)
>>
>> ------------------------------------------------------------------------------------
>> Following is the mapping at web.xml
>>
>>
>>  <display-name>hw</display-name>
>>
>>
>>  <filter>
>>        <filter-name>struts2</filter-name>
>>
>> <filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class>
>>        <init-param>
>>                <param-name>actionPackages</param-name>
>>                <param-value>sample</param-value>
>>        </init-param>
>>    </filter>
>>
>>
>>  <filter-mapping>
>>      <filter-name>struts2</filter-name>
>>      <url-pattern>/*</url-pattern>
>>  </filter-mapping>
>>
>>
>> ------------------------------------------------------------------------------------
>> Following is the strusts.xml mapping
>>
>> <struts>
>>    <constant name="struts.enable.DynamicMethodInvocation" value="false"/>
>>    <constant name="struts.devMode" value="false"/>
>>
>>    <package name="sample" namespace="/sample" extends="struts-default">
>>        <action name="HelloWorld" class="sample.HelloWorld">
>>            <result>/pages/helloWorld.jsp</result>
>>        </action>
>>    </package>
>> </struts>
>>
>>
>> ------------------------------------------------------------------------------------
>> Following is the sample.HelloWorld.java
>>
>> package sample;
>>
>> import com.opensymphony.xwork2.ActionSupport;
>>
>> public class HelloWorld extends ActionSupport{
>>
>>    private String message;
>>
>>    public String getMessage() {
>>        return message;
>>    }
>>
>>    public void setMessage(String message) {
>>        this.message = message;
>>    }
>>
>>    public String execute() throws Exception {
>>        setMessage("Hello World!");
>>        return SUCCESS;
>>    }
>>
>>
>> }
>>
>>
>> ------------------------------------------------------------------------------------
>> Following is the /pages/helloWorld.jsp
>>
>> <%@(protected)" %>
>>
>> <html>
>> <head>
>> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
>> <title>Hello World</title>
>>
>> </head>
>> <body>
>> <div align=left>To your information this is your helloWorld.jsp page
>> under
>> WebContent directiory.</div>
>> <br>
>> <br>
>> <center><h1><s:property value="message"/></h1></center>
>> </body>
>> </html>
>>
>>
>> ------------------------------------------------------------------------------------
>> Following is the url being used to access the helloWorld.jsp
>>
>> http://localhost:8080/hw/sample/HelloWorld.action
>> http://localhost:8080/hw/sample/HelloWorld.action
>>
>>
>>
>> ------------------------------------------------------------------------------------
>>
>> ANYBODY, PLEASE BE KIND ENOUGH TO HELP ME TO GET RID OF THIS TERRIBLE
>> DAMN
>> ERROR.
>>
>> Thanking and please let me know any concerns/thoughts.
>> Dham
>>
>> --
>> View this message in context:
>> http://old.nabble.com/Strusts-Error----no-Action-mapped-for-action-name-HelloWorld-tp26884710p26884710.html
>> Sent from the Struts - User mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@(protected)
>> For additional commands, e-mail: user-help@(protected)
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>
>



--
Sent from the Struts - User mailing list archive at Nabble.com.



Attachment: user_204376.ezm (zipped)
Hi all,

I'm testing for the existence of a request parameter in a jsp page in Struts 2

<%@(protected)"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<s:property value="#parameters.messageKey"/><br/>
<s:if test="%{#parameters.messageKey == 'yes'}">
yes
</s:if>
<s:else>
no
</s:else>

But, whatever I do, result is always "no"

Tested with these cases:

test.jsp
test.jsp?messageKey=
test.jsp?messageKey=yes
test.jsp?messageKey=no

Changed it to <s:if test="#parameters.messageKey == 'yes'">, same results
Changed it to <s:if test="{#parameters.messageKey == 'yes'}">, results
are negated as above, ie you got "no" when previously you got "yes"

What's the solution here ?

Cheers


Attachment: user_204377.ezm (zipped)
If it is a request parameter, then make a setter for it to get set and
getter to retrieve it and use % instead of #

If you want to have the parameter in the page context use the s:set with id



On Tue, Dec 22, 2009 at 3:36 PM, foo bar <linutrix@(protected):

> Hi all,
>
> I'm testing for the existence of a request parameter in a jsp page in
> Struts 2
>
> <%@(protected)"%>
> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
> "http://www.w3.org/TR/html4/strict.dtd">
> <s:property value="#parameters.messageKey"/><br/>
> <s:if test="%{#parameters.messageKey == 'yes'}">
> yes
> </s:if>
> <s:else>
> no
> </s:else>
>
> But, whatever I do, result is always "no"
>
> Tested with these cases:
>
> test.jsp
> test.jsp?messageKey=
> test.jsp?messageKey=yes
> test.jsp?messageKey=no
>
> Changed it to <s:if test="#parameters.messageKey == 'yes'">, same results
> Changed it to <s:if test="{#parameters.messageKey == 'yes'}">, results
> are negated as above, ie you got "no" when previously you got "yes"
>
> What's the solution here ?
>
> Cheers
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>


--
Saeed Iqbal
Independant Consultant
J2EE - Application Architect / Developer

Attachment: user_204378.ezm (zipped)
Hi,

I would prefer not to use getter/setter.
What I really want to know is, why is this not working as expected ?

Anyway, I solved it

<s:if test="#parameters.messageKey[0] == 'yes'">

#parameters.messageKey is of type String[], which make sense now


On Tue, Dec 22, 2009 at 9:46 PM, Saeed Iqbal <saeedcs@(protected):
> If it is a request parameter, then make a setter for it to get set and
> getter to retrieve it and use % instead of #
>
> If you want to have the parameter in the page context use the s:set with id
>
>
>
> On Tue, Dec 22, 2009 at 3:36 PM, foo bar <linutrix@(protected):
>
>> Hi all,
>>
>> I'm testing for the existence of a request parameter in a jsp page in
>> Struts 2
>>
>> <%@(protected)"%>
>> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
>> "http://www.w3.org/TR/html4/strict.dtd">
>> <s:property value="#parameters.messageKey"/><br/>
>> <s:if test="%{#parameters.messageKey == 'yes'}">
>> yes
>> </s:if>
>> <s:else>
>> no
>> </s:else>
>>
>> But, whatever I do, result is always "no"
>>
>> Tested with these cases:
>>
>> test.jsp
>> test.jsp?messageKey=
>> test.jsp?messageKey=yes
>> test.jsp?messageKey=no
>>
>> Changed it to <s:if test="#parameters.messageKey == 'yes'">, same results
>> Changed it to <s:if test="{#parameters.messageKey == 'yes'}">, results
>> are negated as above, ie you got "no" when previously you got "yes"
>>
>> What's the solution here ?
>>
>> Cheers
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@(protected)
>> For additional commands, e-mail: user-help@(protected)
>>
>>
>
>
> --
> Saeed Iqbal
> Independant Consultant
> J2EE - Application Architect / Developer
>


Attachment: user_204379.ezm (zipped)
Yes, parameters are String arrays. As a side note, see the following
post because sometimes OGNL evaluates things differently:

http://www.mail-archive.com/user@(protected)

2009/12/22 foo bar <linutrix@(protected)>:
> Hi,
>
> I would prefer not to use getter/setter.
> What I really want to know is, why is this not working as expected ?
>
> Anyway, I solved it
>
> <s:if test="#parameters.messageKey[0] == 'yes'">
>
> #parameters.messageKey is of type String[], which make sense now
>
>
> On Tue, Dec 22, 2009 at 9:46 PM, Saeed Iqbal <saeedcs@(protected):
>> If it is a request parameter, then make a setter for it to get set and
>> getter to retrieve it and use % instead of #
>>
>> If you want to have the parameter in the page context use the s:set with id
>>
>>
>>
>> On Tue, Dec 22, 2009 at 3:36 PM, foo bar <linutrix@(protected):
>>
>>> Hi all,
>>>
>>> I'm testing for the existence of a request parameter in a jsp page in
>>> Struts 2
>>>
>>> <%@(protected)"%>
>>> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
>>> "http://www.w3.org/TR/html4/strict.dtd">
>>> <s:property value="#parameters.messageKey"/><br/>
>>> <s:if test="%{#parameters.messageKey == 'yes'}">
>>> yes
>>> </s:if>
>>> <s:else>
>>> no
>>> </s:else>
>>>
>>> But, whatever I do, result is always "no"
>>>
>>> Tested with these cases:
>>>
>>> test.jsp
>>> test.jsp?messageKey=
>>> test.jsp?messageKey=yes
>>> test.jsp?messageKey=no
>>>
>>> Changed it to <s:if test="#parameters.messageKey == 'yes'">, same results
>>> Changed it to <s:if test="{#parameters.messageKey == 'yes'}">, results
>>> are negated as above, ie you got "no" when previously you got "yes"
>>>
>>> What's the solution here ?
>>>
>>> Cheers
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: user-unsubscribe@(protected)
>>> For additional commands, e-mail: user-help@(protected)
>>>
>>>
>>
>>
>> --
>> Saeed Iqbal
>> Independant Consultant
>> J2EE - Application Architect / Developer
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>


Attachment: user_204382.ezm (zipped)
I think that the correct test is:

<s:property value="#messageKey"/><br/>
<s:if test="%{#messageKey == 'yes'}">
yes
2009/12/22 foo bar <linutrix@(protected)>

> Hi all,
>
> I'm testing for the existence of a request parameter in a jsp page in
> Struts 2
>
> <%@(protected)"%>
> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
> "http://www.w3.org/TR/html4/strict.dtd">
> <s:property value="#parameters.messageKey"/><br/>
> <s:if test="%{#parameters.messageKey == 'yes'}">
> yes
> </s:if>
> <s:else>
> no
> </s:else>
>
> But, whatever I do, result is always "no"
>
> Tested with these cases:
>
> test.jsp
> test.jsp?messageKey=
> test.jsp?messageKey=yes
> test.jsp?messageKey=no
>
> Changed it to <s:if test="#parameters.messageKey == 'yes'">, same results
> Changed it to <s:if test="{#parameters.messageKey == 'yes'}">, results
> are negated as above, ie you got "no" when previously you got "yes"
>
> What's the solution here ?
>
> Cheers
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>


--
Serafin Hernandez Blazquez
649 81 64 87

Attachment: user_204387.ezm (zipped)
I have used a similar construct quite a bit, but normally, I refer to
parameters like this -

<s:if test="%{#parameters['view'] != null}">
view
</s:if>
<s:else>
not view
</s:else>

In cases like this, I just want to affect the way a view is rendered.
So, leaving the getter/setter off of the action is the way to go.

-Wes

On Tue, Dec 22, 2009 at 6:05 AM, foo bar <linutrix@(protected):
> Hi,
>
> I would prefer not to use getter/setter.
> What I really want to know is, why is this not working as expected ?
>
> Anyway, I solved it
>
> <s:if test="#parameters.messageKey[0] == 'yes'">
>
> #parameters.messageKey is of type String[], which make sense now
>
>
> On Tue, Dec 22, 2009 at 9:46 PM, Saeed Iqbal <saeedcs@(protected):
>> If it is a request parameter, then make a setter for it to get set and
>> getter to retrieve it and use % instead of #
>>
>> If you want to have the parameter in the page context use the s:set with id
>>
>>
>>
>> On Tue, Dec 22, 2009 at 3:36 PM, foo bar <linutrix@(protected):
>>
>>> Hi all,
>>>
>>> I'm testing for the existence of a request parameter in a jsp page in
>>> Struts 2
>>>
>>> <%@(protected)"%>
>>> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
>>> "http://www.w3.org/TR/html4/strict.dtd">
>>> <s:property value="#parameters.messageKey"/><br/>
>>> <s:if test="%{#parameters.messageKey == 'yes'}">
>>> yes
>>> </s:if>
>>> <s:else>
>>> no
>>> </s:else>
>>>
>>> But, whatever I do, result is always "no"
>>>
>>> Tested with these cases:
>>>
>>> test.jsp
>>> test.jsp?messageKey=
>>> test.jsp?messageKey=yes
>>> test.jsp?messageKey=no
>>>
>>> Changed it to <s:if test="#parameters.messageKey == 'yes'">, same results
>>> Changed it to <s:if test="{#parameters.messageKey == 'yes'}">, results
>>> are negated as above, ie you got "no" when previously you got "yes"
>>>
>>> What's the solution here ?
>>>
>>> Cheers
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: user-unsubscribe@(protected)
>>> For additional commands, e-mail: user-help@(protected)
>>>
>>>
>>
>>
>> --
>> Saeed Iqbal
>> Independant Consultant
>> J2EE - Application Architect / Developer
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>



--
Wes Wannemacher

Head Engineer, WanTii, Inc.
Need Training? Struts, Spring, Maven, Tomcat...
Ask me for a quote!


Attachment: user_204380.ezm (zipped)
I'm using struts 2.1.8.1 here and have a question about best practices
in the following situation:

I have a form page, 'register'. It takes several fields, username,
password, etc.

I want the initial form page to be rendered via GET:

http://my.server.net/register

This shows the blank form (the tile definition below), without
attempting to validate the fields.

 <definition name="registrationPage" extends="defaultLayout">
    <put-attribute name="content"
value="/WEB-INF/pages/registration.jsp"/>
 </definition>

On POST to the same URL 'http://my.server.net/register', I want to
perform validation on the form, (via register-validation.xml or
Annotation). If the form validates then perform the action that triggers
the underlying business logic. Otherwise re-display the form with
validation errors (again, same URL, 'http://my.server.net/register').

I am using the Convention plugin and the Tiles plugin. The combination
of these two seems to throw a wrench in the works.
It seems that with the Convention plugin, I can only depend on execute()
being called, or I need to define multiple actions.

The approach I'm using now works reasonably well but there must be a
cleaner way:

@ParentPackage("testing")
public class Register extends ActionSupport
{
  @Action(value="register",results={@(protected)",
type="tiles", location="registrationPage")})
  @SkipValidation
  public String execute() throws Exception
  {
     return this.isBlank() ? INPUT : "submit";
  }

  @Action
  (
     value="register-submit",
     results=
     {
        @Result(name="input", type="tiles",
location="registrationPage"),
        @Result(name="error", type="tiles",
location="registrationPage"),
        @Result(name="success", type="tiles",
location="registrationSuccessfulPage")
     }
  )
  public String executeValidate() throws Exception
  {
     // perform business logic
     return SUCCESS;
  }

  private boolean isBlank()
  {
     return StringUtils.isBlank(this.username) &&
StringUtils.isBlank(this.password)
  }
}

Someone can still link in to /register-submit, which isn't awful, since
validation is performed. But I'd like to minimize the number of
actionable URLs on my site and avoid writing an isBlank() method for
each form.

It would seem more straightforward if I could depend on an INPUT result
on the first load of the page (with @SkipValidation), and then execute()
thereafter, with only a single action defined at the class level instead
of multiple actions at the method level.


Is this possible, and if so, what is the most appropriate way to do this
via struts 2.1?

I am addicted to the Convention plugin annotation, and I cannot do
without Tiles.

For reference, I'm using the following in struts.xml:

<constant name="struts.convention.action.alwaysMapExecute" value="false"/>

<package name="testing" extends="struts-default">
  <!-- Set the tiles result type as the default for this package. -->
  <result-types>
     <result-type name="tiles"
class="org.apache.struts2.views.tiles.TilesResult" default="true"/>
  </result-types>
</package>

Many thanks for any alternatives or refinements of this approach.

/ chuck



Attachment: user_204381.ezm (zipped)
Hi,

I got problem to using ENUM type in <s:select>, here is my code:

<s:select label="Sex"
    name="user.sex"
    list="getComboBox(ComboBoxType.SEX)"
    listKey="key"
    listValue="value"
    value="user.sex"/>

but if I change to use String (e.g: list="getComboBox('SEX')"),
and do the conversion in the action then it working fine.

Is it a bug?

Regards
LV

Attachment: user_204383.ezm (zipped)
what does "getComboBox" accepting? an Enum value or Enum array?
if an Enum value then you have to do @{include full package
path}ComboBoxType@(protected)

On Wed, Dec 23, 2009 at 12:15 AM, <mailtolouis2020-struts@(protected):

> Hi,
>
> I got problem to using ENUM type in <s:select>, here is my code:
>
> <s:select label="Sex"
>     name="user.sex"
>     list="getComboBox(ComboBoxType.SEX)"
>     listKey="key"
>     listValue="value"
>     value="user.sex"/>
>
> but if I change to use String (e.g: list="getComboBox('SEX')"),
> and do the conversion in the action then it working fine.
>
> Is it a bug?
>
> Regards
> LV

Attachment: user_204389.ezm (zipped)
Hi,

Thanks,my getComboBox accepting ComboBoxType, and I use @package.path.ComboBoxType@(protected).

Regards
LV



________________________________
From: Steven Yang <kenshin520@(protected)>
To: Struts Users Mailing List <user@(protected)>
Sent: Wed, December 23, 2009 1:26:48 AM
Subject: Re: [S2] <s:select> can't use ENUM type

what does "getComboBox" accepting? an Enum value or Enum array?
if an Enum value then you have to do @{include full package
path}ComboBoxType@(protected)

On Wed, Dec 23, 2009 at 12:15 AM, <mailtolouis2020-struts@(protected):

> Hi,
>
> I got problem to using ENUM type in <s:select>, here is my code:
>
> <s:select label="Sex"
>     name="user.sex"
>     list="getComboBox(ComboBoxType.SEX)"
>     listKey="key"
>     listValue="value"
>     value="user.sex"/>
>
> but if I change to use String (e.g: list="getComboBox('SEX')"),
> and do the conversion in the action then it working fine.
>
> Is it a bug?
>
> Regards
> LV

Attachment: user_204384.ezm (zipped)
Hi,

  I'm a Struts newbie and am tasked with trying to change relative
URLs on our site to be absolute. I have a form that looks like:

<html:form action="/fcon/MyAction">

and once it renders it displays:

<form id="myForm" method="GET"
action="/modules/mymodule/fcon/MyAction.do" onsubmit="return
validateFilterForm(event, this);">

What I'd like is to have it render an absolute URL:

<form id="myForm" method="GET"
action="http://www.mysite.com/modules/mymodule/fcon/MyAction.do"
onsubmit="return validateFilterForm(event, this);">

How can I do this?

  Thanks a lot, Jason


Attachment: user_204385.ezm (zipped)
Hello all,

I'm creating a UI Component with Struts 2.1.8.1. The FreeMarker variable
parameters seems to be made available as String and not as Hash as I expected
(and according to [1]).

[1] = http://www.vitarara.org/cms/struts_2_cookbook/creating_a_ui_component

In the web page, I have something like this:

<s:component template="book-list.ftl" >
  <s:param name="deletecolumn" value="true" />
</s:component>

And in the file template/xhtml/book-list.ftl (in the source folder) I have a
component that shows a table with the list of books in the database:

<#if books?size == 0>
  <p><@(protected)>
<#else>
  <table align="center" size="90%">
  <tr>
   <th><@(protected)>
   <th><@(protected)>

   <#if parameters?contains("deletecolumn=true")>
    <th>&nbsp;</th>
   </#if>
  </tr>
  <#list books as book>
   <tr>
    <td>${book.name}</td>
    <td>${book.authors}</td>
   
    <#if parameters?contains("deletecolumn=true")>
      <td>[... delete button ...]</td>
    </#if>
         
   </tr>
  </#list>
  </table>
</#if>


I expected to have to use it like this, as a hash (or something like it):

<#if parameters.deletecolumn == "true">

And instead, the only way it works is as above, as a string:

<#if parameters?contains("deletecolumn=true")>

If I use it as hash, it gives me ArrayIndexOutOfBoundsException: -1.

Any thoughts?

Thanks in advance,

Vitor Souza



Attachment: user_204386.ezm (zipped)
I have no useful thing to say about your particular problem with this
s:component tag, but if you are rendering JSP pages, then you may well
find it more compelling to create a custom tag file, hence avoiding
the Freemarker scripts.

2009/12/23 Vitor E. Silva Souza <vitorsouza@(protected)>:
> Hello all,
>
> I'm creating a UI Component with Struts 2.1.8.1. The FreeMarker variable
> parameters seems to be made available as String and not as Hash as I expected
> (and according to [1]).
>
> [1] = http://www.vitarara.org/cms/struts_2_cookbook/creating_a_ui_component
>
> In the web page, I have something like this:
>
>  <s:component template="book-list.ftl" >
>    <s:param name="deletecolumn" value="true" />
>  </s:component>
>
> And in the file template/xhtml/book-list.ftl (in the source folder) I have a
> component that shows a table with the list of books in the database:
>
>  <#if books?size == 0>
>    <p><@(protected)>
>  <#else>
>    <table align="center" size="90%">
>    <tr>
>      <th><@(protected)>
>      <th><@(protected)>
>
>      <#if parameters?contains("deletecolumn=true")>
>        <th>&nbsp;</th>
>      </#if>
>    </tr>
>    <#list books as book>
>      <tr>
>        <td>${book.name}</td>
>        <td>${book.authors}</td>
>
>        <#if parameters?contains("deletecolumn=true")>
>          <td>[... delete button ...]</td>
>        </#if>
>
>      </tr>
>    </#list>
>    </table>
>  </#if>
>
>
> I expected to have to use it like this, as a hash (or something like it):
>
> <#if parameters.deletecolumn == "true">
>
> And instead, the only way it works is as above, as a string:
>
> <#if parameters?contains("deletecolumn=true")>
>
> If I use it as hash, it gives me ArrayIndexOutOfBoundsException: -1.
>
> Any thoughts?
>
> Thanks in advance,
>
> Vitor Souza
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>


Attachment: user_204388.ezm (zipped)
On Wed, Dec 23, 2009 at 4:56 AM, Vitor E. Silva Souza
<vitorsouza@(protected):
> Hello all,
>
> I'm creating a UI Component with Struts 2.1.8.1. The FreeMarker variable
> parameters seems to be made available as String and not as Hash as I expected
> (and according to [1]).
>
> [1] = http://www.vitarara.org/cms/struts_2_cookbook/creating_a_ui_component
>
> In the web page, I have something like this:
>
>  <s:component template="book-list.ftl" >
>    <s:param name="deletecolumn" value="true" />
>  </s:component>
>

I can't guarantee that it will work, but try changing the s:param to this -

<s:param name="deletecolumn" value="%{true}" />

Notice the lack of quotes around 'true' and the forcing of OGNL with
%{... If that doesn't work, you may be stuck with a string.

-Wes


> And in the file template/xhtml/book-list.ftl (in the source folder) I have a
> component that shows a table with the list of books in the database:
>
>  <#if books?size == 0>
>    <p><@(protected)>
>  <#else>
>    <table align="center" size="90%">
>    <tr>
>      <th><@(protected)>
>      <th><@(protected)>
>
>      <#if parameters?contains("deletecolumn=true")>
>        <th>&nbsp;</th>
>      </#if>
>    </tr>
>    <#list books as book>
>      <tr>
>        <td>${book.name}</td>
>        <td>${book.authors}</td>
>
>        <#if parameters?contains("deletecolumn=true")>
>          <td>[... delete button ...]</td>
>        </#if>
>
>      </tr>
>    </#list>
>    </table>
>  </#if>
>
>
> I expected to have to use it like this, as a hash (or something like it):
>
> <#if parameters.deletecolumn == "true">
>
> And instead, the only way it works is as above, as a string:
>
> <#if parameters?contains("deletecolumn=true")>
>
> If I use it as hash, it gives me ArrayIndexOutOfBoundsException: -1.
>
> Any thoughts?
>
> Thanks in advance,
>
> Vitor Souza
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>



--
Wes Wannemacher

Head Engineer, WanTii, Inc.
Need Training? Struts, Spring, Maven, Tomcat...
Ask me for a quote!


Attachment: user_204390.ezm (zipped)

Is it necessary to upload a file to the server to process it in Struts, or
does it have access to the local file system? I was getting errors in my
code when it was attempting to use the file from my local machine, but if I
upload it to the server first and use the file from the server, it works
okay. That led me to wonder if it was just me messing up the code, or Struts
only seeing the directories on the server on which it is installed, and
that's what I want to know.

Thanks,
Dan
--
Sent from the Struts - User mailing list archive at Nabble.com.



Attachment: user_204391.ezm (zipped)
Hi Dan,
struts see only files on server,
so if You want to do something with a local file You have to upload it
to the server.
Also it's not struts related, all HTTP based solutions behave that way.

Best greetings,
Pawel Wielgus

2009/12/23, davargas123 <davargas123@(protected)>:
>
> Is it necessary to upload a file to the server to process it in Struts, or
> does it have access to the local file system? I was getting errors in my
> code when it was attempting to use the file from my local machine, but if I
> upload it to the server first and use the file from the server, it works
> okay. That led me to wonder if it was just me messing up the code, or Struts
> only seeing the directories on the server on which it is installed, and
> that's what I want to know.
>
> Thanks,
> Dan
> --
> View this message in context:
> http://old.nabble.com/Struts-1.2.x-and-File-I-O-tp26903855p26903855.html
> Sent from the Struts - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>


Attachment: user_204392.ezm (zipped)
Ok, that's what I had figured, thanks.

2009/12/23 Paweł Wielgus <poulwiel@(protected)>

> Hi Dan,
> struts see only files on server,
> so if You want to do something with a local file You have to upload it
> to the server.
> Also it's not struts related, all HTTP based solutions behave that way.
>
> Best greetings,
> Pawel Wielgus
>
> 2009/12/23, davargas123 <davargas123@(protected)>:
> >
> > Is it necessary to upload a file to the server to process it in Struts,
> or
> > does it have access to the local file system? I was getting errors in my
> > code when it was attempting to use the file from my local machine, but if
> I
> > upload it to the server first and use the file from the server, it works
> > okay. That led me to wonder if it was just me messing up the code, or
> Struts
> > only seeing the directories on the server on which it is installed, and
> > that's what I want to know.
> >
> > Thanks,
> > Dan
> > --
> > View this message in context:
> > http://old.nabble.com/Struts-1.2.x-and-File-I-O-tp26903855p26903855.html
> > Sent from the Struts - User mailing list archive at Nabble.com.
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@(protected)
> > For additional commands, e-mail: user-help@(protected)
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>
©2008 gg3721.com - Jax Systems, LLC, U.S.A.