Java Mailing List Archive

http://www.gg3721.com/

Home » Struts Users Mailing List »

user Digest 19 Mar 2008 23:06:19 -0000 Issue 7937

user-digest-help

2008-03-19


Author LoginPost Reply

user Digest 19 Mar 2008 23:06:19 -0000 Issue 7937

Topics (messages 184463 through 184483):

Struts 1 vs Struts 2 actionform execution and Struts2 POJO example
 184463 by: bugs_
 184468 by: bugs_

Re: struts 2 jsf plugin problem
 184464 by: Randy Burgess

Re: Newbie question
 184465 by: stanlick.gmail.com

Re: sorry for this test
 184466 by: Lukasz Lenart

File Upload Size
 184467 by: Richard Sayre
 184469 by: Richard Sayre
 184470 by: Lukasz Lenart
 184471 by: Lukasz Lenart

Type conversion/OGNL question
 184472 by: lllewell
 184478 by: lllewell
 184480 by: lllewell
 184483 by: lllewell

Re: <s:date>
 184473 by: meeboo
 184474 by: meeboo
 184475 by: meeboo
 184476 by: meeboo

[S2] application context
 184477 by: deeeed
 184479 by: Frank Fischer
 184482 by: deeeed

ModelDriven action with action property
 184481 by: Emil.I

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_184463.ezm (zipped)

In struts 1. I have basic.jsp page with form:
<html:form action="/basic" >
...
</html:form>
When I open basic.jsp it is autamatically created basicForm (which is
configured at the basic action) And thanks this values in the form are
automatically filled.

Know anybody how to simulate this in Struts 2?
or
Can me anybody give a simple example: How to use an POJO object in Struts 2
(instead of ActionForm)?
--
Sent from the Struts - User mailing list archive at Nabble.com.


Attachment: user_184468.ezm (zipped)

In struts 1. I have basic.jsp page with form:
<html:form action="/basic" >
...
</html:form>
When I open basic.jsp it is autamatically created basicForm (which is
configured at the basic action) And thanks this values in the form are
automatically filled.

Know anybody how to simulate this in Struts 2?
or
Can me anybody give a simple example: How to use an POJO object in Struts 2
(instead of ActionForm)?
--
Sent from the Struts - User mailing list archive at Nabble.com.


Attachment: user_184464.ezm (zipped)
It seems to me that you will need to create an interceptor stack that has
both portlet support and jsf support. Even though your package extends
struts-portlet-default the action in question does not since you have
defined interceptors specifically for the action.

Regards,
Randy Burgess
Sr. Web Applications Developer
Nuvox Communications



