Struts3
hi all we know we hae Struts2 with REST, JSON Plugins, and JAX RS etc any idea about the Struts3, will we have S3 is look like ESB server, which S3 plugins look like mule? or what is the future of Struts? -- Frans Thamura Meruvian. Experiential Tempation of Java and Enterprise OpenSource Meruvian jTechnopreneur Program (S1) telah hadir, Dapatkan benefit bagi SMK yang melakukan mapping SKKD, dg program beasiswa dari Gunadarma Mobile: +6287885901958 Blog & Profile: http://frans.thamura.info We provide services to migrate your apps to Java (web), in amazing fast and reliable. - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Displaying maps with JSON plugin
I'm using Struts-2.1.8.1's JSON plugin to try and display the field errors that are accrued by the validation interceptor. What I've got is this: Java snippet from the action: public Map getAllErrors() { return getFieldErrors(); } public String getNewEmail() { return this.newEmail; } The result type snippet is this: allErrors This is the result I get when I fire a blank email address (the validator is requiredstring): {"allErrors":{}} Now, when I change the result type snippet to this: newEmail I get this result: {"allErrors":{"newEmail":["No email address submitted"]}} I'm confused by this. Any help is appreciated =) - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
RE: Struts2+Spring2+Interceptor+Invalid action class configuration that references an unknown class named
Devendra did you contact the local struts resource as suggested..? Martin-- __ Verzicht und Vertraulichkeitanmerkung Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen. > Date: Fri, 21 May 2010 19:53:42 -0700 > From: devendra_tiwari12...@yahoo.com > To: user@struts.apache.org > Subject: Re: Struts2+Spring2+Interceptor+Invalid action class configuration > that references an unknown class named > > > > > > > > Hantsy Bai-2 wrote: > >> > >> δΊ 2010/5/22 1:05, rocks ει: > >>> Dear, > >>> > >>> Apologize the posting same subject, but I did not find any solution so > >>> far. > >>> I am developing a web application based on struts 2.1.8.1+ spring 2+ > >>> hibernate 3 + tomcat 5.5. There is requisite library like > >>> struts2-convention-plugin-2.1.8.1.jar in my classpath. > >>> > >>> For authentication I am using struts interceptor. > >>> Below are my configuration files. > >>> > >>> struts.xml := > >>> > >>> > >>> >>> "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN" > >>> "http://struts.apache.org/dtds/struts-2.0.dtd";> > >>> > >>> > >>> > >>> > >>> > >>> > >>> >>> value="AUTOWIRE_BY_NAME"/> > >>> > >>> > >>> > >>> > >>> > >>> >>> class="org.apache.struts2.views.tiles.TilesResult" /> > >>> > >>> > >>> > >>> >>> class="com.ncr.framework.interceptor.LoginInterceptor"/> > >>> > >>> > >>> > >>> > >>> > >>> > >>> > >>> > >>> > >>> > >>> > >>> page.Login > >>> > >>> > >>> > >>> > >>> applicationContext.xml :- > >>> > >>> > >>> > >>> > >>> >>> class="com.ncr.user.actions.LoginAction"> > >>> > >>> > >>> > >>> > >>> LoginInterceptor.java > >>> > >>> public class LoginInterceptor extends AbstractInterceptor { > >>> public String intercept(ActionInvocation invocation) throws Exception { > >>> ActionContext context = invocation.getInvocationContext(); > >>> Map contextMap = context.getContextMap(); > >>> HttpServletRequestWrapper request = (HttpServletRequestWrapper) > >>> contextMap > >>> .get(HTTP_REQUEST); > >>> synchronized (request) { > >>> ThreadContext.setRequest(request); > >>> UserInfo userInfo = UserContext.getCurrentUserInfo(); > >>> > >>> if (userInfo == null > >>> && !"authenticate".equals(contextMap.get(ACTION_NAME))) { > >>> return "logon"; > >>> } > >>> return invocation.invoke(); > >>> } > >>> }} > >>> > >>> When I hit url http://localhost:8080/mytest/logon.do it throws an error. > >>> > >>> java.lang.RuntimeException: Invalid action class configuration that > >>> references an unknown class named [loginAction] > >>> > >>> org.apache.struts2.convention.ConventionsServiceImpl.determineResultPath(ConventionsServiceImpl.java:100) > >>> > >>> org.apache.struts2.convention.ConventionUnknownHandler.determinePath(ConventionUnknownHandler.java:385) > >>> > >>> org.apache.struts2.convention.ConventionUnknownHandler.handleUnknownResult(ConventionUnknownHandler.java:274) > >>> > >>> com.opensymphony.xwork2.DefaultUnknownHandlerManager.handleUnknownResult(DefaultUnknownHandlerManager.java:76) > >>> > >>> com.opensymphony.xwork2.DefaultActionInvocation.createResult(DefaultActionInvocation.java:215) > >>> > >>> com.opensymphony.xwork2.DefaultActionInvocation.executeResult(DefaultActionInvocation.java:356) > >>> > >>> com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:266) > >>> > >>> com.opensymphony.xwork2.interceptor.DefaultWorkflowInterceptor.doIntercept(DefaultWorkflowInterceptor.java:165) > >>> > >>> > >>> As per my investigation, I found that ClassLoaderUtils's below method > >>> could > >>> not return class name for 'loginAction'. There should be some way for to > >>> map > >>> 'loginAction' to the class com.ncr.user.actions.LoginAction. > >>> > >>> public static Class loadClass(String className, Class callingClass) > >>> throws ClassNotFoundException { > >>> try { > >>> > >>> return Thread.currentThread().getContextClassLoader().loadClass( > >>> className); > >>> } catch (ClassNotFoundException e) { > >>> try { > >>> return Class.forName(className); > >>> } catch (ClassNotFoundException ex) { > >>> try { > >>> return ClassLoaderUtils.class.getClassLoader().loadClass( > >>> className); > >>> } catch (ClassNotFoundException exc) { > >>> return callingClass.getClassLoader().loadClass(className); > >>> } > >>> } > >>> } > >>> } > >>> > >>> When I remove the entry ' >>> name="capabilityStack"/>' > >>> from struts.xml then it's working perfectly fine i.e desired page is > >>> coming. > >>> > >>> I also noticed that in the classes variable of > >>> Thread.currentThread().getContextClassLoader()(WebappClassLo