Re: newbie question: How can I make a Struts Project with multiple modules?
Version of Struts? 2008/8/4 ryan webb [EMAIL PROTECTED]: How can I make a Struts Project with multiple modules? -- warmest regards, Ryan Webb - Philippines email: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Action Execute Being called 2 times
Hi, I tried all things and its again not working still action is getting called 2 times for each call to this Register Action i am attaching the Register.jsp,Struts.xml as well as the action class please have a look at it and point me where i am doing the mistake. Thanks in Advance -aum On Fri, Aug 1, 2008 at 5:37 PM, Joachim Ansorg [EMAIL PROTECTED] wrote: Hi, you use the same action to render the welcome screen and Registrer.jsp. So this means that when you display the welcome screen execute() is called and when you display the Registrer.jsp page. Either use two separate actions or just return null in execute and have another action method (i.e. save()) which writes into the db. In the page with the submit button link to the action's save method. So execute is used for welcome and save for the registration. Hope that helps, Joachim Hi All, While developing an application in struts2 i am facing a strange problem with one of my action namely RegsitrationAction. i have a jsp page for user registration where there are certain fields for the user to be filled for the registration purpose. i have created a UserProfile bean class with the bean properties for all the user registration field. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] package actionsfolder; import com.opensymphony.xwork2.ActionSupport; public class UserRegistrationAction extends ActionSupport{ /** * */ private static final long serialVersionUID = -4632666801257988218L; private String username=null; private String password=null; private String email=null; /** * @return the username */ public String getUsername() { return username; } /** * @param username the username to set */ public void setUsername(String username) { this.username = username; } /** * @return the password */ public String getPassword() { return password; } /** * @param password the password to set */ public void setPassword(String password) { this.password = password; } /** * @return the email */ public String getEmail() { return email; } /** * @param email the email to set */ public void setEmail(String email) { this.email = email; } public String execute() throws Exception{ System.out.println(**in Action***); return SUCCESS; } } !DOCTYPE struts PUBLIC -//Apache Software Foundation//DTD Struts Configuration 2.0//EN http://struts.apache.org/dtds/struts-2.0.dtd; struts package name=actionsfolder extends=struts-default action name=Login class=actionsfolder.LoginAuthenticationAction result name=success/welcome/welcome.jsp/result result name=input/index.jsp/result /action action name=Logout class=actionsfolder.LogoutAction result name=success/welcome/welcome.jsp/result /action action name=ReLogin result/index.jsp/result /action action name=RegisterNewUser class=actionsfolder.UserRegistrationAction result name=success/index.jsp/result /action action name=Registration result/registration/Registrer.jsp/result /action /package /struts - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: newbie question: How can I make a Struts Project with multiple modules?
Struts Version = 1.2.9 So creating a multiple module depends on struts version? On 8/4/08, Antonio Petrelli [EMAIL PROTECTED] wrote: Version of Struts? 2008/8/4 ryan webb [EMAIL PROTECTED]: How can I make a Struts Project with multiple modules? -- warmest regards, Ryan Webb - Philippines email: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- warmest regards, Ryan Webb - Philippines email: [EMAIL PROTECTED]
Re: newbie question: How can I make a Struts Project with multiple modules?
2008/8/4 ryan webb [EMAIL PROTECTED]: Struts Version = 1.2.9 So creating a multiple module depends on struts version? Surely it depends on being a Struts 1 project or a Struts 2 one. In fact I think that the concept of module is not used inside Struts 2, but I wanted to be sure that you were using Struts 1. Anyway here is the link: http://struts.apache.org/1.2.9/userGuide/configuration.html#dd_config_modules Ciao Antonio - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Issue with Url mapping with struts-action-extension=
Haulyn R. Jason wrote: Hi,all I set struts-action-extension= for no extension as action or do by default for struts2, and mapping all url to struts2 dispatcher as /*. But, the problem is I can not access any jsp, html,css and js files. The page display:there are no action mapping for XXX.jsp action. Should any one give me some suggestions or referenced links? Always thanks very much. I'm not sure if your setting is interpreted as blank, not set (default) or null. Did your jsp, html, css and js work before you made that change? The process works like this: 1. the container sees the request and maps it to the Strust2 FilterDispatcher because it matches /* 2. the FilterDispatcher checks whether the request contains a known action extension, and if so, invokes the ActionMapper 3. If the ActionMapper didn't find anything, the FilterDispatcher checks if there's struts static resource for the request (if serve.static.resource=true) 4. If nothing matched, the filter does nothing 5. If nothing has processed the request, the container eventually invokes the Default Servlet (and JSP handling, other file handling) So there's two possible problems: a. the FilterDispatcher thinks it can handle everything and tries to, causing an error; or b. there is a configuration problem with the container (eg. the default servlet is disabled or the request never reached the container). In case it is a, I would try the following settings: struts.action.extension=,,action Note the double comma. That means a blank (no extension), or .action extension. The double-comma ensures blank isn't trimmed as whitespace. Hope that helps, Jeromy Evans - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Inconsistent HTML escaping in textfield
I'm using struts2.0.11.1 with Velocity. In my #stextfield tags I'm trying to use eacute; in the label and the tooltip. It gets transformed in amp;eacute; in the resulting web page. If I use the original é it doesn't work either and display an inconsistent character, and this with UTF-8 encoding as well as iso-8859-1. Besides I'm having big formating problem using labelposition=left for a serie of input items. They are too close to each others and the resulting input boxes height is too small. It seems there's no hook to modify class=wwgrp. My solution is to add br in between #stextfield tags, but Id ont' think it's so nice. Did anyone faced and solved that issue? cheers -- View this message in context: http://www.nabble.com/Inconsistent-HTML-escaping-in-textfield-tp18808077p18808077.html 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: Issue with Url mapping with struts-action-extension=
Jeromy Evans 写道: Haulyn R. Jason wrote: Hi,all I set struts-action-extension= for no extension as action or do by default for struts2, and mapping all url to struts2 dispatcher as /*. But, the problem is I can not access any jsp, html,css and js files. The page display:there are no action mapping for XXX.jsp action. Should any one give me some suggestions or referenced links? Always thanks very much. I'm not sure if your setting is interpreted as blank, not set (default) or null. Did your jsp, html, css and js work before you made that change? The process works like this: 1. the container sees the request and maps it to the Strust2 FilterDispatcher because it matches /* 2. the FilterDispatcher checks whether the request contains a known action extension, and if so, invokes the ActionMapper 3. If the ActionMapper didn't find anything, the FilterDispatcher checks if there's struts static resource for the request (if serve.static.resource=true) 4. If nothing matched, the filter does nothing 5. If nothing has processed the request, the container eventually invokes the Default Servlet (and JSP handling, other file handling) So there's two possible problems: a. the FilterDispatcher thinks it can handle everything and tries to, causing an error; or b. there is a configuration problem with the container (eg. the default servlet is disabled or the request never reached the container). In case it is a, I would try the following settings: struts.action.extension=,,action Note the double comma. That means a blank (no extension), or .action extension. The double-comma ensures blank isn't trimmed as whitespace. Hope that helps, Jeromy Evans - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] Hi, Evans Thanks for your answer, it looks very useful but some new problem occurred: When I set struts.action.extension= value as with no space or (same as before with one whitespace) Struts treat all html, js, css and jsp as action, but all real actions work well. Without struts 2 FilterDispatcher, everything works well.(Certainly real action can not work) Then I tried your solution as: struts.action.extension=,,action but modified as struts.action.extension=,,jsps ok, this time, when I visit http://localhost:8080/8f/myAction.jsps, everything works well,but I can not access to http://localhost:8080/8f/myAction without any extension. And something interesting occurred: I can access http://localhost:8080/8f/myAction.; and everything works well. I mean, I can not visit myAction with no extension but I can visit myAction with extension:., just a . I am not sure what's wrong with my configuration. And I use struts2.0.11.1. -- Thanks! Mobile: +086-15864011231 EMailgtalk:[EMAIL PROTECTED] EMailyahoo:[EMAIL PROTECTED] Skype:saharabear Haulyn Runner Jason - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
separating getter and setter from action class
Hi there, is it possible to separate getter and setter from ActionClass ? so that my action class will only contain logic related to action and BO class with all the getter and setter. Regards, Dhiraj
Re: separating getter and setter from action class
Hi, try to add getMyBussinessObject() in ActionClass and on Your jsp s:property value=myBussinessObject.someBussinesProperty/. Still, You need myBussinessObject field in ActionClass. Best greetings, Paweł Wielgus. On 04/08/2008, Dhiraj Thakur [EMAIL PROTECTED] wrote: Hi there, is it possible to separate getter and setter from ActionClass ? so that my action class will only contain logic related to action and BO class with all the getter and setter. Regards, Dhiraj
Re: Action Execute Being called 2 times
can't see the jsp file. In the action class you are not using modeldriven as you said in the first email. 2008/8/4 aum strut [EMAIL PROTECTED]: Hi, I tried all things and its again not working still action is getting called 2 times for each call to this Register Action i am attaching the Register.jsp,Struts.xml as well as the action class please have a look at it and point me where i am doing the mistake. Thanks in Advance -aum On Fri, Aug 1, 2008 at 5:37 PM, Joachim Ansorg [EMAIL PROTECTED] wrote: Hi, you use the same action to render the welcome screen and Registrer.jsp. So this means that when you display the welcome screen execute() is called and when you display the Registrer.jsp page. Either use two separate actions or just return null in execute and have another action method (i.e. save()) which writes into the db. In the page with the submit button link to the action's save method. So execute is used for welcome and save for the registration. Hope that helps, Joachim Hi All, While developing an application in struts2 i am facing a strange problem with one of my action namely RegsitrationAction. i have a jsp page for user registration where there are certain fields for the user to be filled for the registration purpose. i have created a UserProfile bean class with the bean properties for all the user registration field. - 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] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: how to set classpath for servlet-api.jar, jsp-api.jar and struts.jar for Ubuntu
http://www.eclipse.org/newsgroups/ Honestly, if you know what it takes to develop a web application with java, then you will find all the configuration options you need just with the eclipse help files and some common sense. May the force be with you. 2008/8/4 Narasimha Raju Naidu [EMAIL PROTECTED]: ok. sure i will. but can you send link for eclipse form. becoz i faild to found that form link. On Sat, Aug 2, 2008 at 11:05 PM, Gabriel Belingueres [EMAIL PROTECTED]wrote: Struts are just jar files. From Eclipse POV, it is just another User Library or J2EE Module Dependency. You may find more help in an Eclipse specific mailing list/forum. 2008/8/2 Narasimha Raju Naidu [EMAIL PROTECTED]: thanks for your reply. i installed eclipse but inorder to strat struts application what are the steps required any reference sites, please mention. waiting for your reply. Regrads... On 8/2/08, Gabriel Belingueres [EMAIL PROTECTED] wrote: Install yourself a nice looking IDE like eclipse, netbeans or from any other vendor. They handle classpaths and Tomcat configurations with a few clicks of your mouse. 2008/8/2 Narasimha Raju Naidu [EMAIL PROTECTED]: hi to all, i am using ubuntu OS and recently i installed tomcat and starting developing struts applications. in order to compile my own servlet classes it is required to set classpath. i am failing to set classpath becoz i am new to UBUNTU. can any one resolve my problem. waiting for you people's solution. Regads, Narasimha Raju -- uni... - 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]
2 Validation questions
Hi Basic question sorry (looked all over but can't find the answer) 1) When validation fails for my 'username' textfield, the error message is displayed ABOVE the text box. Is it possible to have more fine-grained control over how to position the error message. Ideally I would like it below (and in line with) the text box. 2) If I enter an invalid value twice, the original message is still there, so I have two 'username is invalid' messages on the screen now. I know this is done by the javascript so I want to know the recommended way of overriding this behaviour. Thanks -Richard As a responsible corporate citizen, London Scottish Bank plc asks you to consider the environment before printing this email. *** Disclaimer *** This electronic communication is confidential and for the exclusive use of the addressee. It may contain private and confidential information. The information, attachments and opinions contained in this E-mail are those of its author only and do not necessarily represent those of London Scottish Bank PLC or any other members of the London Scottish Group. If you are not the intended addressee, you are prohibited from any disclosure, distribution or further copying or use of this communication or the information in it or taking any action in reliance on it. If you have received this communication in error please notify the Information Security Manager at [EMAIL PROTECTED] as soon as possible and delete the message from all places in your computer where it is stored. We utilise virus scanning software but we cannot guarantee the security of electronic communications and you are advised to check any attachments for viruses. We do not accept liability for any loss resulting from any corruption or alteration of data or importation of any virus as a result of receiving this electronic communication. Replies to this E-mail may be monitored for operational or business reasons. London Scottish Bank PLC is regulated by the Financial Services Authority. London Scottish Bank plc, Registered Office: 201 Deansgate, Manchester M3 3NW Registered Number 973008 England. Subsidiary Companies:- London Scottish Finance Limited, Registered Office: 201 Deansgate, Manchester M3 3NW Registered Number 233259 England. London Scottish Broking Limited, Registered Office: 201 Deansgate, Manchester M3 3NW Registered Number 230110 England. London Scottish Invoice Finance Limited, Registered Office: 201 Deansgate, Manchester M3 3NW Registered Number 2643766 England. Robinson Way Company Limited, Registered Office: 201 Deansgate, Manchester M3 3NW Registered Number 885896 England. __ This email has been scanned by the MessageLabs Email Security System. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [struts] paramsPrepareParams vs. staticParams
I agree that execution semantics should be preserved (in an ideal world at least). But, if the intention is to enforce security of some parameter values AND preserve action semantics, then the action should not change its behavior/semantic if we call it from the context of a different interceptor stack. That is, an action with its parameter secured (not overwritten by user params) should remain secured whether it runs in the paramsPrepareParamsStack, defaultStack, or even in the basicStack for that matter. This would require at least 2 things: 1) The developer of the Action class should declare somewhere that some given parameters should be secured against user parameter overwrite. 2) Even the most basic interceptor stack must enforce the rule. (Otherwise, document it in a bold font) To implement 1), you could use some xml configuration or annotation. To implement 2), may be the natural place to put this control is inside the params interceptor. Because you need this interceptor if the security condition may fail (otherwise, there are no user parameters to worry about.) 2008/8/4 Dale Newfield [EMAIL PROTECTED]: Gabriel Belingueres wrote: Unless you put also those two kind of static parameters in your action, then I think staticParams should need to be executed only once. In any place where you have staticParams and/or actionMappingParams, I would expect the semantics of the action (and potentially the preparation of data for the action) to depend upon those values. A classic example of code re-use would be a single action method that can do it's thing for many scenarios, and for which there are numerous defined actions. I'll pick a message sending action for this example, where these would be valid URLs: sendMessageToGroup.action?groupId=12, sendMessageToUser.action?userId=2354, sendMessageToAll.action, etc., with each separate action definition setting some parameters so the single action method knows what to do. Some uses of this action method can be more sensitive than others, and have different security constraints on the url (sendMessageToAll could be restricted to role ADMIN, for example). If you don't always ensure that static and action mapping parameters are not overwritten by user specified values, sendMessageToUser.action?userId=2354sendToAll=true could be a security hole allowing anyone to spam the entire site. Since setup that will effect the action execution can happen inside prepare, it's important that both prepare and the action method both see the correct values. -Dale - 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]
Struts2 with JSON.
Hi All, Using JSON, I'm getting below response from action {list:{com.beans.ComplaintDO:{user__complaint__number:08-C0153,user__complaint__key:08-C0153-1,form__type:2000B,first__name:Sharath,last__name:Karnati}}} In this response, 'com.beans.ComplaintDO' is a javabean. 'list' is a java arraylist and it may contain multiple 'com.beans.ComplaintDO' javabeans. I'd like to know how to read this response in java script, I tried below way but getting java script error(jsonObject has no properties) function onReadyState() { alert('In onReadyState'); var ready=req.readyState; var jsonObject=null; if ( ready == READY_STATE_COMPLETE ) { jsonObject=eval( req.responseText ); var searchresults = jsonObject.ComplaintDO.entry; alert('In searchresults:'+searchresults.length); } } Please let me know how to read these values from json object. Thanks, Sharath.
[S2] Method dependant validation
Hello everyone, maybe this question has been asked before, but I couldn't find any postings on the topic: How can I validate my input in dependency of the action method (without XML)? I know that method dependant processing is possible with the PrepareInterceptor (i.e. prepareDoThis, prepareDoThat methods that are automatically invoked). I checked the Struts2.1.2 docs[1], but it seems that the ValidationInterceptor does not offer this feature. I also can't find a way to make annotation based validation method dependant, which would also be very useful. (Think of a 'method' parameter that is a comma-seperated list of methods for which the validation applies - default is all). As I thought that this is mainly a WebWork issue, I found this thread[2]. Someone is saying that it (at least the part with the source-based validation) is implemented in WebWork2.2, but it seems that S2 is still using 2.1 - will this change in the near future? CU ~Andreas [1] http://struts.apache.org/2.1.2/docs/validation-interceptor.html [2] http://forums.opensymphony.com/thread.jspa?messageID=28352#28352 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [S2] Method dependant validation
Andreas Mähler schrieb: I know that method dependant processing is possible with the PrepareInterceptor (i.e. prepareDoThis, prepareDoThat methods that are automatically invoked). I checked the Struts2.1.2 docs[1], but it seems that the ValidationInterceptor does not offer this feature. I also can't find a way to make annotation based validation method dependant, which would also be very useful. (Think of a 'method' parameter that is a comma-seperated list of methods for which the validation applies - default is all). [1] http://struts.apache.org/2.1.2/docs/validation-interceptor.html Silly me! I confused the ValidationInterceptor with the WorkflowInterceptor ;-) Sorry for that.. But my second question still applies: Is it somehow possible to use some kind of method parameter for annotation based validation? ~Andreas - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Struts 1.3.8 problem html:form
Hi! I am using Struts 1.3.8 and when i want to try some of the examples or when i want to develop something i always have the same error in the line with html:form. This is a very simple example: Inside Web-inf,i have a lib folder with the following libs: Antlr-2.7.2.jar,commons-beanutils,commons-chain-common-digester,-commons-fileupload,commons-io commons-loggining,commons-validator,jstl-1.0.6,oro-2.0.8,standar-1.06,struts-core,struts-el,struts-extras, struts-taglib,struts-tiles. Struts-config.xml with this Information: ?xml version=1.0 encoding=ISO-8859-1 ? !DOCTYPE struts-config PUBLIC -//Apache Software Foundation//DTD Struts Configuration 1.3//EN http://struts.apache.org/dtds/struts-config_1_0.dtd; struts-config !-- === Form Bean Definitions -- form-beans form-bean name=RegistroForm type=app.RegistroForm/ /form-beans !-- ===Action Mapping Definitions -- action-mappings action path=/registrotype=app.RegistroActionname=RegistroForm input=/registro.jsp/ forward name=exito path=/pages/succes.html/ forward name=fracaso path=/pages/error.html/ action /action-mappings /struts-config Inside Web-inf-src i have a package app with 2 classes. ---RegistroAction-- package app; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.*; import org.apache.struts.action.Action; import org.apache.struts.action.ActionForm; import org.apache.struts.action.ActionForward; import org.apache.struts.action.ActionMapping; import org.apache.struts.action.*; import java.util.Properties; import java.lang.Object; public class RegistroAction extends Action { public ActionForward perform(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) { RegistroForm registroForm = (RegistroForm) form; String user = registroForm.getUsername(); String pass1 = registroForm.getPassword1(); String pass2 = registroForm.getPassword2(); if (pass1.equals(pass2)) { return mapping.findForward(sucess); } else { return mapping.findForward(error); } } --- RegistroForm package app; import org.apache.struts.action.ActionForm; public class RegistroForm extends ActionForm{ protected String username; protected String password1; protected String password2; public String getPassword1() { return password1; } public void setPassword1(String password1) { this.password1 = password1; } public String getPassword2() { return password2; } public void setPassword2(String password2) { this.password2 = password2; } public String getUsername() { return username; } public void setUsername(String username) { this.username = username; } } In a folder call Pages i have a 2 .html error.html and succes.html And of course i have the index.jsp page,i use this page to start the application and there is where i have the error. --index.jsp %@ page language=java contentType=text/html; charset=ISO-8859-1 pageEncoding=ISO-8859-1% %@ taglib uri=http://struts.apache.org/tags-html; prefix=html % %@ taglib uri=http://struts.apache.org/tags-bean; prefix=bean % %@ taglib uri=http://struts.apache.org/tags-logic; prefix=logic % html head meta http-equiv=Content-Type content=text/html; charset=ISO-8859-1 titleIdentificación/title /head body html:form action=/registro Nombre Usuariohtml:text property=username / Contraseñahtml:text property=password1 / Repetir Contraseñahtml:text property=password2 / html:submit property=Registro/ /html:form /body /html The error is in html:form action=/registro El servidor encontró un error interno () que hizo que no pudiera rellenar este requerimiento. excepción That exeption in english it is: The server found an error,and cant fill this requirement. org.apache.jasper.JasperException: Exception in JSP: /index.jsp:16 I am using Tomcat 5.5.26 Thanks in advance. ¡Buscá desde tu celular! Yahoo! oneSEARCH ahora está en Claro http://ar.mobile.yahoo.com/onesearch
Re: Struts 1.3.8 problem html:form
2008/8/4 Alexis Abdel [EMAIL PROTECTED]: !DOCTYPE struts-config PUBLIC -//Apache Software Foundation//DTD Struts Configuration 1.3//EN http://struts.apache.org/dtds/struts-config_1_0.dtd; Shouldn't it be 1_3? Antonio - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[S2] Ajax DIV Question
I have a tabbed panel. I would like to refresh the contents of this tab and am able to do so by publishing to the proper topic. However, I really need to take it a step further and be able to dynamically specify the formid and href attributes of the Ajax DIV in my JavaScript, before refreshing it. Is there a way to do this? If I cannot do this, then I guess my next option would be to use multiple nested Ajax DIVs. I believe that this would work okay if I could specify that these DIVs not preload. However, it appears that this is functionality was not added until 2.1 and I am using 2.0.11. Would there be another way to accomplish this? Thanks in advance, Ken - ***Note:The information contained in this message may be privileged and confidential and protected from disclosure. If the reader of this message is not the intended recipient, or an employee or agent responsible for delivering this message to the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please notify the Sender immediately by replying to the message and deleting it from your computer. Thank you. Premier Inc.
[S2] Refactoring Action classes
Dear Al and Dave, I tried to fix that error with session variable all weekend and I didn't managed to fix it. When action is defined as redirect action to another namespace, and when that action is called, another action called method doesn't see my session variables. I just changed this redirect action to that another namespace, as standard action (not redirect) and I now see my variables! I don't have any idea why it doesn't work with redirect action, but I'm SURE that there is some problem. I have one question regarding refactoring action classes, is it much to have 20 actions per one namespace/action class ? -- Regards, Milan -- View this message in context: http://www.nabble.com/-S2--Refactoring-Action-classes-tp18813229p18813229.html 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: s2: Retrieve current url value
Thanks Wes. Maybe my question is not clear enough. I'd like to find a way to get value in address bar which is different from the path to the jsp rendering current page. Your solutions give us the latter. e.g., if loginForm.jsp is responsible for rendering page for login_input.action, ${...requestURI} will display .../loginForm.jsp but I want to show login_input.action. Thanks. On Mon, Aug 4, 2008 at 12:03 AM, Wes Wannemacher [EMAIL PROTECTED] wrote: Depending on how you want it, you can use EL like - ${request.requestURI} or, if you are talking OGNL, try - s:property value=%{#context['com.opensymphony.xwork2.dispatcher.HttpServletRequest'].requestURI}/ -Wes On Sun, 2008-08-03 at 23:42 -0400, [EMAIL PROTECTED] wrote: Hi, Is there a way to get current page's url in struts2? e.g. suppose a login page's url is http://.../context name/login_input.action, how to get the url in that page? JavaScript is not allowed. Thanks. - 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] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: s2: Retrieve current url value
Try ${request.requestURL} or s:property value=%{#context['com.opensymphony.xwork2.dispatcher.HttpServletRequest'].requestURL}/ Instead. (*Chris*) On Mon, Aug 4, 2008 at 8:29 AM, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Thanks Wes. Maybe my question is not clear enough. I'd like to find a way to get value in address bar which is different from the path to the jsp rendering current page. Your solutions give us the latter. e.g., if loginForm.jsp is responsible for rendering page for login_input.action, ${...requestURI} will display .../loginForm.jsp but I want to show login_input.action. Thanks. On Mon, Aug 4, 2008 at 12:03 AM, Wes Wannemacher [EMAIL PROTECTED] wrote: Depending on how you want it, you can use EL like - ${request.requestURI} or, if you are talking OGNL, try - s:property value=%{#context['com.opensymphony.xwork2.dispatcher.HttpServletRequest'].requestURI}/ -Wes On Sun, 2008-08-03 at 23:42 -0400, [EMAIL PROTECTED] wrote: Hi, Is there a way to get current page's url in struts2? e.g. suppose a login page's url is http://.../context name/login_input.action, how to get the url in that page? JavaScript is not allowed. Thanks. - 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] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [S2] Refactoring Action classes
You don't need to have all your actions for a namespace in a single class, you can use multiple classes. I usually group methods acting on a common object into a single class which usually leaves me with the 5 public methods in a class which map to actions (typically CRUD plus a View method), and multiple classes for different object types. Imho 20 is too many, 10 is a lot, 5 is OK (don't forget that's public action methods, the number of private methods you have will depend on your app). Al. Milan Milanovic wrote: Dear Al and Dave, I tried to fix that error with session variable all weekend and I didn't managed to fix it. When action is defined as redirect action to another namespace, and when that action is called, another action called method doesn't see my session variables. I just changed this redirect action to that another namespace, as standard action (not redirect) and I now see my variables! I don't have any idea why it doesn't work with redirect action, but I'm SURE that there is some problem. I have one question regarding refactoring action classes, is it much to have 20 actions per one namespace/action class ? -- Regards, Milan -- -- Al Sutton W: www.alsutton.com T: twitter.com/alsutton - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Struts2 and spring plugin - Action class [springManagedProsocActionUpdateEmail] not found
I am trying to get spring to manage my Struts2 actions but am getting the following error: Action class [springManagedProsocActionUpdateEmail] not found I have used the http://struts.apache.org/2.x/docs/spring-plugin.html http://struts.apache.org/2.x/docs/spring-plugin.html as a guide but have cross referenced that with the book 'Struts 2 In Action' and for me it doesn't work. These are the things I have done to configure spring with Struts2. 1) Added the struts2-spring-plugin-2.0.11.1.jar to my lib folder; 2) Added the following to my spring-config file: bean id=springManagedProsocActionUpdateEmail class=uk.co.prodia.prosoc.struts2.action.ActionUpdateEmail property name=sessionFactory ref=sessionFactoryProsocForum/ /bean 3) Added the following to my struts.xml file: constant name=struts.objectFactory value=org.apache.struts2.spring.StrutsSpringObjectFactory / 4) Modified the action class attribute to point to the id of the bean in the spring-config file so that it looks like the following: action name=update-email!* class=springManagedProsocActionUpdateEmail method={1} results in here ... ... /action 5) Set the following constant in my struts.xml file: constant name=struts.objectFactory.spring.autoWire value=type / 6) Set the following property on my spring-config beans default-autowire=autodetect tag. Have I been really dense and missed out a step even after going through the book and the web guide twice each? -- View this message in context: http://www.nabble.com/Struts2-and-spring-plugin---Action-class--springManagedProsocActionUpdateEmail--not-found-tp18814302p18814302.html 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: [S2] Refactoring Action classes
I've seen it both waysputting all classes into a global kitchen sink package (even when the Actions have completely different functionality and address completely disparate domain objects) on the other hand i've also seenbanishing (@Embeddable and or inner classes or classes which belong together) to the far reaches of the distro..reachable only by a NASA martian probeFrom the onset an architect or DBA should be able to discern where these objects should live as they know the relationship of objects and entities and can abstractly define domain boundaries in which the objects should be locatedbut its the individual who ultimately has to resolve ALL dependencies such as the release manager who is the ultimate arbiter on where all entitities should be located Anyone else?Martin __ Disclaimer and confidentiality note Everything in this e-mail and any attachments relates to the official business of Sender. This transmission is of a confidential nature and Sender does not endorse distribution to any party other than intended recipient. Sender does not necessarily endorse content contained within this transmission. Date: Mon, 4 Aug 2008 16:47:24 +0100 From: [EMAIL PROTECTED] To: user@struts.apache.org Subject: Re: [S2] Refactoring Action classes You don't need to have all your actions for a namespace in a single class, you can use multiple classes. I usually group methods acting on a common object into a single class which usually leaves me with the 5 public methods in a class which map to actions (typically CRUD plus a View method), and multiple classes for different object types. Imho 20 is too many, 10 is a lot, 5 is OK (don't forget that's public action methods, the number of private methods you have will depend on your app). Al. Milan Milanovic wrote: Dear Al and Dave, I tried to fix that error with session variable all weekend and I didn't managed to fix it. When action is defined as redirect action to another namespace, and when that action is called, another action called method doesn't see my session variables. I just changed this redirect action to that another namespace, as standard action (not redirect) and I now see my variables! I don't have any idea why it doesn't work with redirect action, but I'm SURE that there is some problem. I have one question regarding refactoring action classes, is it much to have 20 actions per one namespace/action class ? -- Regards, Milan -- -- Al Sutton W: www.alsutton.com T: twitter.com/alsutton - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] _ Get Windows Live and get whatever you need, wherever you are. Start here. http://www.windowslive.com/default.html?ocid=TXT_TAGLM_WL_Home_082008
RE: Struts2 and spring plugin - Action class [springManagedProsocActionUpdateEmail] not found
I can't say that I see the problem, but I do see a few small issues. bean id=springManagedProsocActionUpdateEmail class=uk.co.prodia.prosoc.struts2.action.ActionUpdateEmail property name=sessionFactory ref=sessionFactoryProsocForum/ /bean be sure to add scope=prototype. S2 actions are per-request (since they have getters and setters with request specific information being set on them). Basically, they're not thread-safe, so they can't be singletons. 5) Set the following constant in my struts.xml file: constant name=struts.objectFactory.spring.autoWire value=type / 6) Set the following property on my spring-config beans default-autowire=autodetect tag. Technically those shouldn't be necessary. The struts autowire capabilities of the spring-struts plugin are a little hard to understand, but basically, here's how it works.: if the spring-struts plugin can find an Action with the appropriate name that is managed by Spring, it will use that one. If it can't, it will instantiate one and then attempt to 'autowire' it itself. Here's where the autowire settings come into play. In your case, you want the first option (where the bean is fully spring managed) so the struts autowire settings aren't really going to be used. 4) Modified the action class attribute to point to the id of the bean in the spring-config file so that it looks like the following: action name=update-email!* class=springManagedProsocActionUpdateEmail method={1} results in here ... ... /action That seems like it should work. Have you tried it without the method name pattern matching to see if it can find your Spring bean? By the way, do you have Spring's org.springframework.web.context.ContextLoaderListener setup as a listener in web.xml? (it basically starts Spring up) Brad Cupit Louisiana State University - UIS - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: s2: Retrieve current url value
Thanks Chris. I got the same value using requestURL as using requestURI. On Mon, Aug 4, 2008 at 11:45 AM, Chris Pratt [EMAIL PROTECTED] wrote: Try ${request.requestURL} or s:property value=%{#context['com.opensymphony.xwork2.dispatcher.HttpServletRequest'].requestURL}/ Instead. (*Chris*) On Mon, Aug 4, 2008 at 8:29 AM, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Thanks Wes. Maybe my question is not clear enough. I'd like to find a way to get value in address bar which is different from the path to the jsp rendering current page. Your solutions give us the latter. e.g., if loginForm.jsp is responsible for rendering page for login_input.action, ${...requestURI} will display .../loginForm.jsp but I want to show login_input.action. Thanks. On Mon, Aug 4, 2008 at 12:03 AM, Wes Wannemacher [EMAIL PROTECTED] wrote: Depending on how you want it, you can use EL like - ${request.requestURI} or, if you are talking OGNL, try - s:property value=%{#context['com.opensymphony.xwork2.dispatcher.HttpServletRequest'].requestURI}/ -Wes On Sun, 2008-08-03 at 23:42 -0400, [EMAIL PROTECTED] wrote: Hi, Is there a way to get current page's url in struts2? e.g. suppose a login page's url is http://.../context name/login_input.action, how to get the url in that page? JavaScript is not allowed. Thanks. - 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] - 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 and spring plugin - Action class [springManagedProsocActionUpdateEmail] not found
Hi Brad and thank you for the reply. I have tried setting the scope=prototype but it didn't change the error I am seeing. I also tried your suggestion of removing the !* part of the method name from the action along with the method={1} but again it didn't change anything. I have noticed a couple of odd things happening in the logs when the server (Tomcat) boots up. 1) I can see the spring-struts2 plugin initiliasing in the log: org.apache.struts2.spring.StrutsSpringObjectFactory - Initializing Struts-Spring integration com.opensymphony.xwork2.spring.SpringObjectFactory - Setting autowire strategy to name org.apache.struts2.spring.StrutsSpringObjectFactory - ... initialized Struts-Spring integration successfully 2) When I don't use the id of a spring bean as my struts action class value I can see the beans from my spring-config being created in the log. However, if I do use the id of the spring bean as the struts action class then those beans do not get created, It seems as if the presence of the value of the spring bean id attribute in the action class attribute is enough to stop spring creating the beans. As they are not being created, struts2 naturally fails to find it and throws the error I am seeing. I am unsure what could be causing this so any suggestions would be welcomed. -- View this message in context: http://www.nabble.com/Struts2-and-spring-plugin---Action-class--springManagedProsocActionUpdateEmail--not-found-tp18814302p18815307.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Ajax JSP Tag Library 1.3
Are any of you using these tags in an S2 project?%-| Scott -- View this message in context: http://www.nabble.com/Ajax-JSP-Tag-Library-1.3-tp18815549p18815549.html 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: s2: Retrieve current url value
Hi, have You been redirecting to jsp? You can also print uri with s:url/ Best greetings, Paweł Wielgus. 2008/8/4 [EMAIL PROTECTED] [EMAIL PROTECTED]: Thanks Chris. I got the same value using requestURL as using requestURI. On Mon, Aug 4, 2008 at 11:45 AM, Chris Pratt [EMAIL PROTECTED] wrote: Try ${request.requestURL} or s:property value=%{#context['com.opensymphony.xwork2.dispatcher.HttpServletRequest'].requestURL}/ Instead. (*Chris*) On Mon, Aug 4, 2008 at 8:29 AM, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Thanks Wes. Maybe my question is not clear enough. I'd like to find a way to get value in address bar which is different from the path to the jsp rendering current page. Your solutions give us the latter. e.g., if loginForm.jsp is responsible for rendering page for login_input.action, ${...requestURI} will display .../loginForm.jsp but I want to show login_input.action. Thanks. On Mon, Aug 4, 2008 at 12:03 AM, Wes Wannemacher [EMAIL PROTECTED] wrote: Depending on how you want it, you can use EL like - ${request.requestURI} or, if you are talking OGNL, try - s:property value=%{#context['com.opensymphony.xwork2.dispatcher.HttpServletRequest'].requestURI}/ -Wes On Sun, 2008-08-03 at 23:42 -0400, [EMAIL PROTECTED] wrote: Hi, Is there a way to get current page's url in struts2? e.g. suppose a login page's url is http://.../context name/login_input.action, how to get the url in that page? JavaScript is not allowed. Thanks. - 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] - 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]
disabled attribute not rendered for Anchor tag
can anyone please let me know if there is any issue with disabled attribute of Anchor tag? Cause i am not getting the expected behaviour out of the tag. i used struts:a href=some_url disabled=trueTest/struts:a and expected 'Test' coming as disabled. but its not happening. Thanks, Avinash - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: disabled attribute not rendered for Anchor tag
Forgot to mention, i am using struts-2.0.11.2. Thanks. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Struts2 and spring plugin - Action class [springManagedProsocActionUpdateEmail] not found
I have tried setting the scope=prototype but it didn't change the error I am seeing. right, that makes sense. This setting will stop you from having big problems later on though. I am unsure what could be causing this but maybe someone could clarify that the: com.opensymphony.xwork2.spring.SpringObjectFactory - Setting autowire strategy to name is correct, I though it should be setting it to 'type' but I could be wrong. The default is to autowire by name, so if you don't have it set, then that makes sense. In your original post, it was set though, so it's very odd. Remember, you're not really going to care about this value, since your Action is fully Spring managed, but if you telling it to autowire by 'type' and it's picking 'name', that may be the symptom of something else. which version of struts and spring are you using? Brad Cupit Louisiana State University - UIS - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
s2: non-English chars with s:a.. tag
Hi, s:a tag doesn't render its title attribute value properly if it contains non-English chars. Example: s:a href=.. title=Français #231;.../s:a Html a tag does it properly. How to get around it in using s:a tag? Thanks. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Struts2 and spring plugin - Action class [springManagedProsocActionUpdateEmail] not found
Thanks again for replying, I am really stuck on this one at the moment. I am currently using struts-2.0.11.1 and spring-2.5.4. Another thing I have noticed on the struts plugin guide page at: http://struts.apache.org/2.x/docs/spring-plugin.html http://struts.apache.org/2.x/docs/spring-plugin.html is that in their struts.xml example at the bottom of the page they have a bean called 'secure' but it extends=default and not struts-default. I have opened up the struts2-spring-plugin.jar file and see that the struts-plugin.xml file package name attribute is called spring-default and extends struts-default. Would you expect that to mean that my package should be extending the spring-default rather than struts-default? I have tried it and it made no difference; it was just an oddity I noticed. Brad A Cupit wrote: I have tried setting the scope=prototype but it didn't change the error I am seeing. right, that makes sense. This setting will stop you from having big problems later on though. I am unsure what could be causing this but maybe someone could clarify that the: com.opensymphony.xwork2.spring.SpringObjectFactory - Setting autowire strategy to name is correct, I though it should be setting it to 'type' but I could be wrong. The default is to autowire by name, so if you don't have it set, then that makes sense. In your original post, it was set though, so it's very odd. Remember, you're not really going to care about this value, since your Action is fully Spring managed, but if you telling it to autowire by 'type' and it's picking 'name', that may be the symptom of something else. which version of struts and spring are you using? Brad Cupit Louisiana State University - UIS - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/Struts2-and-spring-plugin---Action-class--springManagedProsocActionUpdateEmail--not-found-tp18814302p18817604.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Struts2 tags radio button default select
Hey I am trying to create a radio button and I want one of the values selected by default, s:radio label=Chart Type name=chartType list={'Bar Chart','3D Bar Chart'} value=Bar Chart/ I thought I could use the value to select by default. However Its not working. Any help is appreciated. -- View this message in context: http://www.nabble.com/Struts2-tags-radio-button-default-select-tp18817609p18817609.html 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 and spring plugin - Action class [springManagedProsocActionUpdateEmail] not found
Would you expect that to mean that my package should be extending the spring-default rather than struts-default? it's good thinking to look at struts-plugin.xml in struts2-spring-plugin.jar, but you don't need to extend it unless you intend to use the two interceptors they define there (which shouldn't be necessary). by the way, did you know each message is getting sent to the mailing list twice? Anyways, the way that I would proceed is to set a breakpoint in SpringObjectFactory.buildBean() method and see what happens when beanName = springManagedProsocActionUpdateEmail Does Spring find and return the bean? Or does it throw a NoSuchBeanDefinitionException? If that's not an option in your environment, you could post the relevant portions of struts.xml, struts.properties (if you have one), your spring config file, and web.xml. By relevant, I mean all of struts.xml but only include one Action definition that you know doesn't work. Any servlets, listeners, and filters in web.xml And the Action bean definition in your spring config file. By the way, if you have a struts.properties file, make sure none of its settings conflict with what's in struts.xml Brad Cupit Louisiana State University - UIS -Original Message- From: doahh [mailto:[EMAIL PROTECTED] Sent: Monday, August 04, 2008 2:07 PM To: user@struts.apache.org Subject: RE: Struts2 and spring plugin - Action class [springManagedProsocActionUpdateEmail] not found Thanks again for replying, I am really stuck on this one at the moment. I am currently using struts-2.0.11.1 and spring-2.5.4. Another thing I have noticed on the struts plugin guide page at: http://struts.apache.org/2.x/docs/spring-plugin.html http://struts.apache.org/2.x/docs/spring-plugin.html is that in their struts.xml example at the bottom of the page they have a bean called 'secure' but it extends=default and not struts-default. I have opened up the struts2-spring-plugin.jar file and see that the struts-plugin.xml file package name attribute is called spring-default and extends struts-default. Would you expect that to mean that my package should be extending the spring-default rather than struts-default? I have tried it and it made no difference; it was just an oddity I noticed. Brad A Cupit wrote: I have tried setting the scope=prototype but it didn't change the error I am seeing. right, that makes sense. This setting will stop you from having big problems later on though. I am unsure what could be causing this but maybe someone could clarify that the: com.opensymphony.xwork2.spring.SpringObjectFactory - Setting autowire strategy to name is correct, I though it should be setting it to 'type' but I could be wrong. The default is to autowire by name, so if you don't have it set, then that makes sense. In your original post, it was set though, so it's very odd. Remember, you're not really going to care about this value, since your Action is fully Spring managed, but if you telling it to autowire by 'type' and it's picking 'name', that may be the symptom of something else. which version of struts and spring are you using? Brad Cupit Louisiana State University - UIS - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/Struts2-and-spring-plugin---Action-class--springMa nagedProsocActionUpdateEmail--not-found-tp18814302p18817604.html Sent from the Struts - User mailing list archive at Nabble.com. - 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]
FilterDispatcher and filter mapping
I am experimenting with a non-Struts resource mapped in my web.xml but since the Struts filter is catching all requests, I am getting There is no Action mapped for namespace / and action name callout. - [unknown location] How do requests for non-action mappings sneak through the FilterDispatcher? -- View this message in context: http://www.nabble.com/FilterDispatcher-and-filter-mapping-tp18817936p18817936.html 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: s2: non-English chars with s:a.. tag
same concept as with legacy Java ApplicationResources.properties so in struts.xml you should see the globalMessages_locale.properties identified viaconstant name=struts.custom.i18n.resources value=globalMessages /where english globalMessages.properties would containtoken.transfer.time=The bank transfer was executed at {date,HH:mm:ss MM-dd-} and globalMessages_de.properties would containstoken.transfer.time=Die \u00dcberweisung wurde am {date,HH:mm:ss MM-dd-} durchgef\u00fchrtand in your jsp you would reference the property item with getText as in s:property value=getText('token.transfer.time') / http://struts.apache.org/2.0.11.2/docs/localization.htmlMartin __ Disclaimer and confidentiality note Everything in this e-mail and any attachments relates to the official business of Sender. This transmission is of a confidential nature and Sender does not endorse distribution to any party other than intended recipient. Sender does not necessarily endorse content contained within this transmission. Date: Mon, 4 Aug 2008 14:58:28 -0400 From: [EMAIL PROTECTED] To: user@struts.apache.org Subject: s2: non-English chars with s:a.. tag Hi, s:a tag doesn't render its title attribute value properly if it contains non-English chars. Example: s:a href=.. title=Français #231;.../s:a Html a tag does it properly. How to get around it in using s:a tag? Thanks. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] _ Got Game? Win Prizes in the Windows Live Hotmail Mobile Summer Games Trivia Contest http://www.gowindowslive.com/summergames?ocid=TXT_TAGHM
FileUpload log
Hi all, I have a problem with file uploading (i am using the interceptor) and I just can't find it. I have nothing in Tomcat's logs. I have an interceptor placed after FileUpload in the stack which gets executed. But my action isn't. If you have an idea regarding my problem don't hesitate to give me some advice, but at least can anyone tell me where I could find some logs ? I am completly blind and it's driving me mad !!! thanks in advance. Cheers, Matthieu
RE: Struts2 and spring plugin - Action class [springManagedProsocActionUpdateEmail] not found
Thanks for your offer of help Brad and sorry these files are so big. I do have a habit of editing my posts occassionally through Nabble so maybe that is causing me to post twice? Currently a lack of skill prevents me from setting a break point on the SpringObjectFactory.buildBean() but that is somethig I can start looking into tomorrow. It is somethig I know I should learn but never seem to find the time to get around too. I have posted the various files you mentioned below in case you have time to look at them (I don't have a struts.properties): == struts.xml I have removed all actions except the one I am trying to get working with spring. It is on the package at the top of the file in package 'authenticatedwithssl' The struts results doesn't seem to have come across correctly in the formatting and is missing some nodes but it is valid in my real struts.xml file and works correctly. == struts constant name=struts.i18n.reload value=true / constant name=struts.devMode value=true / constant name=struts.configuration.xml.reload value=true / constant name=struts.ui.theme value=css_xhtml / constant name=struts.objectFactory value=spring / constant name=struts.action.extension value=action / package name=authenticatedwithssl extends=struts-default namespace=/authenticatedwithssl interceptors interceptor class=uk.co.prodia.prosoc.struts2.interceptor.InterceptorAddUserToSession name=addUserToSession / interceptor-stack name=addUserToSessionStack interceptor-ref name=addUserToSession/ interceptor-ref name=defaultStack/ /interceptor-stack /interceptors default-interceptor-ref name=addUserToSessionStack/ action name=update-email!* class=springManagedProsocActionUpdateEmail method={1} result name=input/WEB-INF/page/user/authenticatedwithssl/update-email.jsp/result result name=error type=redirectAction error /unsecured /result result name=success type=redirectAction success /unsecured /result /action /package package name=root extends=struts-default namespace=/ interceptors interceptor class=uk.co.prodia.prosoc.struts2.interceptor.InterceptorAddUserToSession name=addUserToSession / interceptor-stack name=addUserToSessionStack interceptor-ref name=addUserToSession/ interceptor-ref name=defaultStack/ /interceptor-stack /interceptors default-interceptor-ref name=addUserToSessionStack/ /package package name=unsecured-page extends=struts-default namespace=/unsecured interceptors interceptor class=uk.co.prodia.prosoc.struts2.interceptor.InterceptorAddUserToSession name=addUserToSession / interceptor-stack name=addUserToSessionStack interceptor-ref name=addUserToSession/ interceptor-ref name=defaultStack/ /interceptor-stack /interceptors default-interceptor-ref name=addUserToSessionStack/ /package package name=sslsecured extends=struts-default namespace=/sslsecured interceptors interceptor class=uk.co.prodia.prosoc.struts2.interceptor.InterceptorAddUserToSession name=addUserToSession / interceptor-stack name=addUserToSessionStack interceptor-ref name=addUserToSession/ interceptor-ref name=defaultStack/ /interceptor-stack /interceptors default-interceptor-ref name=addUserToSessionStack/ /package package name=authenticated extends=struts-default namespace=/authenticated interceptors interceptor class=uk.co.prodia.prosoc.struts2.interceptor.InterceptorAddUserToSession name=addUserToSession / interceptor-stack name=addUserToSessionStack interceptor-ref name=addUserToSession/ interceptor-ref name=defaultStack/ /interceptor-stack /interceptors default-interceptor-ref name=addUserToSessionStack/ /package package name=test extends=struts-default namespace=/test interceptors interceptor class=uk.co.prodia.prosoc.struts2.interceptor.InterceptorAddUserToSession name=addUserToSession / interceptor-stack name=addUserToSessionStack interceptor-ref name=addUserToSession/ interceptor-ref name=defaultStack/ /interceptor-stack /interceptors default-interceptor-ref name=addUserToSessionStack/ /package /struts == spring-config which is called prosoc-spring-beans.xml within my app. == !--
Basic Action config issue with s:form in jsp
Please help a struggling newbie, and first time mailing list user. The following Netbeans 6.0 project is using Glassfish. Directory listing: TS_6 TS_6/src/ TS_6/src/conf/ TS_6/src/conf/MANIFEST.MF TS_6/src/java/ TS_6/src/java/HelloWorld.java TS_6/src/java/struts.xml TS_6/src/java/ts/ TS_6/src/java/ts/BaseAction.java TS_6/src/java/ts/Login.java TS_6/src/java/ts/ts_struts.xml TS_6/test/ TS_6/web/ TS_6/web/HelloWorld.jsp TS_6/web/index.html TS_6/web/index.jsp TS_6/web/jsp/ TS_6/web/jsp/login.jsp TS_6/web/jsp/login_error.jsp TS_6/web/jsp/login_input.jsp TS_6/web/jsp/login_success.jsp TS_6/web/WEB-INF/ TS_6/web/WEB-INF/sun-web.xml TS_6/web/WEB-INF/web.xml TS_6/web/WEB-INF/lib/ TS_6/web/WEB-INF/lib/commons-fileupload-1.2.1.jar TS_6/web/WEB-INF/lib/commons-io-1.3.2.jar TS_6/web/WEB-INF/lib/commons-logging-1.0.4.jar TS_6/web/WEB-INF/lib/freemarker-2.3.12.jar TS_6/web/WEB-INF/lib/ognl-2.6.11.jar TS_6/web/WEB-INF/lib/struts2-core-2.1.2.jar TS_6/web/WEB-INF/lib/xwork-2.1.1.jar Below find the files that I view as being involved in my problem web.xml ?xml version=1.0 encoding=UTF-8? web-app version=2.5 xmlns=http://java.sun.com/xml/ns/javaee; xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; xsi:schemaLocation=http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd; filter filter-namestruts2/filter-name filter-classorg.apache.struts2.dispatcher.FilterDispatcher/filter-cla ss /filter filter-mapping filter-namestruts2/filter-name url-pattern/*/url-pattern /filter-mapping welcome-file-list welcome-fileindex.html/welcome-file welcome-fileindex.jsp/welcome-file /welcome-file-list /web-app struts.xml !DOCTYPE struts PUBLIC -//Apache Software Foundation//DTD Struts Configuration 2.0//EN http://struts.apache.org/dtds/struts-2.0.dtd; struts include file=ts/ts_struts.xml/ package name=hello extends=struts-default action name=HelloWorld class=HelloWorld result/HelloWorld.jsp/result /action /package /struts ts_struts.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=ts namespace=/ts extends=struts-default action name=Login class=ts.Login result name=success/jsp/login_success.jsp/result result name=input/jsp/login_input.jsp/result result name=error/jsp/login_error.jsp/result /action /package /struts index.html !DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.0 Transitional//EN html head META HTTP-EQUIV=Refresh CONTENT=0;URL=ts/Login.action /head body pLoading .../p /body /html Login.java package ts; public class Login extends BaseAction { public String execute() throws Exception { if (isInvalid(getUsername())) { return INPUT; } if (isInvalid(getPassword())) { return INPUT; } return SUCCESS; } private boolean isInvalid(String value) { return (value == null || value.length() == 0); } private String username; public String getUsername() { return username; } public void setUsername(String username) { this.username = username; } private String password; public String getPassword() { return password; } public void setPassword(String password) { this.password = password; } } BaseAction.java package ts; import com.opensymphony.xwork2.ActionSupport; public class BaseAction extends ActionSupport { } login_input.jsp %@ page language=java contentType=text/html; charset=ISO-8859-1 pageEncoding=ISO-8859-1 % %@ taglib prefix=s uri=/struts-tags% !DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN http://www.w3.org/TR/html4/loose.dtd; html head meta http-equiv=Content-Type content=text/html; charset=UTF-8 titleLogin Input/title /head body h1/jsp/login_input.jsp/h1 h2Input Page/h2 /body /html RUN... http://localhost:8080/TS_6/ yields this url... http://localhost:8080/TS_6/ts/Login.action which displays... /jsp/login_input.jsp Input Page This all seems wired up well enough for the Login action to find the mapped jsp BUT... When I edit the same jsp by adding a form... login_input.jsp %@ page language=java contentType=text/html; charset=ISO-8859-1 pageEncoding=ISO-8859-1 % %@ taglib prefix=s uri=/struts-tags% !DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN http://www.w3.org/TR/html4/loose.dtd;
[S2] what tag to use to get object's field?
hi there, say I have an object client and it has firstName and lastName. I wish to write this on the jsp page: Dear Mr. XX welcome to the XX should be substitute with firstName and lastName. what tag should be used in order to achieve this? thank you! -- View this message in context: http://www.nabble.com/-S2--what-tag-to-use-to-get-object%27s-field--tp18821594p18821594.html 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: FilterDispatcher and filter mapping
Generally, I just map everything through the dispatcher. I find s2 actions/results more friendly than straight up JSP and/or Servlets... Beyond that, if you're incorporating something that doesn't already have a result type, would it be a good candidate for a plugin? -Wes On Mon, 2008-08-04 at 12:27 -0700, stanlick wrote: I am experimenting with a non-Struts resource mapped in my web.xml but since the Struts filter is catching all requests, I am getting There is no Action mapped for namespace / and action name callout. - [unknown location] How do requests for non-action mappings sneak through the FilterDispatcher? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [S2] what tag to use to get object's field?
s:property 2008/8/4 xianwinwin [EMAIL PROTECTED]: hi there, say I have an object client and it has firstName and lastName. I wish to write this on the jsp page: Dear Mr. XX welcome to the XX should be substitute with firstName and lastName. what tag should be used in order to achieve this? thank you! -- View this message in context: http://www.nabble.com/-S2--what-tag-to-use-to-get-object%27s-field--tp18821594p18821594.html Sent from the Struts - User mailing list archive at Nabble.com. - 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: Issue with Url mapping with struts-action-extension=
Martin Gainty 写道: check to make sure your jsp is in webapps/webapplication check the 'work' folder to see if the jsp compiled e.g. index.jsp would look like _index__jsp.class * which means a)index.jsp was compiled to _index__jsp.java b)_index__jsp.java was compiled to _index__jsp.class HTH * Martin __ Disclaimer and confidentiality note Everything in this e-mail and any attachments relates to the official business of Sender. This transmission is of a confidential nature and Sender does not endorse distribution to any party other than intended recipient. Sender does not necessarily endorse content contained within this transmission. Date: Mon, 4 Aug 2008 17:23:45 +0800 From: [EMAIL PROTECTED] To: user@struts.apache.org Subject: Re: Issue with Url mapping with struts-action-extension= Jeromy Evans 写道: Haulyn R. Jason wrote: Hi,all I set struts-action-extension= for no extension as action or do by default for struts2, and mapping all url to struts2 dispatcher as /*. But, the problem is I can not access any jsp, html,css and js files. The page display:there are no action mapping for XXX.jsp action. Should any one give me some suggestions or referenced links? Always thanks very much. I'm not sure if your setting is interpreted as blank, not set (default) or null. Did your jsp, html, css and js work before you made that change? The process works like this: 1. the container sees the request and maps it to the Strust2 FilterDispatcher because it matches /* 2. the FilterDispatcher checks whether the request contains a known action extension, and if so, invokes the ActionMapper 3. If the ActionMapper didn't find anything, the FilterDispatcher checks if there's struts static resource for the request (if serve.static.resource=true) 4. If nothing matched, the filter does nothing 5. If nothing has processed the request, the container eventually invokes the Default Servlet (and JSP handling, other file handling) So there's two possible problems: a. the FilterDispatcher thinks it can handle everything and tries to, causing an error; or b. there is a configuration problem with the container (eg. the default servlet is disabled or the request never reached the container). In case it is a, I would try the following settings: struts.action.extension=,,action Note the double comma. That means a blank (no extension), or .action extension. The double-comma ensures blank isn't trimmed as whitespace. Hope that helps, Jeromy Evans - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] Hi, Evans Thanks for your answer, it looks very useful but some new problem occurred: When I set struts.action.extension= value as with no space or (same as before with one whitespace) Struts treat all html, js, css and jsp as action, but all real actions work well. Without struts 2 FilterDispatcher, everything works well.(Certainly real action can not work) Then I tried your solution as: struts.action.extension=,,action but modified as struts.action.extension=,,jsps ok, this time, when I visit http://localhost:8080/8f/myAction.jsps, everything works well,but I can not access to http://localhost:8080/8f/myAction without any extension. And something interesting occurred: I can access http://localhost:8080/8f/myAction.; and everything works well. I mean, I can not visit myAction with no extension but I can visit myAction with extension:., just a . I am not sure what's wrong with my configuration. And I use struts2.0.11.1. -- Thanks! Mobile: +086-15864011231 EMailgtalk:[EMAIL PROTECTED] EMailyahoo:[EMAIL PROTECTED] Skype:saharabear Haulyn Runner Jason - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] Reveal your inner athlete and share it with friends on Windows Live. Share now! http://revealyourinnerathlete.windowslive.com?locale=en-usocid=TXT_TAGLM_WLYIA_whichathlete_us Hi,Martin Thanks for your answer, maybe this is the problem, but I am not sure. all my jsps are compiled, but not _index__jsp.java, all jsps are compiled as index__jsp.java, without prefix _. I am not sure what's wrong with it. -- Thanks! Mobile: +086-15864011231 EMailgtalk:[EMAIL PROTECTED] EMailyahoo:[EMAIL PROTECTED] Skype:saharabear 贾昊林(Haulyn Runner Jason) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]