> From: Daniel <pdaniel2005@(protected)>
> Reply-To: Struts Users Mailing List <user@(protected)>
> Date: Wed, 19 Mar 2008 17:29:25 +0200
> To: Struts Users Mailing List <user@(protected)>
> Subject: Re: struts 2 jsf plugin problem
>
> My last attempt was like this :
>
> <package name="default" extends="struts-portlet-default" namespace="/view">
>      <action name="index" class="com.mycompany.HelloAction">
>         <interceptor-ref name="basicStack"/>
>         <interceptor-ref name="jsfStack"/>
>         <result name="success"
> type="jsf">/WEB-INF/jsp/view/index.jsp</result>
>       </action>
>   </package>
>
> This didn't worked either. I have no problems when i am using pure struts 2
> portlet support. I have problems when i try to integrate the JSF plugin
> support. When i am using only the portlet support without any other plugins
> the portlet is shown.
>
> On Wed, Mar 19, 2008 at 5:05 PM, Randy Burgess <RBurgess@(protected):
>
>> The problem is with line 10 starting somewhere around character 64. This
>> doesn't look good to me:
>>
>> <action name="index" class="com.mycompany.HelloAction">
>>>         <interceptor-ref name="basicStack"/>
>>>         <interceptor-ref name="jsfStack"/>
>>>         <result name="success" type="jsf"/>
>>>         <result name="index" type="redirect-action">index</result>
>>
>> The result named index redirects back to the same action, a potential
>> circular reference. You also have removed the struts-portlet-default
>> interceptors from this action by specifying the interceptors specifically
>> *for* this action.
>>
>> See the portlet tutorial at
>> http://struts.apache.org/2.x/docs/struts-2-portlet-tutorial.html.
>>
>> Regards,
>> Randy Burgess
>> Sr. Web Applications Developer
>> Nuvox Communications
>>
>>
>>
>>> From: Daniel Posirca <pdaniel2005@(protected)>
>>> Reply-To: Struts Users Mailing List <user@(protected)>
>>> Date: Wed, 19 Mar 2008 16:11:17 +0200
>>> To: <user@(protected)>
>>> Subject: struts 2 jsf plugin problem
>>>
>>> Hello, i am new to this list. I am trying to develop an application
>> based on
>>> struts 2 + jsf plugin + portlet. I am using struts 2 support for
>> portlet. As
>>> appl server i am using weblogic.
>>> Now i have reached a point were i am getting an error, but i have no
>> idea
>>> how to pass it. I have managed to make the portlet working in weblogic
>> but
>>> when a try to add the jsf support i get stuck. Here are my files :
>>>
>>> web.xml
>>>
>>> <?xml version="1.0" encoding="UTF-8"?>
>>> <!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application
>> 2.3
>>> //EN"
>>>      "http://java.sun.com/dtd/web-app_2_3.dtd">
>>> <web-app id="bookmark-portlet">
>>>   <!-- JavaServer Faces Servlet Configuration, not used directly -->
>>>   <servlet>
>>>      <servlet-name>faces</servlet-name>
>>>      <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
>>>      <load-on-startup>1</load-on-startup>
>>>   </servlet>
>>>   <servlet>
>>>      <servlet-name>JspSupportServlet</servlet-name>
>>>      <servlet-class>org.apache.struts2.views.JspSupportServlet
>>> </servlet-class>
>>>      <load-on-startup>1</load-on-startup>
>>>   </servlet>
>>>
>>>
>>>   <!-- JavaServer Faces Servlet Mapping, not called directly -->
>>>   <servlet-mapping>
>>>      <servlet-name>faces</servlet-name>
>>>      <url-pattern>*.action</url-pattern>
>>>   </servlet-mapping>
>>>
>>> </web-app>
>>>
>>> portlet.xml
>>>
>>> <?xml version="1.0" encoding="UTF-8"?>
>>>
>>> <portlet-app
>>>   version="1.0"
>>>   xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd"
>>>   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>>>   xsi:schemaLocation="
>>> http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd
>>> http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd"
>>>   id="bookmark-portlet">
>>>
>>>   <portlet id="HelloPortlet">
>>>      <description>Simple hello world portlet</description>
>>>      <portlet-name>StrutsDocumentPortlet</portlet-name>
>>>      <display-name>StrutsDocumentPortlet</display-name>
>>>
>>>      <portlet-class>
>>> org.apache.struts2.portlet.dispatcher.Jsr168Dispatcher</portlet-class>
>>>
>>>      <!-- The namespace for the actions configured for view mode -->
>>>      <init-param>
>>>         <name>viewNamespace</name>
>>>         <value>/view</value>
>>>      </init-param>
>>>
>>>       <!-- The default action to invoke in view mode. -->
>>>      <init-param>
>>>         <name>defaultViewAction</name>
>>>         <value>index</value>
>>>      </init-param>
>>>
>>>      <!-- The namespace for the actions configured for edit mode -->
>>>      <init-param>
>>>         <name>editNamespace</name>
>>>         <value>/edit</value>
>>>      </init-param>
>>>
>>>       <!-- The default action to invoke in edit mode. -->
>>>      <init-param>
>>>         <name>defaultEditAction</name>
>>>         <value>index!input</value>
>>>      </init-param>
>>>
>>>      <expiration-cache>0</expiration-cache>
>>>
>>>      <supports>
>>>         <mime-type>text/html</mime-type>
>>>         <portlet-mode>view</portlet-mode>
>>>         <portlet-mode>edit</portlet-mode>
>>>      </supports>
>>>
>>>      <!--<supported-locale>en</supported-locale>-->
>>>
>>>      <portlet-info>
>>>         <title>HelloPortlet</title>
>>>         <short-title>HelloPortlet</short-title>
>>>         <keywords>struts 2,portlet,hello,world</keywords>
>>>      </portlet-info>
>>>   </portlet>
>>>
>>> </portlet-app>
>>>
>>> struts.xml
>>>
>>> <?xml version="1.0" encoding="UTF-8" ?>
>>> <!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-jsf.xml"/>
>>>   <package name="default" extends="struts-portlet-default"
>>> namespace="/view">
>>>      <action name="index" class="com.mycompany.HelloAction">
>>>         <interceptor-ref name="basicStack"/>
>>>         <interceptor-ref name="jsfStack"/>
>>>         <result name="success" type="jsf"/>
>>>         <result name="index" type="redirect-action">index</result>
>>>         <result>/WEB-INF/jsp/view/index.jsp</result>
>>>      </action>
>>>   </package>
>>>
>>>   <package name="edit" extends="struts-portlet-default"
>> namespace="/edit">
>>>
>>>      <action name="index" class="com.mycompany.UpdateNameAction">
>>>         <result type="redirectAction">
>>>           <param name="actionName">index</param>
>>>           <param name="portletMode">view</param>
>>>         </result>
>>>         <result name="input">/WEB-INF/jsp/edit/index.jsp</result>
>>>      </action>
>>>   </package>
>>> </struts>
>>>
>>>
>>> struts-jsf.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="jsf" extends="jsf-default" namespace="/jsf">
>>>
>>>     <result-types>
>>>       <result-type name="jsf" class="
>> org.apache.struts2.jsf.FacesResult"
>>> />
>>>     </result-types>
>>>
>>>   <interceptors>
>>>     <interceptor-stack name="jsfFullStack">
>>>      <interceptor-ref name="params" />
>>>      <interceptor-ref name="basicStack"/>
>>>      <interceptor-ref name="jsfStack"/>
>>>     </interceptor-stack>
>>>   </interceptors>
>>>
>>>   <default-interceptor-ref name="jsfFullStack"/>
>>>
>>>  </package>
>>>
>>>
>>> </struts>
>>>
>>> When i am loading the portlet in browser i get this error (the error is
>> not
>>> thrown into the weblogic console, i see this error in the portlet
>> window).
>>>
>>>
>>>
>>>
>>>
>>> javax.portlet.PortletException
>>> at
>>> com.bea.portlet.container.PortletStub.getPortletInstance(
>> PortletStub.java:645)
>>>
>>> at com.bea.portlet.container.PortletStub.init(PortletStub.java:190)
>>> at com.bea.portlet.container.AppContainer.invokeRender(AppContainer.java
>> :637)
>>>
>>> at
>> com.bea.netuix.servlets.controls.content.JavaPortletContent.fireRender(
>>> JavaPortletContent.java:208)
>>> at
>>>
>> com.bea.netuix.servlets.controls.content.JavaPortletContent.renderInternal
>> (
>>> JavaPortletContent.java:127)
>>> at
>> com.bea.netuix.servlets.controls.content.JavaPortletContent.beginRender(
>>> JavaPortletContent.java:83)
>>> at com.bea.netuix.nf.ControlLifecycle$7.visit(ControlLifecycle.java:483)
>>> at com.bea.netuix.nf.ControlTreeWalker.walkRecursiveRender(
>>> ControlTreeWalker.java:518)
>>> at com.bea.netuix.nf.ControlTreeWalker.walkRecursiveRender(
>>> ControlTreeWalker.java:529)
>>> at com.bea.netuix.nf.ControlTreeWalker.walkRecursiveRender(
>>> ControlTreeWalker.java:529)
>>> at com.bea.netuix.nf.ControlTreeWalker.walkRecursiveRender(
>>> ControlTreeWalker.java:529)
>>> at com.bea.netuix.nf.ControlTreeWalker.walkRecursiveRender(
>>> ControlTreeWalker.java:529)
>>> at com.bea.netuix.nf.ControlTreeWalker.walk(ControlTreeWalker.java:220)
>>> at com.bea.netuix.nf.Lifecycle.processLifecycles(Lifecycle.java:375)
>>> at com.bea.netuix.nf.Lifecycle.processLifecycles(Lifecycle.java:341)
>>> at com.bea.netuix.nf.Lifecycle.processLifecycles(Lifecycle.java:332)
>>> at com.bea.netuix.nf.Lifecycle.run(Lifecycle.java:306)
>>> at com.bea.netuix.nf.UIControl.render(UIControl.java:578)
>>> at com.bea.netuix.servlets.controls.PresentationContext.render(
>>> PresentationContext.java:482)
>>> at
>>> com.bea.netuix.servlets.util.RenderToolkit.renderChild(
>> RenderToolkit.java:146)
>>>
>>> at com.bea.netuix.servlets.jsp.taglib.RenderChild.doStartTag(
>>> RenderChild.java:62)
>>> at
>>>
>>
jsp_servlet._framework._skeletons._portal.__gridlayout._jspService(__gridlayo>>
u
>>> t.java:301)
>>>
>>> at weblogic.servlet.jsp.JspBase.service(JspBase.java:34)
>>> at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run
>> (
>>> StubSecurityHelper.java:226)
>>> at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(
>>> StubSecurityHelper.java:124)
>>> at weblogic.servlet.internal.ServletStubImpl.execute(
>> ServletStubImpl.java:283)
>>>
>>> at weblogic.servlet.internal.ServletStubImpl.onAddToMapException(
>>> ServletStubImpl.java:391)
>>> at weblogic.servlet.internal.ServletStubImpl.execute(
>> ServletStubImpl.java:309)
>>>
>>> at weblogic.servlet.internal.ServletStubImpl.execute(
>> ServletStubImpl.java:175)
>>>
>>> at weblogic.servlet.internal.RequestDispatcherImpl.invokeServlet(
>>> RequestDispatcherImpl.java:503)
>>> at weblogic.servlet.internal.RequestDispatcherImpl.include(
>>> RequestDispatcherImpl.java:431)
>>> at com.bea.netuix.servlets.controls.application.laf.JspTools.renderJsp(
>>> JspTools.java:123)
>>> at
>>>
>>
>>
com.bea.netuix.servlets.controls.application.laf.JspControlRenderer.beginRend>>
e
>>>
>> r
>>> (JspControlRenderer.java:72)
>>> at
>>>
>>
com.bea.netuix.servlets.controls.application.laf.PresentationControlRenderer.>>
b
>>> eginRender
>>> (PresentationControlRenderer.java:65)
>>> at com.bea.netuix.nf.ControlLifecycle$7.visit(ControlLifecycle.java:479)
>>> at com.bea.netuix.nf.ControlTreeWalker.walkRecursiveRender(
>>> ControlTreeWalker.java:518)
>>> at com.bea.netuix.nf.ControlTreeWalker.walkRecursiveRender(
>>> ControlTreeWalker.java:529)
>>> at com.bea.netuix.nf.ControlTreeWalker.walkRecursiveRender(
>>> ControlTreeWalker.java:529)
>>> at com.bea.netuix.nf.ControlTreeWalker.walkRecursiveRender(
>>> ControlTreeWalker.java:529)
>>> at com.bea.netuix.nf.ControlTreeWalker.walkRecursiveRender(
>>> ControlTreeWalker.java:529)
>>> at com.bea.netuix.nf.ControlTreeWalker.walkRecursiveRender(
>>> ControlTreeWalker.java:529)
>>> at com.bea.netuix.nf.ControlTreeWalker.walkRecursiveRender(
>>> ControlTreeWalker.java:529)
>>> at com.bea.netuix.nf.ControlTreeWalker.walkRecursiveRender(
>>> ControlTreeWalker.java:529
>>> at com.bea.netuix.nf.ControlTreeWalker.walkRecursiveRender(
>>> ControlTreeWalker.java:529)
>>> at com.bea.netuix.nf.ControlTreeWalker.walkRecursiveRender(
>>> ControlTreeWalker.java:529)
>>> at com.bea.netuix.nf.ControlTreeWalker.walk(ControlTreeWalker.java:220)
>>> at com.bea.netuix.nf.Lifecycle.processLifecycles(Lifecycle.java:375)
>>> at com.bea.netuix.nf.Lifecycle.processLifecycles(Lifecycle.java:341)
>>> at com.bea.netuix.nf.Lifecycle.runOutbound(Lifecycle.java:188)
>>> at com.bea.netuix.nf.Lifecycle.run(Lifecycle.java:142)
>>> at com.bea.netuix.servlets.manager.UIServlet.runLifecycle(
>> UIServlet.java:377)
>>>
>>> at com.bea.netuix.servlets.manager.UIServlet.doPost(UIServlet.java:253)
>>> at com.bea.netuix.servlets.manager.UIServlet.doGet(UIServlet.java:206)
>>> at com.bea.netuix.servlets.manager.UIServlet.service(UIServlet.java
>> :191)
>>> at com.bea.netuix.servlets.manager.SingleFileServlet.service(
>>> SingleFileServlet.java:258)
>>> at
>>> com.bea.netuix.servlets.manager.PortalServlet.service(PortalServlet.java
>> :656)
>>>
>>> at javax.servlet.http.HttpServlet.service (HttpServlet.java:820)
>>> at
>> weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(
>>> StubSecurityHelper.java:226)
>>> at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(
>>> StubSecurityHelper.java:124)
>>> at
>>> weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java
>> :283)
>>>
>>> at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
>>> at
>>> weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java
>> :42)
>>>
>>> at com.bea.portal.tools.servlet.http.HttpContextFilter.doFilter(
>>> HttpContextFilter.java:60)
>>> at
>>> weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java
>> :42)
>>>
>>> at com.bea.p13n.servlets.PortalServletFilter.doFilter(
>>> PortalServletFilter.java:315)
>>> at
>>> weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java
>> :42)
>>>
>>> at weblogic.servlet.internal.RequestEventsFilter.doFilter(
>>> RequestEventsFilter.java:26)
>>> at
>>> weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java
>> :42)
>>>
>>> at
>>>
>> weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run
>> (
>>> WebAppServletContext.java:3368)
>>> at weblogic.security.acl.internal.AuthenticatedSubject.doAs(
>>> AuthenticatedSubject.java:321)
>>> at weblogic.security.service.SecurityManager.runAs(Unknown Source)
>>> at weblogic.servlet.internal.WebAppServletContext.securedExecute(
>>> WebAppServletContext.java:2117)
>>> at weblogic.servlet.internal.WebAppServletContext.execute(
>>> WebAppServletContext.java:2023)
>>> at
>>> weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java
>> :1359)
>>>
>>> at weblogic.work.ExecuteThread.execute(ExecuteThread.java:200)
>>> at weblogic.work.ExecuteThread.run(ExecuteThread.java:172)
>>>
>>> Caused by: Unable to load configuration. - action -
>>>
>>
file:/C:/srv/bea10/user_projects/domains/domain/autodeploy/portal.ear/portal.>>
w
>>> ar/WEB-INF/classes/struts.xml:10:64
>>>
>>>
>>> at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration
>> (
>>> ConfigurationManager.java:58)
>>> at org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(
>>> Dispatcher.java:370)
>>> at org.apache.struts2.dispatcher.Dispatcher.init (Dispatcher.java:423)
>>> at org.apache.struts2.portlet.dispatcher.Jsr168Dispatcher.init(
>>> Jsr168Dispatcher.java:198)
>>> at com.bea.portlet.container.PortletStub.getPortletInstance(
>>> PortletStub.java:630) ... 76 more
>>>
>>> Caused by: Error building results for action index in namespace /view -
>>> action -
>>>
>>
file:/C:/srv/bea10/user_projects/domains/domain/autodeploy/portal.ear/portal.>>
w
>>> ar/WEB-INF/classes/struts.xml:10:64
>>>
>>>
>>> at
>>>
>> com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.addAction
>> (
>>> XmlConfigurationProvider.java:366)
>>> at
>>>
>> com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.addPackage
>>> (XmlConfigurationProvider.java:460)
>>> at
>>>
>>
com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadPackage>>
s
>>> (XmlConfigurationProvider.java:268)
>>> at
>> org.apache.struts2.config.StrutsXmlConfigurationProvider.loadPackages(
>>> StrutsXmlConfigurationProvider.java:109)
>>> at
>> com.opensymphony.xwork2.config.impl.DefaultConfiguration.reloadContainer
>>> (DefaultConfiguration.java:179)
>>> at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration
>> (
>>> ConfigurationManager.java:55) ... 80 more
>>>
>>> Caused by: There is no result type defined for type 'jsf' mapped with
>> name
>>> 'success' - result -
>>>
>>
file:/C:/srv/bea10/user_projects/domains/domain/autodeploy/portal.ear/portal.>>
w
>>> ar/WEB-INF/classes/struts.xml:13:47
>>>
>>>
>>> at
>>>
>>
com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.buildResult>>
s
>>> (XmlConfigurationProvider.java:613)
>>> at
>>>
>> com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.addAction
>> (
>>> XmlConfigurationProvider.java:364) ...
>>> 85 more
>>>
>>> Nested Exception is Unable to load configuration. - action -
>>>
>>
file:/C:/srv/bea10/user_projects/domains/domain/autodeploy/portal.ear/portal.>>
w
>>> ar/WEB-INF/classes/struts.xml:10:64
>>>
>>>
>>> at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration
>> (
>>> ConfigurationManager.java:58)
>>> at org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(
>>> Dispatcher.java:370)
>>> at org.apache.struts2.dispatcher.Dispatcher.init (Dispatcher.java:423)
>>> at org.apache.struts2.portlet.dispatcher.Jsr168Dispatcher.init(
>>> Jsr168Dispatcher.java:198)
>>> at com.bea.portlet.container.PortletStub.getPortletInstance(
>>> PortletStub.java:630)
>>> at com.bea.portlet.container.PortletStub.init(PortletStub.java:190)
>>> at com.bea.portlet.container.AppContainer.invokeRender(
>> AppContainer.java:637)
>>>
>>> at
>> com.bea.netuix.servlets.controls.content.JavaPortletContent.fireRender(
>>> JavaPortletContent.java:208)
>>> at
>>>
>> com.bea.netuix.servlets.controls.content.JavaPortletContent.renderInternal
>> (
>>> JavaPortletContent.java:127)
>>> at
>> com.bea.netuix.servlets.controls.content.JavaPortletContent.beginRender(
>>> JavaPortletContent.java:83)
>>> at com.bea.netuix.nf.ControlLifecycle$7.visit(ControlLifecycle.java
>> :483)
>>> at com.bea.netuix.nf.ControlTreeWalker.walkRecursiveRender(
>>> ControlTreeWalker.java:518)
>>> at com.bea.netuix.nf.ControlTreeWalker.walkRecursiveRender(
>>> ControlTreeWalker.java:529)
>>> at com.bea.netuix.nf.ControlTreeWalker.walkRecursiveRender(
>>> ControlTreeWalker.java:529)
>>> at com.bea.netuix.nf.ControlTreeWalker.walkRecursiveRender(
>>> ControlTreeWalker.java:529)
>>> at com.bea.netuix.nf.ControlTreeWalker.walkRecursiveRender(
>>> ControlTreeWalker.java:529)
>>> at com.bea.netuix.nf.ControlTreeWalker.walk(ControlTreeWalker.java:220)
>>> at com.bea.netuix.nf.Lifecycle.processLifecycles(Lifecycle.java:375)
>>> at com.bea.netuix.nf.Lifecycle.processLifecycles(Lifecycle.java:341)
>>> at com.bea.netuix.nf.Lifecycle.processLifecycles(Lifecycle.java:332)
>>> at com.bea.netuix.nf.Lifecycle.run(Lifecycle.java:306)
>>> at com.bea.netuix.nf.UIControl.render(UIControl.java:578)
>>> at com.bea.netuix.servlets.controls.PresentationContext.render(
>>> PresentationContext.java:482)
>>> at com.bea.netuix.servlets.util.RenderToolkit.renderChild(
>>> RenderToolkit.java:146)
>>> at com.bea.netuix.servlets.jsp.taglib.RenderChild.doStartTag(
>>> RenderChild.java:62)
>>> at
>>>
>>
jsp_servlet._framework._skeletons._portal.__gridlayout._jspService(__gridlayo>>
u
>>> t.java:301)
>>>
>>> at weblogic.servlet.jsp.JspBase.service(JspBase.java:34)
>>> at
>> weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(
>>> StubSecurityHelper.java:226)
>>> at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(
>>> StubSecurityHelper.java:124)
>>> at
>>> weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java
>> :283)
>>>
>>> at weblogic.servlet.internal.ServletStubImpl.onAddToMapException(
>>> ServletStubImpl.java:391)
>>> at
>>> weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java
>> :309)
>>>
>>> at
>>> weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java
>> :175)
>>>
>>> at weblogic.servlet.internal.RequestDispatcherImpl.invokeServlet(
>>> RequestDispatcherImpl.java:503)
>>> at weblogic.servlet.internal.RequestDispatcherImpl.include(
>>> RequestDispatcherImpl.java:431)
>>> at com.bea.netuix.servlets.controls.application.laf.JspTools.renderJsp(
>>> JspTools.java:123)
>>> at
>>>
>>
>>
com.bea.netuix.servlets.controls.application.laf.JspControlRenderer.beginRend>>
e
>>>
>> r
>>> (JspControlRenderer.java:72)
>>> at
>>>
>>
com.bea.netuix.servlets.controls.application.laf.PresentationControlRenderer.>>
b
>>> eginRender
>>> (PresentationControlRenderer.java:65) at
>>> com.bea.netuix.nf.ControlLifecycle$7.visit(ControlLifecycle.java:479)
>>> at com.bea.netuix.nf.ControlTreeWalker.walkRecursiveRender(
>>> ControlTreeWalker.java:518)
>>> at com.bea.netuix.nf.ControlTreeWalker.walkRecursiveRender(
>>> ControlTreeWalker.java:529)
>>> com.bea.netuix.nf.ControlTreeWalker.walkRecursiveRender(
>>> ControlTreeWalker.java:529)
>>> at com.bea.netuix.nf.ControlTreeWalker.walkRecursiveRender(
>>> ControlTreeWalker.java:529)
>>> at com.bea.netuix.nf.ControlTreeWalker.walkRecursiveRender(
>>> ControlTreeWalker.java:529)
>>> at com.bea.netuix.nf.ControlTreeWalker.walkRecursiveRender(
>>> ControlTreeWalker.java:529)
>>> at com.bea.netuix.nf.ControlTreeWalker.walkRecursiveRender(
>>> ControlTreeWalker.java:529)
>>> at com.bea.netuix.nf.ControlTreeWalker.walkRecursiveRender(
>>> ControlTreeWalker.java:529)
>>> at com.bea.netuix.nf.ControlTreeWalker.walkRecursiveRender(
>>> ControlTreeWalker.java:529)
>>> at com.bea.netuix.nf.ControlTreeWalker.walk(ControlTreeWalker.java:220)
>>> at com.bea.netuix.nf.Lifecycle.processLifecycles(Lifecycle.java:375)
>>> at com.bea.netuix.nf.Lifecycle.processLifecycles(Lifecycle.java:341)
>>> at com.bea.netuix.nf.Lifecycle.runOutbound(Lifecycle.java:188)
>>> at com.bea.netuix.nf.Lifecycle.run(Lifecycle.java:142)
>>> at com.bea.netuix.servlets.manager.UIServlet.runLifecycle(
>> UIServlet.java
>>> :377)
>>> at com.bea.netuix.servlets.manager.UIServlet.doPost(UIServlet.java:253)
>>> at com.bea.netuix.servlets.manager.UIServlet.doGet(UIServlet.java:206)
>>> at com.bea.netuix.servlets.manager.UIServlet.service(UIServlet.java
>> :191)
>>> at com.bea.netuix.servlets.manager.SingleFileServlet.service(
>>> SingleFileServlet.java:258)
>>> at
>>> com.bea.netuix.servlets.manager.PortalServlet.service(PortalServlet.java
>> :656)
>>>
>>> at javax.servlet.http.HttpServlet.service (HttpServlet.java:820)
>>> at
>> weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(
>>> StubSecurityHelper.java:226)
>>> at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(
>>> StubSecurityHelper.java:124)
>>> at
>>> weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java
>> :283)
>>>
>>> at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
>>> at
>>> weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java
>> :42)
>>>
>>> at com.bea.portal.tools.servlet.http.HttpContextFilter.doFilter(
>>> HttpContextFilter.java:60)
>>> at
>>> weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java
>> :42)
>>>
>>> at com.bea.p13n.servlets.PortalServletFilter.doFilter(
>>> PortalServletFilter.java:315)
>>> at
>>> weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java
>> :42)
>>>
>>> at weblogic.servlet.internal.RequestEventsFilter.doFilter(
>>> RequestEventsFilter.java:26)
>>> at weblogic.servlet.internal.FilterChainImpl.doFilter(
>> FilterChainImpl.java
>>> :42)
>>> at
>>>
>> weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run
>> (
>>> WebAppServletContext.java:3368)
>>> at weblogic.security.acl.internal.AuthenticatedSubject.doAs(
>>> AuthenticatedSubject.java:321)
>>> at weblogic.security.service.SecurityManager.runAs(Unknown Source)
>>> at weblogic.servlet.internal.WebAppServletContext.securedExecute(
>>> WebAppServletContext.java:2117)
>>> at weblogic.servlet.internal.WebAppServletContext.execute(
>>> WebAppServletContext.java:2023)
>>> at
>>> weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java
>> :1359)
>>>
>>> at weblogic.work.ExecuteThread.execute(ExecuteThread.java:200)
>>> at weblogic.work.ExecuteThread.run(ExecuteThread.java:172)
>>>
>>> Caused by: Error building results for action index in namespace /view -
>>> action -
>>>
>>
file:/C:/srv/bea10/user_projects/domains/domain/autodeploy/portal.ear/portal.>>
w
>>> ar/WEB-INF/classes/struts.xml:10:64
>>>
>>>
>>> at
>>>
>> com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.addAction
>> (
>>> XmlConfigurationProvider.java:366)
>>> at
>>>
>> com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.addPackage
>>> (XmlConfigurationProvider.java:460)
>>> at
>>>
>>
com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadPackage>>
s
>>> (XmlConfigurationProvider.java:268)
>>> at
>> org.apache.struts2.config.StrutsXmlConfigurationProvider.loadPackages(
>>> StrutsXmlConfigurationProvider.java:109)
>>> at
>> com.opensymphony.xwork2.config.impl.DefaultConfiguration.reloadContainer
>>> (DefaultConfiguration.java:179)
>>> at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration
>> (
>>> ConfigurationManager.java:55) ... 80 more
>>>
>>> Caused by: There is no result type defined for type 'jsf' mapped with
>> name
>>> 'success' - result -
>>>
>>
file:/C:/srv/bea10/user_projects/domains/domain/autodeploy/portal.ear/portal.>>
w
>>> ar/WEB-INF/classes/struts.xml:13:47
>>>
>>>
>>> at
>>>
>>
com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.buildResult>>
s
>>> (XmlConfigurationProvider.java:613) a
>>> t
>>>
>> com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.addAction
>> (
>>> XmlConfigurationProvider.java:364) ...
>>>
>>> 85 more
>>>
>>>
>>>
>>> My libs are :
>>>
>>> freemarker-2.3.11.jar
>>> myfaces-api-1.1.2.jar
>>> myfaces-impl-1.1.2.jar
>>> ognl-2.6.11.jar
>>> struts2-core-2.1.1-SNAPSHOT.jar
>>> struts2-jsf-plugin-2.0.11.1.jar
>>> struts2-portlet-plugin-2.1.1-SNAPSHOT.jar
>>> xwork-2.1.1-SNAPSHOT.jar
>>>
>>>
>>>
>>> I hope that this mail is not to big. Thx in advanced, i realy need help
>> with
>>> this issue.
>>
>>
>>
>> This email and any attachments ("Message") may contain legally privileged
>> and/or confidential information. If you are not the addressee, or if this
>> Message has been addressed to you in error, you are not authorized to read,
>> copy, or distribute it, and we ask that you please delete it (including all
>> copies) and notify the sender by return email. Delivery of this Message to
>> any person other than the intended recipient(s) shall not be deemed a waiver
>> of confidentiality and/or a privilege.
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@(protected)
>> For additional commands, e-mail: user-help@(protected)
>>
>>



