Forward to different JSPs
Hi, in my web application I want to call one single action class from different JSPs. After that the class should return to the JSP from that it was called. In my struts action tags I have to define an input JSP for every action: action path=/secure/dataChecks name=emptyForm type=org.springframework.web.struts.DelegatingActionProxy input=/secure/dataChecks.jsp / So here it is only possible to return to the given input JSP dataChecks.jsp. How can I return to the calling JSP without defining one action tag for every single JSP? Regards, Christoph __ Erweitern Sie FreeMail zu einem noch leistungsstärkeren E-Mail-Postfach! Mehr Infos unter http://produkte.web.de/club/?mc=021131 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Problems with multiple resource files (can separate modules be a solution?)
Hi, I just noticed that we have a problem with our resource files for our site. The problem is that I don't know how to handle more then one resource file. We have two different parts of the site that both use resource properties. One of them (a forum) is build by other persons in our projekt. The other one (a place where the user can login and purchase things, for instance) is done by me. During development I never bothered to create my resource properties file, so all errors got printed like ??the_error_message_key??. But then I created a resource file, and then the problems started. With more then one resource, it seems that I need to specify which one to use. Is there no way to make it use both? Ie it first looks in one, and then the other, and so on, until it finds what it is looking for. I don't want to have to use bundle=some-name all over the place. And don't want to have to make the forum guys make changes in their code if not absolutely necessary. After searching on google, I'm starting to think that maybe one option is to divide this into two different struts modules. But it seems like a lot of work, and even though I have read the struts userguide on modules I still don't understand exactly how it works. And is it even possible to move out the forum part to a own module withouth changing code in jsp-pages and stuff? Does anything I wrote here make any sense to you guys? I'm sure I'm going at this the wrong way, but I don't know what I should do... All I want is to be able to display messages (mostly errors), have multiple resource files, and not have to use the bundle attribute. One solution that I know will work is to put all properties in one big file, but I really don't like that idea. Suggestions? Regards /Jimi - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Struts 1.2 using formbeans
hmm, I assume the input fields have the same name as the relevant form properties. Case is important. Perhaps you need an input parameter in your action definition. input=inputform.jsp or something along those lines. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Forward to different JSPs
On 8/15/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Hi, action path=/secure/dataChecks name=emptyForm type=org.springframework.web.struts.DelegatingActionProxy input=/secure/dataChecks.jsp / So here it is only possible to return to the given input JSP dataChecks.jsp. How can I return to the calling JSP without defining one action tag for every single JSP? If you don't close your actionmapping right away you can put forward tags in which you can define diffrent places to go. action ... forward.../ /action In your action class you can look for request params to decde which way to go. http://struts.apache.org/1.3.8/userGuide/building_controller.html#config for more info. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: struts2 ajax jsps
It worked when I change the extention to action. I am using Appfuse and it comes with html extention default. So I wonder if there is a way to make it work with html extention or I will post a message to Appfuse if it is possible to change the default extention to something else than html. Thanks... Ian Roughley wrote: This line: There is no Action mapped for namespace /struts/dojo/src/widget/templates and action name TabContainer. Seems to suggest that you may have changed the extension from .action to .html, so s2 is looking for an action called TabContainer. /Ian Struts2 Fan wrote: I met the same error, too. I have just a simple jsp start of simple.jsp %@ include file=/common/taglibs.jsp % head s:head theme=ajax/s:head /head s:tabbedPanel id=test2 theme=simple cssStyle=width: 500px; height: 300px; doLayout=true s:div theme=ajax id=left label=left s:form s:textfield name=tt label=Test Text/ br/ s:textfield name=tt2 label=Test Text2/ /s:form /s:div s:div theme=ajax id=right label=right This is the right panebr/ /s:div /s:tabbedPanel end of simple.jsp Here it gives the following error start of error ERROR [btpool0-2] Dispatcher.serviceAction(512) | Could not find action or result There is no Action mapped for namespace /struts/dojo/src/widget/templates and action name TabContainer. - [unknown location] at com.opensymphony.xwork2.DefaultActionProxy.prepare(DefaultActionProxy.java:186) at org.apache.struts2.impl.StrutsActionProxyFactory.createActionProxy(StrutsActionProxyFactory.java:41) at org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:494) at org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:419) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1041) at org.appfuse.webapp.filter.StaticFilter.doFilterInternal(StaticFilter.java:106) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:75) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1041) at com.opensymphony.module.sitemesh.filter.PageFilter.doFilter(PageFilter.java:39) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1041) at org.apache.struts2.dispatcher.ActionContextCleanUp.doFilter(ActionContextCleanUp.java:99) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1041) at org.tuckey.web.filters.urlrewrite.UrlRewriteFilter.doFilter(UrlRewriteFilter.java:350) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1041) at org.displaytag.filter.ResponseOverrideFilter.doFilter(ResponseOverrideFilter.java:125) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1041) at net.sf.ehcache.constructs.web.filter.GzipFilter.doFilter(GzipFilter.java:75) at net.sf.ehcache.constructs.web.filter.Filter.doFilter(Filter.java:92) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1041) at org.appfuse.webapp.filter.LocaleFilter.doFilterInternal(LocaleFilter.java:64) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:75) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1041) at com.opensymphony.clickstream.ClickstreamFilter.doFilter(ClickstreamFilter.java:42) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1041) at org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:198) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:75) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1041) at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:264) at org.acegisecurity.intercept.web.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:107) at org.acegisecurity.intercept.web.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:72) at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:274) at org.acegisecurity.ui.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:110) at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:274) at org.acegisecurity.providers.anonymous.AnonymousProcessingFilter.doFilter(AnonymousProcessingFilter.java:125) at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:274) at
Re: Struts 2 URL parameters lost - final status
I am using Struts 2.0.6 and the jar contains struts struts-default.xml which contains the following property bean type=org.apache.struts2.dispatcher.mapper.ActionMapper name=struts class=org.apache.struts2.dispatcher.mapper.DefaultActionMapper / bean type=org.apache.struts2.dispatcher.mapper.ActionMapper name=composite class=org.apache.struts2.dispatcher.mapper.CompositeActionMapper / bean type=org.apache.struts2.dispatcher.mapper.ActionMapper name=restful class=org.apache.struts2.dispatcher.mapper.RestfulActionMapper / bean type=org.apache.struts2.dispatcher.mapper.ActionMapper name=restful2 class=org.apache.struts2.dispatcher.mapper.Restful2ActionMapper / We have a struts.xml in WEB-INF/classes folder and I was trying to override the default actionmapper by having the following lines in my struts.xml ( just for testing I am overriding with the default class itself ) bean type=org.apache.struts2.dispatcher.mapper.ActionMapper name=struts class=org.apache.struts2.dispatcher.mapper.DefaultActionMapper / But this results in an error when I started up tomcat Unable to load bean: type:org.apache.struts2.dispatcher.mapper.ActionMapper class:org.apache.struts2.dispatcher.mapper.DefaultActionMapper - bean - file:/C:/software/tomcat6/webapps/abc/WEB-INF/classes/struts.xml:17:149 Caused by: Bean type interface org.apache.struts2.dispatcher.mapper.ActionMapper with the name struts has already been loaded by [unknown location] - bean - file:/C:/software/tomcat6/webapps/abc/WEB-INF/classes/struts.xml:17:149 So the question that I have are 1) How do I override the mapping class ? 2) Why are there 4 bean declaration for actionmapper ? thanks in advance! JBL wrote: Final answer: we implemented a custom ActionMapper that handles a URL string that doesn't involve a ? to separate the query parameters. Stuck a reference to it in struts.properties: struts.mapper.class=mypackage.MyActionMapper Building a new ActionMapper isn't terribly difficult. It helps to define your expected URLs with a regular expression, then use a precompiled pattern. Ours looks something like: private static String NAMESPACE_REGEX = ...; private static String ACTION_REGEX = ...; private static String METHOD_REGEX = ...; private static String PARAMS_REGEX = ...; private static String URI_REGEX = (concatenate the four above) private static Pattern URI_PATTERN = Pattern.compile(URI_REGEX); Then, in getMapping(), pull out the URI (similar to DefaultActionMapper) and call Matcher m = URI_PATTERN.matcher(uri); If you get a match, create a new ActionMapping and set its components based on the matching groups: mapping.setNamespace(m.group(1)); mapping.setName(m.group(1)); etc. You can parse the parameter section and build a map to pass to mapping.setParams(). Using a precompiled pattern may or may not be the most efficient possible solution, but it helps you define exactly what URIs you expect. I recommend throwing a bunch of possibilities at it in your unit test code with various components present and missing. If you're a little unsure about regular expressions, build some unit tests for those, too. Sun has a decent write-up in their Java documentation: http://java.sun.com/j2se/1.5.0/docs/api/java/util/regex/Pattern.html Especially read the Groups and Capturing section, it's a handy tool to have in your portfolio. We may yet discover why we couldn't get query parameters, but this works for now. Good luck. -- View this message in context: http://www.nabble.com/Struts-2-URL-parameters-lost-tf4196254.html#a12160600 Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
S2 : Overriding interceptor class names in struts.xml
Hi, Is there a way we can override the implementation of certain interceptors from the default stack, without copying over all the definitions to struts.xml ? ex : i want to change the behavior of workflow interceptor in the way it handles errors and routes to input page. I defined : interceptors interceptor name=workflow class=com.mypackage.MyWorkflowInterce ptor/ /interceptors within package name=hello-default extends=struts-default in struts.xml, but seems it still picks up the default one. I know we can override the params of each interceptor , but can we do the same with implementation class itself? Thanks, Joseph - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: S2 : Overriding interceptor class names in struts.xml
Unfortunately, you have to re-define the stack. Nils-H On 8/15/07, j alex [EMAIL PROTECTED] wrote: Hi, Is there a way we can override the implementation of certain interceptors from the default stack, without copying over all the definitions to struts.xml ? ex : i want to change the behavior of workflow interceptor in the way it handles errors and routes to input page. I defined : interceptors interceptor name=workflow class=com.mypackage.MyWorkflowInterce ptor/ /interceptors within package name=hello-default extends=struts-default in struts.xml, but seems it still picks up the default one. I know we can override the params of each interceptor , but can we do the same with implementation class itself? Thanks, Joseph - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Trouble getting to portlet render phase
I am pretty sure this is a configuration issue, probably in struts.xml. I am trying to create a JSR168 compliant portlet. I have been working with the portletunit code to get it to execute in a unit test, as well as running it with JBossPortal. The behavior is the same, so I am hoping it is not an issue of the test harness introducing an issue. I debug/traced the execution. The Action is correctly constructed using the SpringFactory along with all properties. It is invoked and executes without error. It gets to DefaultActionInvocation having created a PortletResult, and calls result.execute(this). The lastFinalLocation is set to the location of the jsp specified in the struts.xml. PortletResult.doExecute() calls executeRegularServletResult(). Should I have been in render mode at this point and had executeRenderResult called instead? I have seen a number of posting saying best practice is to redirect to another action executing in render phase that then specifies the jsp as the result. Mine ends up calling PreparatorServlet.service and sets up the servlet request parameters into the ActionContext, and then ends, having never called the jsp. I also am not seeing where the Jsr168Dispatcher is ever invoked. It does not show up in the stack as I execute. I do not know if that is an issue. I have tried a number of combinations of XML including trying to redirect to a renderDirect.action which then redirects to the .jsp. Problem is that I have found no examples of using this action, and I have not stumbled on the answer. I have tried setting the result type to redirect... no joy. I am using Struts 2.0.9. If anyone could take a peek at my struts.xml and tell me what I am doing wrong, I would be eternally grateful. I do not understand how my code differs from the HelloWorld portlet examples that I started with. Thank you. Fred --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-portlet-default.xml / package name=basePortlet extends=struts-portlet-default interceptors interceptor-stack name=portletStack interceptor-ref name=basicStack/ interceptor-ref name=portlet-preferences / /interceptor-stack /interceptors default-interceptor-ref name=portletStack/ /package package name=view extends=basePortlet namespace=/view action name=index class=viewMyPortlet result name=success/WEB-INF/view/MyPortlet.jsp/result /action action name=viewMyPortlet class=viewMyPortlet result name=success/WEB-INF/view/MyPortlet.jsp/result /action action name=viewMyPortletSubcomponent1 class=viewMyPortlet result name=success/WEB-INF/view/MyPortletSubcomponent1.jsp/result /action /package package name=edit extends=basePortlet namespace=/edit action name=index class=com.opensymphony.xwork2.ActionSupport result name=success/WEB-INF/edit/index.jsp/result /action /package package name=help extends=basePortlet namespace=/help action name=index class=com.opensymphony.xwork2.ActionSupport result name=success/WEB-INF/help/index.jsp/result /action /package /struts --applicationContext.xml--- ... bean id=viewMyPortlet class=com.mycompany.MyPortletAction scope=prototype autowire=byName ... /bean ... --portlet.xml 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=struts-portlet portlet id=MySamplePortlet descriptionA Sample Portlet/description portlet-nameMySamplePortlet/portlet-name display-nameSample Portlet/display-name portlet-classorg.apache.struts2.portlet.dispatcher.Jsr168Dispatcher/portlet-class init-param !-- The view mode namespace. Maps to a namespace in the xwork config file -- nameviewNamespace/name value/view/value /init-param init-param !-- The default action to invoke in view mode -- namedefaultViewAction/name valueindex/value /init-param init-param !-- The view mode namespace. Maps to a namespace in the xwork config file -- nameeditNamespace/name value/edit/value /init-param init-param !-- The default action to invoke in view mode -- namedefaultEditAction/name valueindex/value /init-param init-param !-- The view mode namespace. Maps to a namespace in the xwork config file -- namehelpNamespace/name value/help/value
Re: How to find validation.js?
Thanks -I figured it out. In my web.xml I had only mapped the struts FilterDispatcher to *.action, I had to change it to map it to /*. My old web.xml: filter filter-namestruts2/filter-name filter- classorg.apache.struts2.dispatcher.FilterDispatcher/filter-class /filter filter-mapping filter-namestruts2/filter-name url-pattern*.action/url-pattern /filter-mapping New, correct web.xml: filter filter-namestruts2/filter-name filter- classorg.apache.struts2.dispatcher.FilterDispatcher/filter-class /filter filter-mapping filter-namestruts2/filter-name url-pattern/*/url-pattern /filter-mapping On Aug 14, 2007, at 11:31 PM, Musachy Barroso wrote: The file is there(inside the Struts jar file). You don't need to extract the file, S2 will serve it from inside the jar. If you put the url by hand on the browser, does it return the js file? musachy On 8/14/07, Joel Patton [EMAIL PROTECTED] wrote: I am trying to get the client side validation working in my Struts 2 app using the xhtml theme, but my web page isn't loading validation.js. I see the outputted HTML as: script type=text/javascript src=/tools/struts/xhtml/ validation.js/script Do I need to copy the template directories out of the struts2-core jar file into my web content path or should this be loading the JS directly from the jar file? I didn't see any instructions about moving files out of the jar, so I'm confused how my app is supposed to be able to resolve this reference to validation.js when I don't have a struts/..etc path underneath my web root. Is there a configuration setting I'm missing somewhere? Thanks, Joel - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Hey you! Would you help me to carry the stone? Pink Floyd - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Trouble getting to portlet render phase
Are you creating the urls correctly using the s:url tag? Do you have an example JSP? How do you invoke your portlet application? Remember that you can't access the portlet using regular urls, they all have to go through the portlet container. Nils-H On 8/15/07, Frederick N. Brier [EMAIL PROTECTED] wrote: I am pretty sure this is a configuration issue, probably in struts.xml. I am trying to create a JSR168 compliant portlet. I have been working with the portletunit code to get it to execute in a unit test, as well as running it with JBossPortal. The behavior is the same, so I am hoping it is not an issue of the test harness introducing an issue. I debug/traced the execution. The Action is correctly constructed using the SpringFactory along with all properties. It is invoked and executes without error. It gets to DefaultActionInvocation having created a PortletResult, and calls result.execute(this). The lastFinalLocation is set to the location of the jsp specified in the struts.xml. PortletResult.doExecute() calls executeRegularServletResult(). Should I have been in render mode at this point and had executeRenderResult called instead? I have seen a number of posting saying best practice is to redirect to another action executing in render phase that then specifies the jsp as the result. Mine ends up calling PreparatorServlet.service and sets up the servlet request parameters into the ActionContext, and then ends, having never called the jsp. I also am not seeing where the Jsr168Dispatcher is ever invoked. It does not show up in the stack as I execute. I do not know if that is an issue. I have tried a number of combinations of XML including trying to redirect to a renderDirect.action which then redirects to the .jsp. Problem is that I have found no examples of using this action, and I have not stumbled on the answer. I have tried setting the result type to redirect... no joy. I am using Struts 2.0.9. If anyone could take a peek at my struts.xml and tell me what I am doing wrong, I would be eternally grateful. I do not understand how my code differs from the HelloWorld portlet examples that I started with. Thank you. Fred --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-portlet-default.xml / package name=basePortlet extends=struts-portlet-default interceptors interceptor-stack name=portletStack interceptor-ref name=basicStack/ interceptor-ref name=portlet-preferences / /interceptor-stack /interceptors default-interceptor-ref name=portletStack/ /package package name=view extends=basePortlet namespace=/view action name=index class=viewMyPortlet result name=success/WEB-INF/view/MyPortlet.jsp/result /action action name=viewMyPortlet class=viewMyPortlet result name=success/WEB-INF/view/MyPortlet.jsp/result /action action name=viewMyPortletSubcomponent1 class=viewMyPortlet result name=success/WEB-INF/view/MyPortletSubcomponent1.jsp/result /action /package package name=edit extends=basePortlet namespace=/edit action name=index class=com.opensymphony.xwork2.ActionSupport result name=success/WEB-INF/edit/index.jsp/result /action /package package name=help extends=basePortlet namespace=/help action name=index class=com.opensymphony.xwork2.ActionSupport result name=success/WEB-INF/help/index.jsp/result /action /package /struts --applicationContext.xml--- ... bean id=viewMyPortlet class=com.mycompany.MyPortletAction scope=prototype autowire=byName ... /bean ... --portlet.xml 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=struts-portlet portlet id=MySamplePortlet descriptionA Sample Portlet/description portlet-nameMySamplePortlet/portlet-name display-nameSample Portlet/display-name portlet-classorg.apache.struts2.portlet.dispatcher.Jsr168Dispatcher/portlet-class init-param !-- The view mode namespace. Maps to a namespace in the xwork config file -- nameviewNamespace/name value/view/value /init-param init-param !-- The default action to invoke in view mode -- namedefaultViewAction/name valueindex/value /init-param init-param !-- The view mode namespace. Maps to a
Re: Dynamic Tree Example
What I would really like to do is create a model Petshop application for Struts 2. I've setup a Google Code site for this purpose, but I haven't had a chance to seriously pursue it yet. * http://code.google.com/p/sq1-petstore/ My dream would be to have a full set of use cases, a reasonable set of formal requirements, and full suite of JUnit and Selenium tests for Petstore, along the lines of what I do for my own projects. Would there be merit in suggesting that maybe we should have two seperate versions. One traditional implementation - minimal javascript, no ajax etc and a second version using the full gamut of available technologies. Regards - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: struts2 ajax jsps
I think there was a discussion from Matt about this (appfuse using html extensions) a while back, you might want to check the archives. On the s2 side, there are options, but I'm not sure there is an easy solution for using .html as an extension. /Ian Struts2 Fan wrote: Opps How can I make struts to ignore this and read them as html? Or do I have to change the extention to get it work. Thanks for the answer. Ian Roughley wrote: This line: There is no Action mapped for namespace /struts/dojo/src/widget/templates and action name TabContainer. Seems to suggest that you may have changed the extension from .action to .html, so s2 is looking for an action called TabContainer. /Ian Struts2 Fan wrote: I met the same error, too. I have just a simple jsp start of simple.jsp %@ include file=/common/taglibs.jsp % head s:head theme=ajax/s:head /head s:tabbedPanel id=test2 theme=simple cssStyle=width: 500px; height: 300px; doLayout=true s:div theme=ajax id=left label=left s:form s:textfield name=tt label=Test Text/ br/ s:textfield name=tt2 label=Test Text2/ /s:form /s:div s:div theme=ajax id=right label=right This is the right panebr/ /s:div /s:tabbedPanel end of simple.jsp Here it gives the following error start of error ERROR [btpool0-2] Dispatcher.serviceAction(512) | Could not find action or result There is no Action mapped for namespace /struts/dojo/src/widget/templates and action name TabContainer. - [unknown location] at com.opensymphony.xwork2.DefaultActionProxy.prepare(DefaultActionProxy.java:186) at org.apache.struts2.impl.StrutsActionProxyFactory.createActionProxy(StrutsActionProxyFactory.java:41) at org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:494) at org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:419) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1041) at org.appfuse.webapp.filter.StaticFilter.doFilterInternal(StaticFilter.java:106) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:75) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1041) at com.opensymphony.module.sitemesh.filter.PageFilter.doFilter(PageFilter.java:39) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1041) at org.apache.struts2.dispatcher.ActionContextCleanUp.doFilter(ActionContextCleanUp.java:99) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1041) at org.tuckey.web.filters.urlrewrite.UrlRewriteFilter.doFilter(UrlRewriteFilter.java:350) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1041) at org.displaytag.filter.ResponseOverrideFilter.doFilter(ResponseOverrideFilter.java:125) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1041) at net.sf.ehcache.constructs.web.filter.GzipFilter.doFilter(GzipFilter.java:75) at net.sf.ehcache.constructs.web.filter.Filter.doFilter(Filter.java:92) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1041) at org.appfuse.webapp.filter.LocaleFilter.doFilterInternal(LocaleFilter.java:64) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:75) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1041) at com.opensymphony.clickstream.ClickstreamFilter.doFilter(ClickstreamFilter.java:42) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1041) at org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:198) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:75) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1041) at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:264) at org.acegisecurity.intercept.web.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:107) at org.acegisecurity.intercept.web.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:72) at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:274) at org.acegisecurity.ui.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:110) at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:274) at org.acegisecurity.providers.anonymous.AnonymousProcessingFilter.doFilter(AnonymousProcessingFilter.java:125) at
2.0.9 UnknownClassVersionError
I'm getting an UnknownClassVersion error during struts2.0.9 deployment to tomcat with java 1.5.0.0.3 Is struts 2.0.9 entirely compiled in java 6? James Hartrich
Re: struts2 ajax jsps
I know that discussion but it html extention locks some of the functionality of struts2, it would be better to change it from html to something else. If you say *it is not easy*, at least I will post a message on the appfuse forum. Ian Roughley wrote: I think there was a discussion from Matt about this (appfuse using html extensions) a while back, you might want to check the archives. On the s2 side, there are options, but I'm not sure there is an easy solution for using .html as an extension. /Ian Struts2 Fan wrote: Opps How can I make struts to ignore this and read them as html? Or do I have to change the extention to get it work. Thanks for the answer. Ian Roughley wrote: This line: There is no Action mapped for namespace /struts/dojo/src/widget/templates and action name TabContainer. Seems to suggest that you may have changed the extension from .action to .html, so s2 is looking for an action called TabContainer. /Ian Struts2 Fan wrote: I met the same error, too. I have just a simple jsp start of simple.jsp %@ include file=/common/taglibs.jsp % head s:head theme=ajax/s:head /head s:tabbedPanel id=test2 theme=simple cssStyle=width: 500px; height: 300px; doLayout=true s:div theme=ajax id=left label=left s:form s:textfield name=tt label=Test Text/ br/ s:textfield name=tt2 label=Test Text2/ /s:form /s:div s:div theme=ajax id=right label=right This is the right panebr/ /s:div /s:tabbedPanel end of simple.jsp Here it gives the following error start of error ERROR [btpool0-2] Dispatcher.serviceAction(512) | Could not find action or result There is no Action mapped for namespace /struts/dojo/src/widget/templates and action name TabContainer. - [unknown location] at com.opensymphony.xwork2.DefaultActionProxy.prepare(DefaultActionProxy.java:186) at org.apache.struts2.impl.StrutsActionProxyFactory.createActionProxy(StrutsActionProxyFactory.java:41) at org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:494) at org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:419) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1041) at org.appfuse.webapp.filter.StaticFilter.doFilterInternal(StaticFilter.java:106) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:75) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1041) at com.opensymphony.module.sitemesh.filter.PageFilter.doFilter(PageFilter.java:39) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1041) at org.apache.struts2.dispatcher.ActionContextCleanUp.doFilter(ActionContextCleanUp.java:99) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1041) at org.tuckey.web.filters.urlrewrite.UrlRewriteFilter.doFilter(UrlRewriteFilter.java:350) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1041) at org.displaytag.filter.ResponseOverrideFilter.doFilter(ResponseOverrideFilter.java:125) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1041) at net.sf.ehcache.constructs.web.filter.GzipFilter.doFilter(GzipFilter.java:75) at net.sf.ehcache.constructs.web.filter.Filter.doFilter(Filter.java:92) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1041) at org.appfuse.webapp.filter.LocaleFilter.doFilterInternal(LocaleFilter.java:64) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:75) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1041) at com.opensymphony.clickstream.ClickstreamFilter.doFilter(ClickstreamFilter.java:42) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1041) at org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:198) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:75) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1041) at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:264) at org.acegisecurity.intercept.web.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:107) at org.acegisecurity.intercept.web.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:72) at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:274) at org.acegisecurity.ui.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:110) at
Re: Trouble getting to portlet render phase
In my portletunit test, I am using a url of view/viewMyPortlet.action. In JBossPortal, I create a Portlet Instance from the Portlet Definition and then under the Portlet Objects tab assign it to a region in the page layout. Is there somewhere I would specify a URL? And what would it be? What URL would you suggest I specify in portletunit? That would be helpful as I am trying to use that as a test harness and avoid launching a container. Thank you!! Fred Nils-Helge Garli wrote: Are you creating the urls correctly using the s:url tag? Do you have an example JSP? How do you invoke your portlet application? Remember that you can't access the portlet using regular urls, they all have to go through the portlet container. Nils-H On 8/15/07, Frederick N. Brier [EMAIL PROTECTED] wrote: I am pretty sure this is a configuration issue, probably in struts.xml. I am trying to create a JSR168 compliant portlet. I have been working with the portletunit code to get it to execute in a unit test, as well as running it with JBossPortal. The behavior is the same, so I am hoping it is not an issue of the test harness introducing an issue. I debug/traced the execution. The Action is correctly constructed using the SpringFactory along with all properties. It is invoked and executes without error. It gets to DefaultActionInvocation having created a PortletResult, and calls result.execute(this). The lastFinalLocation is set to the location of the jsp specified in the struts.xml. PortletResult.doExecute() calls executeRegularServletResult(). Should I have been in render mode at this point and had executeRenderResult called instead? I have seen a number of posting saying best practice is to redirect to another action executing in render phase that then specifies the jsp as the result. Mine ends up calling PreparatorServlet.service and sets up the servlet request parameters into the ActionContext, and then ends, having never called the jsp. I also am not seeing where the Jsr168Dispatcher is ever invoked. It does not show up in the stack as I execute. I do not know if that is an issue. I have tried a number of combinations of XML including trying to redirect to a renderDirect.action which then redirects to the .jsp. Problem is that I have found no examples of using this action, and I have not stumbled on the answer. I have tried setting the result type to redirect... no joy. I am using Struts 2.0.9. If anyone could take a peek at my struts.xml and tell me what I am doing wrong, I would be eternally grateful. I do not understand how my code differs from the HelloWorld portlet examples that I started with. Thank you. Fred --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-portlet-default.xml / package name=basePortlet extends=struts-portlet-default interceptors interceptor-stack name=portletStack interceptor-ref name=basicStack/ interceptor-ref name=portlet-preferences / /interceptor-stack /interceptors default-interceptor-ref name=portletStack/ /package package name=view extends=basePortlet namespace=/view action name=index class=viewMyPortlet result name=success/WEB-INF/view/MyPortlet.jsp/result /action action name=viewMyPortlet class=viewMyPortlet result name=success/WEB-INF/view/MyPortlet.jsp/result /action action name=viewMyPortletSubcomponent1 class=viewMyPortlet result name=success/WEB-INF/view/MyPortletSubcomponent1.jsp/result /action /package package name=edit extends=basePortlet namespace=/edit action name=index class=com.opensymphony.xwork2.ActionSupport result name=success/WEB-INF/edit/index.jsp/result /action /package package name=help extends=basePortlet namespace=/help action name=index class=com.opensymphony.xwork2.ActionSupport result name=success/WEB-INF/help/index.jsp/result /action /package /struts --applicationContext.xml--- ... bean id=viewMyPortlet class=com.mycompany.MyPortletAction scope=prototype autowire=byName ... /bean ... --portlet.xml 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=struts-portlet portlet id=MySamplePortlet descriptionA Sample Portlet/description portlet-nameMySamplePortlet/portlet-name display-nameSample Portlet/display-name
Struts 1.X validwhen
Hi, I am using struts 1.3.8 for my application. For validation I am using validator framework. In one of my pages my form is submitted either by submit button or changing the dropdown list value. action is the name of the property in the corresponding actionform which stores the submit button's value for example if the submit button's value is Modify then action property value is Modify and action property value is null if I submit the page using change in the dropdown list value. I am using validwhen to check if the action property is Modify as shown below, form name=EditUserForm field property=firstName depends=validwhen var var-nametest/var-name var-value((action != Modify) or (*this* != null))/var-value /var arg key=ApplicantInfoDisplayActionForm.firstName/ /field /form My doubt is can I use two validations using the which will be called only when action != modify. like I want to check whether the email address is in right format so I used field property=emailAddress depends=validwhen,email and rest of the code as shown above but it is checking for email format even if action is not equal to Modify. By seeing the code it seems that validwhen it is taking different and email it is taking different. Then how can I use both. Can any one please help me whether I can use validwhen In this situation. If not validwhen how can I use the validator framework. -- Regards Viplav Kallepu -- Regards Viplav Kallepu
Re: struts2 ajax jsps
As it seems like you want to find a solution the option is to write an ActionMapper that reverses the order the URLs are currently determined. Instead of looking for an action first, you would need to look for a static resource first, and then if not found check for an action. /Ian Struts2 Fan wrote: I know that discussion but it html extention locks some of the functionality of struts2, it would be better to change it from html to something else. If you say *it is not easy*, at least I will post a message on the appfuse forum. Ian Roughley wrote: I think there was a discussion from Matt about this (appfuse using html extensions) a while back, you might want to check the archives. On the s2 side, there are options, but I'm not sure there is an easy solution for using .html as an extension. /Ian Struts2 Fan wrote: Opps How can I make struts to ignore this and read them as html? Or do I have to change the extention to get it work. Thanks for the answer. Ian Roughley wrote: This line: There is no Action mapped for namespace /struts/dojo/src/widget/templates and action name TabContainer. Seems to suggest that you may have changed the extension from .action to .html, so s2 is looking for an action called TabContainer. /Ian Struts2 Fan wrote: I met the same error, too. I have just a simple jsp start of simple.jsp %@ include file=/common/taglibs.jsp % head s:head theme=ajax/s:head /head s:tabbedPanel id=test2 theme=simple cssStyle=width: 500px; height: 300px; doLayout=true s:div theme=ajax id=left label=left s:form s:textfield name=tt label=Test Text/ br/ s:textfield name=tt2 label=Test Text2/ /s:form /s:div s:div theme=ajax id=right label=right This is the right panebr/ /s:div /s:tabbedPanel end of simple.jsp Here it gives the following error start of error ERROR [btpool0-2] Dispatcher.serviceAction(512) | Could not find action or result There is no Action mapped for namespace /struts/dojo/src/widget/templates and action name TabContainer. - [unknown location] at com.opensymphony.xwork2.DefaultActionProxy.prepare(DefaultActionProxy.java:186) at org.apache.struts2.impl.StrutsActionProxyFactory.createActionProxy(StrutsActionProxyFactory.java:41) at org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:494) at org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:419) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1041) at org.appfuse.webapp.filter.StaticFilter.doFilterInternal(StaticFilter.java:106) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:75) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1041) at com.opensymphony.module.sitemesh.filter.PageFilter.doFilter(PageFilter.java:39) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1041) at org.apache.struts2.dispatcher.ActionContextCleanUp.doFilter(ActionContextCleanUp.java:99) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1041) at org.tuckey.web.filters.urlrewrite.UrlRewriteFilter.doFilter(UrlRewriteFilter.java:350) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1041) at org.displaytag.filter.ResponseOverrideFilter.doFilter(ResponseOverrideFilter.java:125) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1041) at net.sf.ehcache.constructs.web.filter.GzipFilter.doFilter(GzipFilter.java:75) at net.sf.ehcache.constructs.web.filter.Filter.doFilter(Filter.java:92) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1041) at org.appfuse.webapp.filter.LocaleFilter.doFilterInternal(LocaleFilter.java:64) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:75) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1041) at com.opensymphony.clickstream.ClickstreamFilter.doFilter(ClickstreamFilter.java:42) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1041) at org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:198) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:75) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1041) at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:264) at
Re: Trouble getting to portlet render phase
So it doesn't work in neither JBoss nor your tests? Or is it just your test that is not working? Since executeRegularServletResult is executed, the only two reasons are: - The portletrequest and portletresponse objects are not available, which means you're running outside the container. - The urls used to access the portlet is incorrect. I'm not familiar with portletunit, but have you set up the request and response objects correctly? Maybe you have an example unit test you can show us? BTW: If you want to test your portlets visually without starting a heavy-weight container, take a look at my two blog articles regarding testing portlets with pluto and maven: http://portletwork.blogspot.com/2007/07/mvnjetty-and-portlets.html http://portletwork.blogspot.com/2007/08/maven-jetty-plugin-and-jsr168-portlets.html On 8/15/07, Frederick N. Brier [EMAIL PROTECTED] wrote: In my portletunit test, I am using a url of view/viewMyPortlet.action. In JBossPortal, I create a Portlet Instance from the Portlet Definition and then under the Portlet Objects tab assign it to a region in the page layout. Is there somewhere I would specify a URL? And what would it be? What URL would you suggest I specify in portletunit? That would be helpful as I am trying to use that as a test harness and avoid launching a container. Thank you!! Fred Nils-Helge Garli wrote: Are you creating the urls correctly using the s:url tag? Do you have an example JSP? How do you invoke your portlet application? Remember that you can't access the portlet using regular urls, they all have to go through the portlet container. Nils-H On 8/15/07, Frederick N. Brier [EMAIL PROTECTED] wrote: I am pretty sure this is a configuration issue, probably in struts.xml. I am trying to create a JSR168 compliant portlet. I have been working with the portletunit code to get it to execute in a unit test, as well as running it with JBossPortal. The behavior is the same, so I am hoping it is not an issue of the test harness introducing an issue. I debug/traced the execution. The Action is correctly constructed using the SpringFactory along with all properties. It is invoked and executes without error. It gets to DefaultActionInvocation having created a PortletResult, and calls result.execute(this). The lastFinalLocation is set to the location of the jsp specified in the struts.xml. PortletResult.doExecute() calls executeRegularServletResult(). Should I have been in render mode at this point and had executeRenderResult called instead? I have seen a number of posting saying best practice is to redirect to another action executing in render phase that then specifies the jsp as the result. Mine ends up calling PreparatorServlet.service and sets up the servlet request parameters into the ActionContext, and then ends, having never called the jsp. I also am not seeing where the Jsr168Dispatcher is ever invoked. It does not show up in the stack as I execute. I do not know if that is an issue. I have tried a number of combinations of XML including trying to redirect to a renderDirect.action which then redirects to the .jsp. Problem is that I have found no examples of using this action, and I have not stumbled on the answer. I have tried setting the result type to redirect... no joy. I am using Struts 2.0.9. If anyone could take a peek at my struts.xml and tell me what I am doing wrong, I would be eternally grateful. I do not understand how my code differs from the HelloWorld portlet examples that I started with. Thank you. Fred --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-portlet-default.xml / package name=basePortlet extends=struts-portlet-default interceptors interceptor-stack name=portletStack interceptor-ref name=basicStack/ interceptor-ref name=portlet-preferences / /interceptor-stack /interceptors default-interceptor-ref name=portletStack/ /package package name=view extends=basePortlet namespace=/view action name=index class=viewMyPortlet result name=success/WEB-INF/view/MyPortlet.jsp/result /action action name=viewMyPortlet class=viewMyPortlet result name=success/WEB-INF/view/MyPortlet.jsp/result /action action name=viewMyPortletSubcomponent1 class=viewMyPortlet result name=success/WEB-INF/view/MyPortletSubcomponent1.jsp/result /action /package package name=edit extends=basePortlet namespace=/edit action name=index class=com.opensymphony.xwork2.ActionSupport result name=success/WEB-INF/edit/index.jsp/result
Struts2 Annotation Based Validation
I'm a Struts newb and am trying to get up to speed on Struts 2. The scant documentation is throwing me a bit; I'm trying to do everything annotation-based, and for Validation, it seems to be simply not working at all. Per the docs, I have tagged my action class with @Validator and tagged my setXXX method with @RequiredFieldValidator. My form's JSP contains s:fielderrors:paramXXX/s:param/s:fielderror. When I submit the form with no value for XXX, my execute method executes as it would before I added the validation stuff. I would really like to avoid XML files, but it seems that if I'm using annotations, everything needs to be done that way. Any ideas on where to look? Dave I've read: http://struts.apache.org/2.x/docs/validation-annotation.html and some other resources, none of which are clear to me. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Doubled requests in TabbedPane
Hi Ah, thanks very much. Thats exactly what i need. :-) -- Sebastian Jeromy Evans schrieb: In response to your second question: Sebastian Kolbe wrote: Another question: Is there an easy way to catch the event (something like 'onclick') when a different tab is selected? Yes : a. at page init time, lookup the id of each tab widget b. connect a handler before the show event generated by the widget The following javascript will call the handle1 or handle2 function when tab1 or tab2 is selected respectively. function handler1(evt) { // do something } function handler2(evt) { // do something } function init() { var tab1Widget = dojo.widget.byId(tab1); var tab2Widget = dojo.widget.byId(tab2); dojo.event.connect(before, tab1Widget, show, handler1); dojo.event.connect(before, tab2Widget, show, handler2); } dojo.addOnLoad( init ); - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
S2: OGNL beats me
Hi, I have a bean in request scope which has a List property. I cannot iterate over it or read it at all. Among the lines below only the first works. Could somebody please explain why? ${req.css[0]} s:property value=req.css[0]/ s:property value=#req.css[0]/ s:property value=%{req.css[0]}/ s:property value=%{#req.css[0]}/ Thanks, kuvera - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: S2: OGNL beats me
try : s:property value=%{#request.css[0]}/ musachy On 8/15/07, Twins fan [EMAIL PROTECTED] wrote: Hi, I have a bean in request scope which has a List property. I cannot iterate over it or read it at all. Among the lines below only the first works. Could somebody please explain why? ${req.css[0]} s:property value=req.css[0]/ s:property value=#req.css[0]/ s:property value=%{req.css[0]}/ s:property value=%{#req.css[0]}/ Thanks, kuvera - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Hey you! Would you help me to carry the stone? Pink Floyd - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: S2: OGNL beats me
Thanks for both of you. s:property value=#request.req.css[0]/ Only this one works for struts tags, but I still don't fully understand the notion of the value stack. It is supposed to give access to properties of all scopes, isn't it? Standard EL is not so complicated. kuvera Musachy Barroso írta: try : s:property value=%{#request.css[0]}/ musachy - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Forward to different JSPs
Jasper Floor wrote: On 8/15/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Hi, action path=/secure/dataChecks name=emptyForm type=org.springframework.web.struts.DelegatingActionProxy input=/secure/dataChecks.jsp / So here it is only possible to return to the given input JSP dataChecks.jsp. How can I return to the calling JSP without defining one action tag for every single JSP? If you don't close your actionmapping right away you can put forward tags in which you can define diffrent places to go. action ... forward.../ /action In your action class you can look for request params to decde which way to go. http://struts.apache.org/1.3.8/userGuide/building_controller.html#config for more info. Also note that you don't need to define 'input' for every action. It is only used if the action is accepting and validating a form submit, and the validation fails. So, you will need a separate action mapping for form submission you want to handle with a different input page but should be able to remove input from your other action mappings. L. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Struts2 Annotation Based Validation
David Copeland wrote: I'm a Struts newb and am trying to get up to speed on Struts 2. The scant documentation is throwing me a bit; I'm trying to do everything annotation-based, and for Validation, it seems to be simply not working at all. Per the docs, I have tagged my action class with @Validator and tagged my setXXX method with @RequiredFieldValidator. My form's JSP contains s:fielderrors:paramXXX/s:param/s:fielderror. When I submit the form with no value for XXX, my execute method executes as it would before I added the validation stuff. I would really like to avoid XML files, but it seems that if I'm using annotations, everything needs to be done that way. I'm not sure what that last paragraph means; you can certainly use XML validation for one action and annotations in another. I'm not sure to what extent it's possible to mix XML and annotation based validation in the *same* action, but there's certainly no requirement to pick one or the other for the application as a whole. It may help if you post the relevant parts of your config, JSP and action code. There are several 'moving parts' involved in making validation work, and it's hard to guess where the problem is without seeing what you have done. L. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Struts 1.X validwhen
Viplav Kallepu wrote: Hi, I am using struts 1.3.8 for my application. For validation I am using validator framework. In one of my pages my form is submitted either by submit button or changing the dropdown list value. action is the name of the property in the corresponding actionform which stores the submit button's value for example if the submit button's value is Modify then action property value is Modify and action property value is null if I submit the page using change in the dropdown list value. I am using validwhen to check if the action property is Modify as shown below, form name=EditUserForm field property=firstName depends=validwhen var var-nametest/var-name var-value((action != Modify) or (*this* != null))/var-value /var arg key=ApplicantInfoDisplayActionForm.firstName/ /field /form My doubt is can I use two validations using the which will be called only when action != modify. like I want to check whether the email address is in right format so I used field property=emailAddress depends=validwhen,email and rest of the code as shown above but it is checking for email format even if action is not equal to Modify. By seeing the code it seems that validwhen it is taking different and email it is taking different. Then how can I use both. Can any one please help me whether I can use validwhen In this situation. If not validwhen how can I use the validator framework. I could be wrong, but I don't think what you want to do is supported. If I understood you correctly, you want to be able to specify multiple validations (in this case, 'validwhen' and 'email') and only apply the second rule if the first one *fails*. The opposite is possible (as soon as one validation rule fails, stop processing subsequent ones), but not the behaviour you're looking for. You will probably need to write a custom validator to accomplish your goal. It might be possible to extend the validation framework to support both semantics for 'depends' processing, though, in which case you might consider contributing a patch for that as this would probably be useful for others too. L. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Using the Restful2ActionMapper
I'm trying to change from using the old-style URLs to Restful2ActionMapper. Here's what I've added to struts.xml: bean name=struts2 type=org.apache.struts2.dispatcher.mapper.ActionMapper class=org.apache.struts2.dispatcher.mapper.CompositeActionMapper/ constant name=struts.mapper.composite value=org.apache.struts2.dispatcher.mapper.DefaultActionMapper,org.apache.struts2.dispatcher.mapper.Restful2ActionMapper/ I have a UserAction that does CRUD (below). And the following action definitions: !-- List of Users -- action name=users class=userAction method=list result name=successuserList.jsp/result result name=inputuserList.jsp/result /action !-- Edit User -- action name=editUser class=userAction method=edit result name=successuserForm.jsp/result result name=inputuserList.jsp/result /action !-- Save User -- action name=saveUser class=userAction result name=cancel type=redirectusers.html/result result name=delete type=redirectusers.html/result result name=inputuserForm.jsp/result result name=success type=chainsaveUserWithValidation/result /action action name=saveUserWithValidation class=userAction method=save result name=inputuserForm.jsp/result result name=success type=redirectusers.html/result /action Is it possible to change to something like the following? action name=user/* className=userAction {0} ... /action If so, I'm guessing I need to change some method names (i.e. the default method for /user would be index, so I should change list() to index()) and some result names (edit goes to edit, save goes to save, index goes to success)? Thanks, Matt Philip Lorenz-2 wrote: Tomorrow's task for me is trying RESTful, so hopefully you'll figure this out ;) Do you need the .action in the URL?! d. You can remove the action postfix by setting struts.action.extension to an empty string. I just left it enabled to have a clean default config with only the neccesary settings changed. Philip - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/Using-the-Restful2ActionMapper-tf3173361.html#a12171692 Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Struts2 Annotation Based Validation
I think annotations give you more flexibility than XML . ex : if an Action has multiple methods and only certain fields are tied to each method, we can bunch together validations for each method using annotations, but this is not possible using XML On 8/15/07, Laurie Harper [EMAIL PROTECTED] wrote: David Copeland wrote: I'm a Struts newb and am trying to get up to speed on Struts 2. The scant documentation is throwing me a bit; I'm trying to do everything annotation-based, and for Validation, it seems to be simply not working at all. Per the docs, I have tagged my action class with @Validator and tagged my setXXX method with @RequiredFieldValidator. My form's JSP contains s:fielderrors:paramXXX/s:param/s:fielderror. When I submit the form with no value for XXX, my execute method executes as it would before I added the validation stuff. I would really like to avoid XML files, but it seems that if I'm using annotations, everything needs to be done that way. I'm not sure what that last paragraph means; you can certainly use XML validation for one action and annotations in another. I'm not sure to what extent it's possible to mix XML and annotation based validation in the *same* action, but there's certainly no requirement to pick one or the other for the application as a whole. It may help if you post the relevant parts of your config, JSP and action code. There are several 'moving parts' involved in making validation work, and it's hard to guess where the problem is without seeing what you have done. L. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Struts2 Annotation Based Validation
--- j alex [EMAIL PROTECTED] wrote: ex : if an Action has multiple methods and only certain fields are tied to each method, we can bunch together validations for each method using annotations, but this is not possible using XML You can create validation XML files on an action-alias basis. d. Got a little couch potato? Check out fun summer activities for kids. http://search.yahoo.com/search?fr=oni_on_mailp=summer+activities+for+kidscs=bz - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
How to make initialize with struts2 action?
For general Java class,we can make construction function,like this: public class test{ String a; public test(String a){ this.a=a; } } I don't know if I can do it like above code under struts2 action,for some reason,I want to initialize some variable and assign some value to it,like follows: public class MyClass extends ActionSupport{ private ; public MyClass(SomeType s){ //make some common operaction,such get session and so on,because I want to run them only once } public String execute() throws Exception { } public String .{ } ... } I can successly compile above code,but when I run above code,it will say error: 1)MyClass action error 2)java.lang.NullException because some code in MyClass(SomeType s) When I remove the code in the MyClass(SomeType s) into execute() function,it can run well. I am puzzle with it! Anybody could tell me how to do it? An example is better. Thanks, phoenix
Re: How to make initialize with struts2 action?
Does anybody know how to configure struts on eclipse and build anew project by struts in eclipse ? On 8/16/07, red phoenix [EMAIL PROTECTED] wrote: For general Java class,we can make construction function,like this: public class test{ String a; public test(String a){ this.a=a; } } I don't know if I can do it like above code under struts2 action,for some reason,I want to initialize some variable and assign some value to it,like follows: public class MyClass extends ActionSupport{ private ; public MyClass(SomeType s){ //make some common operaction,such get session and so on,because I want to run them only once } public String execute() throws Exception { } public String .{ } ... } I can successly compile above code,but when I run above code,it will say error: 1)MyClass action error 2)java.lang.NullException because some code in MyClass(SomeType s) When I remove the code in the MyClass(SomeType s) into execute() function,it can run well. I am puzzle with it! Anybody could tell me how to do it? An example is better. Thanks, phoenix -- Appreciated much, Meisam Sarabadani IBM Student Ambassador Vice president II, IT Society Multimedia University, Cyberjaya Capmus -- The day the Lord created hope was probably the same day he created Spring. Bern Williams. --
Re: tiles DTD
If your code is going otu to the Internet to find the DTD, that means the DTD cannot be found locally. Depending on the type of Servlet API (= 2.2), you would have to put the DTD directly in the WEB-INF directly and reference a URI to that location. Otherwise, API = 2.3 will be able to find it directly from your WEB-INF/lib directory. Check your web.xml to see what version you're using. Paul Stephen Souness wrote: Hi guys, I'm pretty sure this will have been asked before, but a bit of Googling hasn't produced a satisfactory answer. I'm using Struts 1.2.8 with tiles on Tomcat 5.5 Whenever I re-deploy my site some code goes off to look for the tiles DTD file (as specified at the top of tiles-definitions.xml). When the website that hosts that DTD is unavailable (such as right now) the application fails to make the Struts action servlet available. How can I remove this external dependency? -- Stephen Souness - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How to make initialize with struts2 action?
You can refer to the Struts doc. The easiest way is to use the struts2-blank-2.0.9.war as a start. you can find it from the http://struts.apache.org You'd better download a struts-2.x.all.zip from the download pages. Hope that helps,good luck. 2007/8/16, meisam sarabadani [EMAIL PROTECTED]: Does anybody know how to configure struts on eclipse and build anew project by struts in eclipse ? On 8/16/07, red phoenix [EMAIL PROTECTED] wrote: For general Java class,we can make construction function,like this: public class test{ String a; public test(String a){ this.a=a; } } I don't know if I can do it like above code under struts2 action,for some reason,I want to initialize some variable and assign some value to it,like follows: public class MyClass extends ActionSupport{ private ; public MyClass(SomeType s){ //make some common operaction,such get session and so on,because I want to run them only once } public String execute() throws Exception { } public String .{ } ... } I can successly compile above code,but when I run above code,it will say error: 1)MyClass action error 2)java.lang.NullException because some code in MyClass(SomeType s) When I remove the code in the MyClass(SomeType s) into execute() function,it can run well. I am puzzle with it! Anybody could tell me how to do it? An example is better. Thanks, phoenix -- Appreciated much, Meisam Sarabadani IBM Student Ambassador Vice president II, IT Society Multimedia University, Cyberjaya Capmus -- The day the Lord created hope was probably the same day he created Spring. Bern Williams. --
Re: How to make initialize with struts2 action?
hey thanks for your help but the thing is that it does not work like that in eclipse, yeah I have downloaded the full pack of struts and the all exampels, and also i have deployed it manually by putting it into my container (tomcat), but when im going to use the eclipse as IDE to develop and start a struts everything messes and I can`t continue, actually it is not working, I have seen so many tutorials but none of is 100% sure about what they are saying, can you help me with this ? On 8/16/07, Andvar Woo [EMAIL PROTECTED] wrote: You can refer to the Struts doc. The easiest way is to use the struts2-blank-2.0.9.war as a start. you can find it from the http://struts.apache.org You'd better download a struts-2.x.all.zip from the download pages. Hope that helps,good luck. 2007/8/16, meisam sarabadani [EMAIL PROTECTED]: Does anybody know how to configure struts on eclipse and build anew project by struts in eclipse ? On 8/16/07, red phoenix [EMAIL PROTECTED] wrote: For general Java class,we can make construction function,like this: public class test{ String a; public test(String a){ this.a=a; } } I don't know if I can do it like above code under struts2 action,for some reason,I want to initialize some variable and assign some value to it,like follows: public class MyClass extends ActionSupport{ private ; public MyClass(SomeType s){ //make some common operaction,such get session and so on,because I want to run them only once } public String execute() throws Exception { } public String .{ } ... } I can successly compile above code,but when I run above code,it will say error: 1)MyClass action error 2)java.lang.NullException because some code in MyClass(SomeType s) When I remove the code in the MyClass(SomeType s) into execute() function,it can run well. I am puzzle with it! Anybody could tell me how to do it? An example is better. Thanks, phoenix -- Appreciated much, Meisam Sarabadani IBM Student Ambassador Vice president II, IT Society Multimedia University, Cyberjaya Capmus -- The day the Lord created hope was probably the same day he created Spring. Bern Williams. -- -- Appreciated much, Meisam Sarabadani IBM Student Ambassador Vice president II, IT Society Multimedia University, Cyberjaya Capmus -- The day the Lord created hope was probably the same day he created Spring. Bern Williams. --
Serious need
I have downloaded the full pack of struts and the all exampels, and also i have deployed it manually by putting it into my container (tomcat), but when im going to use the eclipse as IDE to develop and start a struts everything messes and I can`t continue, actually it is not working, I have seen so many tutorials but none of is 100% sure about what they are saying, can you help me with this ? On 8/16/07, meisam sarabadani [EMAIL PROTECTED] wrote: hey thanks for your help but the thing is that it does not work like that in eclipse, yeah I have downloaded the full pack of struts and the all exampels, and also i have deployed it manually by putting it into my container (tomcat), but when im going to use the eclipse as IDE to develop and start a struts everything messes and I can`t continue, actually it is not working, I have seen so many tutorials but none of is 100% sure about what they are saying, can you help me with this ? On 8/16/07, Andvar Woo [EMAIL PROTECTED] wrote: You can refer to the Struts doc. The easiest way is to use the struts2-blank-2.0.9.war as a start. you can find it from the http://struts.apache.org You'd better download a struts-2.x.all.zip from the download pages. Hope that helps,good luck. 2007/8/16, meisam sarabadani [EMAIL PROTECTED]: Does anybody know how to configure struts on eclipse and build anew project by struts in eclipse ? On 8/16/07, red phoenix [EMAIL PROTECTED] wrote: For general Java class,we can make construction function,like this: public class test{ String a; public test(String a){ this.a=a; } } I don't know if I can do it like above code under struts2 action,for some reason,I want to initialize some variable and assign some value to it,like follows: public class MyClass extends ActionSupport{ private ; public MyClass(SomeType s){ //make some common operaction,such get session and so on,because I want to run them only once } public String execute() throws Exception { } public String .{ } ... } I can successly compile above code,but when I run above code,it will say error: 1)MyClass action error 2)java.lang.NullException because some code in MyClass(SomeType s) When I remove the code in the MyClass(SomeType s) into execute() function,it can run well. I am puzzle with it! Anybody could tell me how to do it? An example is better. Thanks, phoenix -- Appreciated much, Meisam Sarabadani IBM Student Ambassador Vice president II, IT Society Multimedia University, Cyberjaya Capmus -- The day the Lord created hope was probably the same day he created Spring. Bern Williams. -- -- Appreciated much, Meisam Sarabadani IBM Student Ambassador Vice president II, IT Society Multimedia University, Cyberjaya Capmus -- The day the Lord created hope was probably the same day he created Spring. Bern Williams. -- -- Appreciated much, Meisam Sarabadani IBM Student Ambassador Vice president II, IT Society Multimedia University, Cyberjaya Capmus -- The day the Lord created hope was probably the same day he created Spring. Bern Williams. --
Re: How to make initialize with struts2 action?
Hey,red.In my opinion, to use struts, you have to supply a no-argument constructor.That is the point. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: tiles DTD
The post at: http://article.gmane.org/gmane.comp.jakarta.struts.user/78202/ seems to go into a bit more detail about this issue. Is it possible that the version of Struts that I am using doesn't have the correct location(s) set up for pointing at the internal resources referred to in that post? Working day is over in my timezone, but I'll look into it further tomorrow. -- Stephen Paul Benedict wrote: If your code is going otu to the Internet to find the DTD, that means the DTD cannot be found locally. Depending on the type of Servlet API (= 2.2), you would have to put the DTD directly in the WEB-INF directly and reference a URI to that location. Otherwise, API = 2.3 will be able to find it directly from your WEB-INF/lib directory. Check your web.xml to see what version you're using. Paul Stephen Souness wrote: Hi guys, I'm pretty sure this will have been asked before, but a bit of Googling hasn't produced a satisfactory answer. I'm using Struts 1.2.8 with tiles on Tomcat 5.5 Whenever I re-deploy my site some code goes off to look for the tiles DTD file (as specified at the top of tiles-definitions.xml). When the website that hosts that DTD is unavailable (such as right now) the application fails to make the Struts action servlet available. How can I remove this external dependency? -- Stephen Souness - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How to make initialize with struts2 action?
If I use no-argument constructor,how can i do to initialize some information? Thanks On 8/16/07, Rec Floyd [EMAIL PROTECTED] wrote: Hey,red.In my opinion, to use struts, you have to supply a no-argument constructor.That is the point. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[S2] Type Validation Error Message
When there is an integer type and the user writes non string value, an error message is displayed automaticly. Invalid field value for field xxx.yyy I want to make this message localized. I posted a message before. But I don't want to write bundles for all the integer, double and date fields in the application. I just want to make it Turkish. The question is is there a place to make the message Turkish or any other language. Rene Gielen wrote: To provide your own conversion error message for a specific field, you will have to provide a resource message following the naming convention invalid.fieldvalue.yourpropertyname This should override the default message. - Rene Here I have to write a whole bunch of messages. But it is a general error message, so it should be changed by just adding the Turkish translation of the default message. But I couldn't manage where to add. I even couldn't find where does the message Invalid field value for field stand in the struts2. http://www.nabble.com/-S2--How-to-change-%22Invalid-field-value-for-field%22-message-in-tr-tf3688720.html#a10312377 I hope It is understandable. Thanks in advance. -- View this message in context: http://www.nabble.com/-S2--Type-Validation-Error-Message-tf4277669.html#a12175727 Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]