This email and any attachments ("Message") may contain legally privileged and/or confidential information. If you are not the addressee, or if this Message has been addressed to you in error, you are not authorized to read, copy, or distribute it, and we ask that you please delete it (including all copies) and notify the sender by return email. Delivery of this Message to any person other than the intended recipient(s) shall not be deemed a waiver of confidentiality and/or a privilege.

Attachment: user_184465.ezm (zipped)
I use DailyRazor and have had great experience.

On Tue, Mar 18, 2008 at 11:42 AM, maitre <em@(protected):

>
> Hi,
>
> I'm trying to find a decent hosting company that supports STRUTS 2. Are
> there any recommendations?
>
> Thanks,
>
> Ed
> --
> View this message in context:
> http://www.nabble.com/Newbie-question-tp16125218p16125218.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)
>
>


--
Scott
stanlick@(protected)

Attachment: user_184466.ezm (zipped)
> email. But apparently the email didn't got to the users, i haven't received
> it.

That's how it works! You will don't get your emails back, but any else
will get ;-)


Regards
--
Lukasz

http://www.linkedin.com/in/lukaszlenart

Attachment: user_184467.ezm (zipped)
I set the file upload max size in the struts.properties to 15MB. When
I upload a file over 15MB my action returns input. Is there any way I
can check to see if the file is over the max size set in the
properties file and handle what result I want to happen myself? I
seems that it returns input before it even goes into my action. Is
this happening in the file upload interceptor? Can I gain more
control over this?

Thank you,

Rich

Attachment: user_184469.ezm (zipped)
The reason I am asking this is bacuase when I upload a file over 15MB
I get "no result mapped for INPUT" exception in my error log. When I
do map a result for input the app hangs. I looked at the file upload
in the struts showcase and it returns an error message when the file
you upload is too big. I checked the source and I could not find
where this is being implemented. I have <s:fielderror/> on my page
which i return input to, but as I said earlier my upload action is
hanging.

On Wed, Mar 19, 2008 at 1:12 PM, Richard Sayre <richardsayre@(protected):
> I set the file upload max size in the struts.properties to 15MB. When
> I upload a file over 15MB my action returns input. Is there any way I
> can check to see if the file is over the max size set in the
> properties file and handle what result I want to happen myself? I
> seems that it returns input before it even goes into my action. Is
> this happening in the file upload interceptor? Can I gain more
> control over this?
>
> Thank you,
>
> Rich
>

Attachment: user_184470.ezm (zipped)
Hi,

You can subclass FileUploadInterceptor and override acceptFile(File
file, String contentType, String inputName, ValidationAware
validation, Locale locale) method


Regards
--
Lukasz

http://www.linkedin.com/in/lukaszlenart

Attachment: user_184471.ezm (zipped)
Does your action implements ValidationAware interface?



Regards
--
Lukasz

http://www.linkedin.com/in/lukaszlenart

Attachment: user_184472.ezm (zipped)

Greetings,

Using Struts2, 2.0.11 and Java 5, and having problems with custom type
conversion when I type invalid data in a field. I want to convert times in
military format (0700, 2205) to equivalent java.util.Date, with the date
fields set to 1-1-1970. I am using the defaultStack, which includes
prepare, params, conversionError, validation, and workflow interceptors in
the standard order.

If I enter valid data, everything works properly and I end up with nice Date
fields. If I enter something invalid (e.g. 1599, 99 isn't a valid minutes
value), the error is detected and reported, but the original text isn't
displayed in the input field. I'm not sure what I did wrong; could someone
please help?

When I type invalid data in a field, the following happens:

* Type conversion fails (good)
* Error is added to the error list (good)
* Workflow interceptor sees the error and returns "input" (good)
* Error appears properly in my <s:fielderror/> section (good)
* Text I originally typed in the field does NOT appear in the text box (not
good)
* I have debug logging on and I see the following lines:

[2008/Mar/19 12:13:00] [DEBUG] (ParametersInterceptor:148) Setting params
someBeanList[0].endTime => [ 1599 ] someBeanList[0].startTime => [ 0700 ]

then a few lines later:

[2008/Mar/19 12:13:00] [DEBUG] (XWorkConverter:278) field-level type
converter for property [endTime] =
com.package.converter.TimeConverter@(protected)
[2008/Mar/19 12:13:00] [DEBUG] (OgnlValueStack:165) Error setting value
ognl.MethodFailedException: Method "setEndTime" failed for object
com.package.action.DriverDayBean@(protected)
2008,startTime=<null>,endTime=<null>,invEndTime=<null>]
[java.lang.NoSuchMethodException: setEndTime([Ljava.lang.String;)]
 at ognl.OgnlRuntime.callAppropriateMethod(OgnlRuntime.java:823)
 at ognl.OgnlRuntime.setMethodValue(OgnlRuntime.java:964)
 at
ognl.ObjectPropertyAccessor.setPossibleProperty(ObjectPropertyAccessor.java:75)
 at ognl.ObjectPropertyAccessor.setProperty(ObjectPropertyAccessor.java:131)
 at
com.opensymphony.xwork2.util.OgnlValueStack$ObjectAccessor.setProperty(OgnlValueStack.java:68)
 at ognl.OgnlRuntime.setProperty(OgnlRuntime.java:1656)
 at ognl.ASTProperty.setValueBody(ASTProperty.java:101)
 at ognl.SimpleNode.evaluateSetValueBody(SimpleNode.java:177)
 at ognl.SimpleNode.setValue(SimpleNode.java:246)
 at ognl.ASTChain.setValueBody(ASTChain.java:172)
 at ognl.SimpleNode.evaluateSetValueBody(SimpleNode.java:177)
 at ognl.SimpleNode.setValue(SimpleNode.java:246)
 at ognl.Ognl.setValue(Ognl.java:476)
 at com.opensymphony.xwork2.util.OgnlUtil.setValue(OgnlUtil.java:186)
... snip ...

I logged the contents of the ActionContext later and see this:

original.property.override={driverDays[0].endTime='1599'}

So it looks like the conversionError interceptor worked properly.

Action class:
private List<SomeBean> someBeanList; // ArrayList

SomeBean class:
private Date startTime;
private Date endTime;

// getters and setters here

SomeBean-conversion.properties:
startTime=com.package.converter.TimeConverter
endTime=com.package.converter.TimeConverter

TimeConverter:

public class TimeConverter extends StrutsTypeConverter {

  @SuppressWarnings("unchecked")
  @Override
  public Object convertFromString(Map context, String[] paramValues, Class
toClass) {
    String timeString = paramValues[0];
   
    DateFormat df = getDateFormat();
   
    try {
       return df.parse(timeString);
    } catch (ParseException pe) {
       throw new TypeConversionException(pe);
    }
  }

  @SuppressWarnings("unchecked")
  @Override
  public String convertToString(Map context, Object objToConvert) {
    if (objToConvert == null) {
       return ""; //$NON-NLS-1$
    }
   
    DateFormat df = getDateFormat();
    return df.format((Date)objToConvert);
  }
 
  private DateFormat getDateFormat() {
    DateFormat df = new SimpleDateFormat("HHmm"); //$NON-NLS-1$
    df.setLenient(false);
    return df;
  }


JSP:
(adapted from Roughley's Starting Struts 2, p.64)

<s:iterator value="someBeanList" status="stat">
<s:text name="startTime" />
<s:textfield name="someBeanList[%{#stat.index}].startTime"
   value="%{someBeanList[#stat.index].startTime}" size="4" maxlength="4"
   onkeypress="return numbersonly(this, event)" />
<s:text name="endTime" />
<s:textfield name="someBeanList[%{#stat.index}].endTime"
   value="%{someBeanList[#stat.index].endTime}" size="4" maxlength="4"
   onkeypress="return numbersonly(this, event)" />
</s:iterator>



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


Attachment: user_184478.ezm (zipped)

Greetings,

Using Struts2, 2.0.11 and Java 5, and having problems with custom type
conversion when I type invalid data in a field. I want to convert times in
military format (0700, 2205) to equivalent java.util.Date, with the date
fields set to 1-1-1970. I am using the defaultStack, which includes
prepare, params, conversionError, validation, and workflow interceptors in
the standard order.

If I enter valid data, everything works properly and I end up with nice Date
fields. If I enter something invalid (e.g. 1599, 99 isn't a valid minutes
value), the error is detected and reported, but the original text isn't
displayed in the input field. I'm not sure what I did wrong; could someone
please help?

When I type invalid data in a field, the following happens:

* Type conversion fails (good)
* Error is added to the error list (good)
* Workflow interceptor sees the error and returns "input" (good)
* Error appears properly in my <s:fielderror/> section (good)
* Text I originally typed in the field does NOT appear in the text box (not
good)
* I have debug logging on and I see the following lines:

[2008/Mar/19 12:13:00] [DEBUG] (ParametersInterceptor:148) Setting params
someBeanList[0].endTime => [ 1599 ] someBeanList[0].startTime => [ 0700 ]

then a few lines later:

[2008/Mar/19 12:13:00] [DEBUG] (XWorkConverter:278) field-level type
converter for property [endTime] =
com.package.converter.TimeConverter@(protected)
[2008/Mar/19 12:13:00] [DEBUG] (OgnlValueStack:165) Error setting value
ognl.MethodFailedException: Method "setEndTime" failed for object
com.package.action.DriverDayBean@(protected)
2008,startTime=<null>,endTime=<null>,invEndTime=<null>]
[java.lang.NoSuchMethodException: setEndTime([Ljava.lang.String;)]
 at ognl.OgnlRuntime.callAppropriateMethod(OgnlRuntime.java:823)
 at ognl.OgnlRuntime.setMethodValue(OgnlRuntime.java:964)
 at
ognl.ObjectPropertyAccessor.setPossibleProperty(ObjectPropertyAccessor.java:75)
 at ognl.ObjectPropertyAccessor.setProperty(ObjectPropertyAccessor.java:131)
 at
com.opensymphony.xwork2.util.OgnlValueStack$ObjectAccessor.setProperty(OgnlValueStack.java:68)
 at ognl.OgnlRuntime.setProperty(OgnlRuntime.java:1656)
 at ognl.ASTProperty.setValueBody(ASTProperty.java:101)
 at ognl.SimpleNode.evaluateSetValueBody(SimpleNode.java:177)
 at ognl.SimpleNode.setValue(SimpleNode.java:246)
 at ognl.ASTChain.setValueBody(ASTChain.java:172)
 at ognl.SimpleNode.evaluateSetValueBody(SimpleNode.java:177)
 at ognl.SimpleNode.setValue(SimpleNode.java:246)
 at ognl.Ognl.setValue(Ognl.java:476)
 at com.opensymphony.xwork2.util.OgnlUtil.setValue(OgnlUtil.java:186)
... snip ...

I logged the contents of the ActionContext later and see this:

original.property.override={driverDays[0].endTime='1599'}

So it looks like the conversionError interceptor worked properly.

Action class:
private List<SomeBean> someBeanList; // ArrayList

SomeBean class:
private Date startTime;
private Date endTime;

// getters and setters here

SomeBean-conversion.properties:
startTime=com.package.converter.TimeConverter
endTime=com.package.converter.TimeConverter

TimeConverter:

public class TimeConverter extends StrutsTypeConverter {

  @SuppressWarnings("unchecked")
  @Override
  public Object convertFromString(Map context, String[] paramValues, Class
toClass) {
    String timeString = paramValues[0];
   
    DateFormat df = getDateFormat();
   
    try {
       return df.parse(timeString);
    } catch (ParseException pe) {
       throw new TypeConversionException(pe);
    }
  }

  @SuppressWarnings("unchecked")
  @Override
  public String convertToString(Map context, Object objToConvert) {
    if (objToConvert == null) {
       return ""; //$NON-NLS-1$
    }
   
    DateFormat df = getDateFormat();
    return df.format((Date)objToConvert);
  }
 
  private DateFormat getDateFormat() {
    DateFormat df = new SimpleDateFormat("HHmm"); //$NON-NLS-1$
    df.setLenient(false);
    return df;
  }


JSP:
(adapted from Roughley's Starting Struts 2, p.64)

<s:iterator value="someBeanList" status="stat">
<s:text name="startTime" />
<s:textfield name="someBeanList[%{#stat.index}].startTime"
   value="%{someBeanList[#stat.index].startTime}" size="4" maxlength="4"
   onkeypress="return numbersonly(this, event)" />
<s:text name="endTime" />
<s:textfield name="someBeanList[%{#stat.index}].endTime"
   value="%{someBeanList[#stat.index].endTime}" size="4" maxlength="4"
   onkeypress="return numbersonly(this, event)" />
</s:iterator>



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


Attachment: user_184480.ezm (zipped)

Greetings,

Using Struts2, 2.0.11 and Java 5, and having problems with custom type
conversion when I type invalid data in a field. I want to convert times in
military format (0700, 2205) to equivalent java.util.Date, with the date
fields set to 1-1-1970. I am using the defaultStack, which includes
prepare, params, conversionError, validation, and workflow interceptors in
the standard order.

If I enter valid data, everything works properly and I end up with nice Date
fields. If I enter something invalid (e.g. 1599, 99 isn't a valid minutes
value), the error is detected and reported, but the original text isn't
displayed in the input field. I'm not sure what I did wrong; could someone
please help?

When I type invalid data in a field, the following happens:

* Type conversion fails (good)
* Error is added to the error list (good)
* Workflow interceptor sees the error and returns "input" (good)
* Error appears properly in my <s:fielderror/> section (good)
* Text I originally typed in the field does NOT appear in the text box (not
good)
* I have debug logging on and I see the following lines:

[2008/Mar/19 12:13:00] [DEBUG] (ParametersInterceptor:148) Setting params
someBeanList[0].endTime => [ 1599 ] someBeanList[0].startTime => [ 0700 ]

then a few lines later:

[2008/Mar/19 12:13:00] [DEBUG] (XWorkConverter:278) field-level type
converter for property [endTime] =
com.package.converter.TimeConverter@(protected)
[2008/Mar/19 12:13:00] [DEBUG] (OgnlValueStack:165) Error setting value
ognl.MethodFailedException: Method "setEndTime" failed for object
com.package.action.DriverDayBean@(protected)
2008,startTime=<null>,endTime=<null>,invEndTime=<null>]
[java.lang.NoSuchMethodException: setEndTime([Ljava.lang.String;)]
 at ognl.OgnlRuntime.callAppropriateMethod(OgnlRuntime.java:823)
 at ognl.OgnlRuntime.setMethodValue(OgnlRuntime.java:964)
 at
ognl.ObjectPropertyAccessor.setPossibleProperty(ObjectPropertyAccessor.java:75)
 at ognl.ObjectPropertyAccessor.setProperty(ObjectPropertyAccessor.java:131)
 at
com.opensymphony.xwork2.util.OgnlValueStack$ObjectAccessor.setProperty(OgnlValueStack.java:68)
 at ognl.OgnlRuntime.setProperty(OgnlRuntime.java:1656)
 at ognl.ASTProperty.setValueBody(ASTProperty.java:101)
 at ognl.SimpleNode.evaluateSetValueBody(SimpleNode.java:177)
 at ognl.SimpleNode.setValue(SimpleNode.java:246)
 at ognl.ASTChain.setValueBody(ASTChain.java:172)
 at ognl.SimpleNode.evaluateSetValueBody(SimpleNode.java:177)
 at ognl.SimpleNode.setValue(SimpleNode.java:246)
 at ognl.Ognl.setValue(Ognl.java:476)
 at com.opensymphony.xwork2.util.OgnlUtil.setValue(OgnlUtil.java:186)
... snip ...

I logged the contents of the ActionContext later and see this:

original.property.override={driverDays[0].endTime='1599'}

So it looks like the conversionError interceptor worked properly.

Action class:
private List<SomeBean> someBeanList; // ArrayList

SomeBean class:
private Date startTime;
private Date endTime;

// getters and setters here

SomeBean-conversion.properties:
startTime=com.package.converter.TimeConverter
endTime=com.package.converter.TimeConverter

TimeConverter:

public class TimeConverter extends StrutsTypeConverter {

  @SuppressWarnings("unchecked")
  @Override
  public Object convertFromString(Map context, String[] paramValues, Class
toClass) {
    String timeString = paramValues[0];
   
    DateFormat df = getDateFormat();
   
    try {
       return df.parse(timeString);
    } catch (ParseException pe) {
       throw new TypeConversionException(pe);
    }
  }

  @SuppressWarnings("unchecked")
  @Override
  public String convertToString(Map context, Object objToConvert) {
    if (objToConvert == null) {
       return ""; //$NON-NLS-1$
    }
   
    DateFormat df = getDateFormat();
    return df.format((Date)objToConvert);
  }
 
  private DateFormat getDateFormat() {
    DateFormat df = new SimpleDateFormat("HHmm"); //$NON-NLS-1$
    df.setLenient(false);
    return df;
  }


JSP:
(adapted from Roughley's Starting Struts 2, p.64)

<s:iterator value="someBeanList" status="stat">
<s:text name="startTime" />
<s:textfield name="someBeanList[%{#stat.index}].startTime"
   value="%{someBeanList[#stat.index].startTime}" size="4" maxlength="4"
   onkeypress="return numbersonly(this, event)" />
<s:text name="endTime" />
<s:textfield name="someBeanList[%{#stat.index}].endTime"
   value="%{someBeanList[#stat.index].endTime}" size="4" maxlength="4"
   onkeypress="return numbersonly(this, event)" />
</s:iterator>



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


Attachment: user_184483.ezm (zipped)

Greetings,

Using Struts2, 2.0.11 and Java 5, and having problems with custom type
conversion when I type invalid data in a field. I want to convert times in
military format (0700, 2205) to equivalent java.util.Date, with the date
fields set to 1-1-1970. I am using the defaultStack, which includes
prepare, params, conversionError, validation, and workflow interceptors in
the standard order.

If I enter valid data, everything works properly and I end up with nice Date
fields. If I enter something invalid (e.g. 1599, 99 isn't a valid minutes
value), the error is detected and reported, but the original text isn't
displayed in the input field. I'm not sure what I did wrong; could someone
please help?

When I type invalid data in a field, the following happens:

* Type conversion fails (good)
* Error is added to the error list (good)
* Workflow interceptor sees the error and returns "input" (good)
* Error appears properly in my <s:fielderror/> section (good)
* Text I originally typed in the field does NOT appear in the text box (not
good)
* I have debug logging on and I see the following lines:

[2008/Mar/19 12:13:00] [DEBUG] (ParametersInterceptor:148) Setting params
someBeanList[0].endTime => [ 1599 ] someBeanList[0].startTime => [ 0700 ]

then a few lines later:

[2008/Mar/19 12:13:00] [DEBUG] (XWorkConverter:278) field-level type
converter for property [endTime] =
com.package.converter.TimeConverter@(protected)
[2008/Mar/19 12:13:00] [DEBUG] (OgnlValueStack:165) Error setting value
ognl.MethodFailedException: Method "setEndTime" failed for object
com.package.action.DriverDayBean@(protected)
2008,startTime=<null>,endTime=<null>,invEndTime=<null>]
[java.lang.NoSuchMethodException: setEndTime([Ljava.lang.String;)]
 at ognl.OgnlRuntime.callAppropriateMethod(OgnlRuntime.java:823)
 at ognl.OgnlRuntime.setMethodValue(OgnlRuntime.java:964)
 at
ognl.ObjectPropertyAccessor.setPossibleProperty(ObjectPropertyAccessor.java:75)
 at ognl.ObjectPropertyAccessor.setProperty(ObjectPropertyAccessor.java:131)
 at
com.opensymphony.xwork2.util.OgnlValueStack$ObjectAccessor.setProperty(OgnlValueStack.java:68)
 at ognl.OgnlRuntime.setProperty(OgnlRuntime.java:1656)
 at ognl.ASTProperty.setValueBody(ASTProperty.java:101)
 at ognl.SimpleNode.evaluateSetValueBody(SimpleNode.java:177)
 at ognl.SimpleNode.setValue(SimpleNode.java:246)
 at ognl.ASTChain.setValueBody(ASTChain.java:172)
 at ognl.SimpleNode.evaluateSetValueBody(SimpleNode.java:177)
 at ognl.SimpleNode.setValue(SimpleNode.java:246)
 at ognl.Ognl.setValue(Ognl.java:476)
 at com.opensymphony.xwork2.util.OgnlUtil.setValue(OgnlUtil.java:186)
... snip ...

I logged the contents of the ActionContext later and see this:

original.property.override={driverDays[0].endTime='1599'}

So it looks like the conversionError interceptor worked properly.

Action class:
private List<SomeBean> someBeanList; // ArrayList

SomeBean class:
private Date startTime;
private Date endTime;

// getters and setters here

SomeBean-conversion.properties:
startTime=com.package.converter.TimeConverter
endTime=com.package.converter.TimeConverter

TimeConverter:

public class TimeConverter extends StrutsTypeConverter {

  @SuppressWarnings("unchecked")
  @Override
  public Object convertFromString(Map context, String[] paramValues, Class
toClass) {
    String timeString = paramValues[0];
   
    DateFormat df = getDateFormat();
   
    try {
       return df.parse(timeString);
    } catch (ParseException pe) {
       throw new TypeConversionException(pe);
    }
  }

  @SuppressWarnings("unchecked")
  @Override
  public String convertToString(Map context, Object objToConvert) {
    if (objToConvert == null) {
       return ""; //$NON-NLS-1$
    }
   
    DateFormat df = getDateFormat();
    return df.format((Date)objToConvert);
  }
 
  private DateFormat getDateFormat() {
    DateFormat df = new SimpleDateFormat("HHmm"); //$NON-NLS-1$
    df.setLenient(false);
    return df;
  }


JSP:
(adapted from Roughley's Starting Struts 2, p.64)

<s:iterator value="someBeanList" status="stat">
<s:text name="startTime" />
<s:textfield name="someBeanList[%{#stat.index}].startTime"
   value="%{someBeanList[#stat.index].startTime}" size="4" maxlength="4"
   onkeypress="return numbersonly(this, event)" />
<s:text name="endTime" />
<s:textfield name="someBeanList[%{#stat.index}].endTime"
   value="%{someBeanList[#stat.index].endTime}" size="4" maxlength="4"
   onkeypress="return numbersonly(this, event)" />
</s:iterator>



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


Attachment: user_184473.ezm (zipped)

Thanks for the reply. I did try nesting a <s:date> tag within a <s:url> but
no dice. This is what I tried:

<s:url action="date/">
<s:date name="starts" />
</s:url>

I didn't even think this would, but it actually did render the following
result
http://localhost:8080/myapp/2007-05-12 day/

I was expecting http://localhost:8080/myapp/day/2007-05-12.action

Also I noticed that there seems to be a bug with the var attribute in
<s:url> (it doesn't work at all)

Maybe someone can shed some light on these issues?



Alexis Pigeon wrote:
>
> Hi,
>
> On 18/03/2008, meeboo <deepstar@(protected):
>>
>> Has anyone had success with <s:date /> and setting the
>> struts.date.format
>> property?
>>
>> meeboo wrote:
>> >
>> > Hi all
>> >
>> > I have set my struts.date.format properties but they seem to have no
>> > effect at all.
>
> [snip]
>
>> > I've also noticed that since you can't nest S2 tags the <s:date> tag
>> > becomes pretty useless because you can't use it within <s:url>
>> actions. Is
>> > there a way around this?
>
> I can't help you with your issue about setting the struts.date.format
> property (I never needed the <s:date> tag so far), but as for
> "nesting" S2 tags, most often it can easily be done using the
> <s:param> tag. See the examples in the tag reference [1].
>
> HTH,
> alexis
>
> [1] http://struts.apache.org/2.0.11/docs/url.html
>
> ---------------------------------------------------------------------
> 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_184474.ezm (zipped)

Thanks for the reply. I did try nesting a <s:date> tag within a <s:url> but
no dice. This is what I tried:

<s:url action="date/">
<s:date name="starts" />
</s:url>

I didn't even think this would fly, but it actually did render the following
result
http://localhost:8080/myapp/2007-05-12 day/

I was expecting http://localhost:8080/myapp/day/2007-05-12.action

Also I noticed that there seems to be a bug with the var attribute in
<s:url> (it doesn't work at all)

Maybe someone can shed some light on these issues? Has anyone had success
with struts.date.format for example?



Alexis Pigeon wrote:
>
> Hi,
>
> On 18/03/2008, meeboo <deepstar@(protected):
>>
>> Has anyone had success with <s:date /> and setting the
>> struts.date.format
>> property?
>>
>> meeboo wrote:
>> >
>> > Hi all
>> >
>> > I have set my struts.date.format properties but they seem to have no
>> > effect at all.
>
> [snip]
>
>> > I've also noticed that since you can't nest S2 tags the <s:date> tag
>> > becomes pretty useless because you can't use it within <s:url>
>> actions. Is
>> > there a way around this?
>
> I can't help you with your issue about setting the struts.date.format
> property (I never needed the <s:date> tag so far), but as for
> "nesting" S2 tags, most often it can easily be done using the
> <s:param> tag. See the examples in the tag reference [1].
>
> HTH,
> alexis
>
> [1] http://struts.apache.org/2.0.11/docs/url.html
>
> ---------------------------------------------------------------------
> 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_184475.ezm (zipped)

Thanks for the reply. I did try nesting a <s:date> tag within a <s:url> but
no dice. This is what I tried:

<s:url action="day/">
<s:date name="starts" />
</s:url>

I didn't even think this would fly, but it actually did render the following
result
http://localhost:8080/myapp/2007-05-12 day/

I was expecting http://localhost:8080/myapp/day/2007-05-12.action

Also I noticed that there seems to be a bug with the var attribute in
<s:url> (it doesn't work at all)

Maybe someone can shed some light on these issues? Has anyone had success
with struts.date.format for example?



Alexis Pigeon wrote:
>
> Hi,
>
> On 18/03/2008, meeboo <deepstar@(protected):
>>
>> Has anyone had success with <s:date /> and setting the
>> struts.date.format
>> property?
>>
>> meeboo wrote:
>> >
>> > Hi all
>> >
>> > I have set my struts.date.format properties but they seem to have no
>> > effect at all.
>
> [snip]
>
>> > I've also noticed that since you can't nest S2 tags the <s:date> tag
>> > becomes pretty useless because you can't use it within <s:url>
>> actions. Is
>> > there a way around this?
>
> I can't help you with your issue about setting the struts.date.format
> property (I never needed the <s:date> tag so far), but as for
> "nesting" S2 tags, most often it can easily be done using the
> <s:param> tag. See the examples in the tag reference [1].
>
> HTH,
> alexis
>
> [1] http://struts.apache.org/2.0.11/docs/url.html
>
> ---------------------------------------------------------------------
> 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_184476.ezm (zipped)

Thanks for the reply. I did try nesting a <s:date> tag within a <s:url> but
no dice. This is what I tried:

<s:url action="day/">
<s:date name="starts" />
</s:url>

I didn't even think this would fly, but it actually did render the following
result
http://localhost:8080/myapp/2007-05-12 day/

I was expecting http://localhost:8080/myapp/day/2007-05-12.action

Also I noticed that there seems to be a bug with the var attribute in
<s:url> (it doesn't work at all)

Maybe someone can shed some light on these issues? Has anyone had success
with struts.date.format for example?

I am running struts 2.0.11


Alexis Pigeon wrote:
>
> Hi,
>
> On 18/03/2008, meeboo <deepstar@(protected):
>>
>> Has anyone had success with <s:date /> and setting the
>> struts.date.format
>> property?
>>
>> meeboo wrote:
>> >
>> > Hi all
>> >
>> > I have set my struts.date.format properties but they seem to have no
>> > effect at all.
>
> [snip]
>
>> > I've also noticed that since you can't nest S2 tags the <s:date> tag
>> > becomes pretty useless because you can't use it within <s:url>
>> actions. Is
>> > there a way around this?
>
> I can't help you with your issue about setting the struts.date.format
> property (I never needed the <s:date> tag so far), but as for
> "nesting" S2 tags, most often it can easily be done using the
> <s:param> tag. See the examples in the tag reference [1].
>
> HTH,
> alexis
>
> [1] http://struts.apache.org/2.0.11/docs/url.html
>
> ---------------------------------------------------------------------
> 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_184477.ezm (zipped)
Hi,

I would like to initialize and share an object when my application deploy
but I'm not sure on the best way to do it.
The idea is to access something like ServletContext() and then initialize my
object in it in a synchronized way.
I know the ActionContext is ThreadLocal so If i put my object in it I don't
think it will be accessible for every user of the site.
So what is the best way to share data between action with struts 2 ?

Thanks ;)

Attachment: user_184479.ezm (zipped)
Hi

I asked the same questions just some days ago.
Please read
http://mail-archives.apache.org/mod_mbox/struts-user/200803.mbox/%3c20080313
213231.0A3D01FFEBE@(protected)
(have a look at the first and the last message in the thread).

Frank

> -----Original Message-----
> From: deeeed [mailto:deeeed@(protected)]
> Sent: Wednesday, March 19, 2008 9:03 PM
> To: user@(protected)
> Subject: [S2] application context
>
> Hi,
>
> I would like to initialize and share an object when my
> application deploy
> but I'm not sure on the best way to do it.
> The idea is to access something like ServletContext() and
> then initialize my
> object in it in a synchronized way.
> I know the ActionContext is ThreadLocal so If i put my object
> in it I don't
> think it will be accessible for every user of the site.
> So what is the best way to share data between action with struts 2 ?
>
> Thanks ;)
>


Attachment: user_184482.ezm (zipped)
Thanks for your quick answer.

2008/3/19, Frank Fischer <frank.fischer@(protected)>:
>
> Hi
>
> I asked the same questions just some days ago.
> Please read
>
> http://mail-archives.apache.org/mod_mbox/struts-user/200803.mbox/%3c20080313
> 213231.0A3D01FFEBE@(protected)
> (have a look at the first and the last message in the thread).
>
> Frank
>
>
> > -----Original Message-----
> > From: deeeed [mailto:deeeed@(protected)]
> > Sent: Wednesday, March 19, 2008 9:03 PM
> > To: user@(protected)
> > Subject: [S2] application context
> >
> > Hi,
> >
> > I would like to initialize and share an object when my
> > application deploy
> > but I'm not sure on the best way to do it.
> > The idea is to access something like ServletContext() and
> > then initialize my
> > object in it in a synchronized way.
> > I know the ActionContext is ThreadLocal so If i put my object
> > in it I don't
> > think it will be accessible for every user of the site.
> > So what is the best way to share data between action with struts 2 ?
> >
> > Thanks ;)
> >
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>

Attachment: user_184481.ezm (zipped)

Hello
i have a textfield with the name="firstName"
and a textfield with the name="address.city" etc..
the action is model driven where firstName is the property of model.
Since address is a property of action (not property of model)

how come address.city does not get set it doesn't eve go to the setter???
p.s model properties get set eg. firstName.value etc..

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

©2008 gg3721.com - Jax Systems, LLC, U.S.A.