Handling probel.
Hi all, Does anyone aver encountered this problem: My webApp is running on a Tomcat server. When I dispatch a request through a "welcome.do" action, everything is well done. But when I type or I click on a link which points on a "contact.do" for example, Apache cannot handle this. Does anyone have an idea on how make Apache handling the *.do patterns in order to interpret them correctly? Thank you very much. Marc
Re: setting a text field
i am doing all what you are suggesting, but it is not working. i think there is some problem in configurations. i will look into it. thanks On Mon, Dec 8, 2008 at 4:19 PM, Dimitar Vlasev <[EMAIL PROTECTED]> wrote: > Hi, > have you ever read something about struts forms before asking questions > here? > Don't feel offended but this is a base functionality and I'm pretty > sure you will not receive much help about issues like this. > And you'll need to provide at least the version of Struts you're using. > > I guess you're using Struts 1.x > Setting the value of the form field in the action that precedes the > forward to the jsp will do what you need if all your configurations > are OK. > The form field is property of a struts form configured for your action. > If this does not ring any bells for you you'll really need to read > something for the version of Struts you're using. > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > >
Re: redirect
Aditya Lukman wrote: > > Hi all,, > i want to redirect from http://localhost:8080/cimeng/adhit *to* > http://localhost:8080/cimeng/profile.action?nickname=aray > > so,, how to solve my problem > > please, give me a descriptions for my problem > thank's for your help > Seems to be quite simple. In your struts.xml add the following (replace the brackets): [action name="adhit" class="com.foo.AdhitAction"] [result type="redirectAction"] [param name="actionName"]profile[/param] [param name="param1"]nickname[/param] [param name="param2"]${name}[/param] [/result] [/action] [action name="profile" class="com.foo.ProfileAction"] [result]jsp/profile.jsp[/result] [/action] Be aware of the difference of the result types in Struts 2.0.x ("redirect-action") and Struts 2.1 ("redirectAction"). In your AdhitAction class you need a getter-method for the "name" property and in your ProfileAction class a setter-method for your "nickname" property. That's all. With OGNL the parameter name is dynamically added to the redirect URL. -- View this message in context: http://www.nabble.com/redirect-tp20907667p20909952.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]
redirect
Hi all,, i want to redirect from http://localhost:8080/cimeng/adhit *to* http://localhost:8080/cimeng/profile.action?nickname=aray so,, how to solve my problem please, give me a descriptions for my problem thank's for your help -- Aditya Lukman Afandi Programmer / Blueoxygen Developer Web Office : http://www.meruvian.org Phone Office : 02193586577 HP : 085224191503 Forum : http://www.mervforum.com/ Blog : http://nagasakti.mervpolis.com/roller/adhit Group : [EMAIL PROTECTED]
Re: problem with s:inputtransferselect
> It is of type "ArrayList". Er... of what type? What's *in* the list? > It does renders fine. Are the form values from the inputtransferselect being submitted? You can verify this by using a tool like Firebug or similar. Does the *rendered* select element have a "name" attribute? Without a "name" or "key" attribute in the tag I just don't think it'll work--the name or key is what names the action property that will be set with the values in the list. It may be different in S2.0; I don't have the means to test that quickly. Without it in S2.1 it will fail. It may also use the Dojo stuff (not sure about S2.0, I know it does in S2.1)--are you using the tag? Dave - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: problem with s:inputtransferselect
Hi, It is of type "ArrayList". It does renders fine. Leena > Without a "key" or "name" attribute, from the way all the other tags work, > I wouldn't expect it to work right. If you're saying the select box is being > rendered properly with a name (and you've verified the form values are being > sent in the request) then I'd want to know the type of the "shoes" > collection to know if it's a type conversion issue. > > > > > Dave > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > >
Re: problem with s:inputtransferselect
--- On Mon, 12/8/08, Leena Borle wrote: > No, I do mean "inputtransferselect". [...] Oh, weird; I'll try to add that to the documentation this week. > I'm not using name field because I have these keys defined in > package.properties file from which it picks up name and > lable which should match with the name in the beans. I don't see anything in the API doc that would lead me to think the list value is anything other than the populating list. Without a "key" or "name" attribute, from the way all the other tags work, I wouldn't expect it to work right. If you're saying the select box is being rendered properly with a name (and you've verified the form values are being sent in the request) then I'd want to know the type of the "shoes" collection to know if it's a type conversion issue. Dave - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: problem with s:inputtransferselect
Hi Dave, No, I do mean "inputtransferselect". It is the tag with textfield and a list. Values that you enter in the text field appear in the list. They have shown in Struts2 Showcase UI tag examples. I don't know why its not listed in "Tag reference Guide". ( http://struts.apache.org/2.0.6/struts2-core/apidocs/org/apache/struts2/components/InputTransferSelect.html ) I'm not using name field because I have these keys defined in package.properties file from which it picks up name and lable which should match with the name in the beans. e.g. User user user.shoes=Shoes (User is valriable in action, shoes is variable in User object). Leena On Mon, Dec 8, 2008 at 1:14 PM, Dave Newton <[EMAIL PROTECTED]> wrote: > You mean optiontransferselect, right? > > Don't you need a "name" attribute or something? I thought the "list" > attribute was what populated the control. > > Dave > > > --- On Mon, 12/8/08, Leena Borle <[EMAIL PROTECTED]> wrote: > > > From: Leena Borle <[EMAIL PROTECTED]> > > Subject: problem with s:inputtransferselect > > To: "Struts Users Mailing List" > > Date: Monday, December 8, 2008, 3:54 PM > > Hi, > > I am having problem with the tag > > "s:inputtransferselect". All I have is a > > list defined inside a bean. This bean is used by action to > > add/edit the > > values. I see all the values except values of this tag does > > not get > > reflected back to the action. Am I missing something in > > this tag ? > > My Jsp code is, > > > list="user.shoes" theme="ajax" > > labelposition="left"> > > Variable "user" and it's getter/setter are > > defined in my action. Variable > > "shoes" is an ArrayList declared and defined in > > user object. > > > > > > I would appreciate help with this. > > Thanks > > Leena > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > >
Re: problem with s:inputtransferselect
You mean optiontransferselect, right? Don't you need a "name" attribute or something? I thought the "list" attribute was what populated the control. Dave --- On Mon, 12/8/08, Leena Borle <[EMAIL PROTECTED]> wrote: > From: Leena Borle <[EMAIL PROTECTED]> > Subject: problem with s:inputtransferselect > To: "Struts Users Mailing List" > Date: Monday, December 8, 2008, 3:54 PM > Hi, > I am having problem with the tag > "s:inputtransferselect". All I have is a > list defined inside a bean. This bean is used by action to > add/edit the > values. I see all the values except values of this tag does > not get > reflected back to the action. Am I missing something in > this tag ? > My Jsp code is, > list="user.shoes" theme="ajax" > labelposition="left"> > Variable "user" and it's getter/setter are > defined in my action. Variable > "shoes" is an ArrayList declared and defined in > user object. > > > I would appreciate help with this. > Thanks > Leena - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Multiple Validation Options?
I'm using Struts 1.3.5 and when I last checked there was a method getValidationKey: getValidationKey(ActionMapping mapping, HttpServletRequest request) Returns the Validation key. This is fired inside of the validate() method to determine which validation ruleset to use inside the validation.xml file. So, I would think you could now determine what this method should return and then it would lookup another ruleset from the validations.xml file. From: dancerjohn [EMAIL PROTECTED] Sent: Monday, December 08, 2008 3:22 PM To: user@struts.apache.org Subject: RE: Multiple Validation Options? I am not sure what you mean. I don't see anything about a key or path in the API for ValidatorActionForm or ValidatorForm. Also, I would think that hitting these would be too late. If I understand it correctly (and I am new so maybe not), struts-config.xml specifies that ValidatorPlugin should be used to parse validation.xml to do validation on various forms. I want to make a change so that ValidatorPlugIn will use a different set of rules depending on what site is being run (determined by a database query). seems to provide this type of capability but it seems to be limited to Locale variability. Eric J Givler wrote: > > Doesn't the ValidatorActionForm provide a means of getting/setting the > validation key to be used (normally set to the mapping.getPath())? If > that's the case, can't you inject your own key programmatically? > > -- View this message in context: http://www.nabble.com/Multiple-Validation-Options--tp20898122p20902765.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]
How struts discovers config files
Hi everybody, I am curious to know how struts discovers its configuration files from inside different jar files bundled in the WAR file. Can somebody point me in the right direction please? thanks in advance -arash -- The dirtiest book of all is the expurgated book. Walt Whitman
Re: Cannot find bean in any scope
Do you have any null values in your collection? The only way I could reproduce something similar was if I added "null" to the collection. Nils-H On Mon, Dec 8, 2008 at 11:43 AM, gbattine <[EMAIL PROTECTED]> wrote: > > Hi, > thanks very much for your help. > I understood your explanation but I didn't solve. > Now I did: > > > > > > > > > > but I still have: > > javax.servlet.ServletException: javax.servlet.jsp.JspException: Cannot find > bean: "DVD" in any scope > > I'm missing something? > Thanks > > > > > > Nils-Helge Garli wrote: >> >> From the taglib reference for "iterate" [1]: >> >> id - The name of a page scope JSP bean that will contain the current >> element of the collection on each iteration, if it is not null. >> >> In your example, you have used id="dvds" which means that you would >> have to use > >> Nils-H >> >> [1] - >> http://struts.apache.org/1.3.8/struts-taglib/tagreference.html#logic:iterate >> >> On Sun, Dec 7, 2008 at 5:39 PM, gbattine <[EMAIL PROTECTED]> wrote: >>> >>> Hello guys, >>> I'm newbie of Struts, please help me. >>> I've an action that calls some business logic, retrieve a a list and set >>> it >>> into request, calling later a jsp, in which I try to show this list >>> through >>> iterate tag. >>> >>> this is jsp to show list >>> >>> <%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> >>> <%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> >>> >>> >>> >>>JSP Page >>> >>> >>>Ricerca film >>> >>> >>> >>> Titolo >>> Regia >>> Sceneggiatura >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> this is action that pass to list a list of dvds >>> Collection c = new ArrayList(); >>>try { >>>c = manager.getAll(); >>>} catch (DAOException e) { >>>String message = "DVDs could not be listed"; >>>errors.add("label", new ActionError("error.listfailed")); >>>saveErrors(request, errors); >>>return (mapping.findForward("error")); >>> >>> >>>} >>> session.setAttribute("dvds", c); >>> >>> >>> besides dvd (shown in jsp) is a bean to show each item of dvds list. >>> Instead of show jsp with list of dvd I've this error: >>> >>> javax.servlet.ServletException: javax.servlet.jsp.JspException: Cannot >>> find >>> bean: "DVD" in any scope >>> >>> How can I solve it? >>> please help me, >>> Thanks >>> >>> >>> -- >>> View this message in context: >>> http://www.nabble.com/Cannot-find-bean-in-any-scope-tp20882790p20882790.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] >> >> >> > > -- > View this message in context: > http://www.nabble.com/Cannot-find-bean-in-any-scope-tp20882790p20893064.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]
problem with s:inputtransferselect
Hi, I am having problem with the tag "s:inputtransferselect". All I have is a list defined inside a bean. This bean is used by action to add/edit the values. I see all the values except values of this tag does not get reflected back to the action. Am I missing something in this tag ? My Jsp code is, Variable "user" and it's getter/setter are defined in my action. Variable "shoes" is an ArrayList declared and defined in user object. I would appreciate help with this. Thanks Leena
RE: Multiple Validation Options?
I am not sure what you mean. I don't see anything about a key or path in the API for ValidatorActionForm or ValidatorForm. Also, I would think that hitting these would be too late. If I understand it correctly (and I am new so maybe not), struts-config.xml specifies that ValidatorPlugin should be used to parse validation.xml to do validation on various forms. I want to make a change so that ValidatorPlugIn will use a different set of rules depending on what site is being run (determined by a database query). seems to provide this type of capability but it seems to be limited to Locale variability. Eric J Givler wrote: > > Doesn't the ValidatorActionForm provide a means of getting/setting the > validation key to be used (normally set to the mapping.getPath())? If > that's the case, can't you inject your own key programmatically? > > -- View this message in context: http://www.nabble.com/Multiple-Validation-Options--tp20898122p20902765.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: Multiple Validation Options?
Doesn't the ValidatorActionForm provide a means of getting/setting the validation key to be used (normally set to the mapping.getPath())? If that's the case, can't you inject your own key programmatically? From: dancerjohn [EMAIL PROTECTED] Sent: Monday, December 08, 2008 11:08 AM To: user@struts.apache.org Subject: Multiple Validation Options? I have a situation where we have a single code base and struts config files that support multiple sites. I want to be able to do different validation on each site. If I have a form A that has field a, I want to apply one set of rules for web-site 123 and a different set of rules for web-site abc. How would I do this? I see that struts supports formsets but selection of the formset seems to be solely by locale. Is there a way to use the formset framework and have my code specify dynamically which formset to use? I thought about overloading org.apache.struts.validator.ValidatorPlugIn. Any thoughts would be appreciated. John -- View this message in context: http://www.nabble.com/Multiple-Validation-Options--tp20898122p20898122.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]
TabbedPane
Hi, I'm using a tabbedPanel to include a call to several actions in tabs, each action displaying a form on its own: How can the "main" (or parent) JSP access what's in the forms of the actions in each tab? I.e., I have something like mainTabs.jsp: And for example, the first tab is rendered in basicInfo.jsp, with a form: ... In mainTabs.jsp, I'm trying to get ahold of the form object included in the tab, but getElementById('basicInfo') returns null, and looking at document.forms.length returns only 1 (the other form that's defined in mainTabs.jsp). Is there any way the parent JSP can access the form objects contained in the tabs? Thanks David CONFIDENTIALITY - This email and any files transmitted with it, are confidential, may be legally privileged and are intended solely for the use of the individual or entity to whom they are addressed. If this has come to you in error, you must not copy, distribute, disclose or use any of the information it contains. Please notify the sender immediately and delete them from your system. SECURITY - Please be aware that communication by email, by its very nature, is not 100% secure and by communicating with Perform Group by email you consent to us monitoring and reading any such correspondence. VIRUSES - Although this email message has been scanned for the presence of computer viruses, the sender accepts no liability for any damage sustained as a result of a computer virus and it is the recipients responsibility to ensure that email is virus free. AUTHORITY - Any views or opinions expressed in this email are solely those of the sender and do not necessarily represent those of Perform Group. COPYRIGHT - Copyright of this email and any attachments belongs to Perform Group, Companies House Registration number 6324278.
Re: Any issues with using OGNL ver 2.7.3
Good news, thanks. Chris Pratt wrote: > > I've been using OGNL 2.7.2 with Struts 2.1.2 for a while and haven't > noticed > any problems. > (*Chris*) > > On Sun, Dec 7, 2008 at 9:34 PM, Adam Ruggles <[EMAIL PROTECTED]> wrote: > >> >> Are there any known issues with using OGNL 2.7.3 with Struts 2.1.2? >> -- >> View this message in context: >> http://www.nabble.com/Any-issues-with-using-OGNL-ver-2.7.3-tp20889755p20889755.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] >> >> > > -- View this message in context: http://www.nabble.com/Any-issues-with-using-OGNL-ver-2.7.3-tp20889755p20901118.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: Getter Method call twice - S2
Hi Eugenio, i just tried to replicate Your problem, the thing is that i remember in S1 (don't know which version) that was normal behavior, getter was called n times where n is list.size() - more or less. But in S2 i don't see it anymore. So if You want to find what's going on try to add some debuging. Best greetings, Paweł Wielgus. 2008/12/5 Felipe Lorenz <[EMAIL PROTECTED]>: > Did you try to debug your application? Or try to see from what > Action/JSP its called! Or create a Interceptor to print a log: > > public class Log4JInterceptor extends AbstractInterceptor { > >@Override >public String intercept(ActionInvocation invocation) throws Exception { >String comando = invocation.getInvocationContext().getName(); >Map parametros = invocation.getInvocationContext().getParameters(); >Map sessao = invocation.getInvocationContext().getSession(); > >String loginUsuario = "anonimo"; >if( sessao.containsKey(SessionSuport.USER_SESSION) ) { >Colaborador colaborador = (Colaborador) sessao.get( > SessionSuport.USER_SESSION ); >loginUsuario = colaborador.getLogin(); >} > >String linhaLog = ""; >Logger log = Logger.getLogger( comando ); >String retorno = invocation.invoke(); > >if( !retorno.equals("erro") ) { >for( Object chave : parametros.keySet() ) { >Object valor = parametros.get( chave ); >String valorStr = ""; >if( valor instanceof String[] ) { >for( String atual : ((String[])valor) ) >valorStr += atual + ","; >} >valorStr = valorStr.substring( 0, valorStr.length()-1 ); >linhaLog += chave + "=" + valorStr + ";"; >} >linhaLog = linhaLog.trim(); > >if( !linhaLog.equals("") ) { >PatternLayout layout = new PatternLayout( > "%d{HH:mm:ss} - " + loginUsuario + " - %c - %m%n" ); > >String formatoData = "dd-MM-"; >SimpleDateFormat sdf = new SimpleDateFormat( formatoData ); >String hoje = sdf.format( new Date() ); > >String nomeArquivo = "logGerAtividade.log"; > >DailyRollingFileAppender appender = new > DailyRollingFileAppender( layout, nomeArquivo, "dd-MM-" ); >appender.setEncoding( "ISO-8859-1" ); > >ConsoleAppender consoleAppender = new ConsoleAppender( > layout, "System.out" ); >consoleAppender.setEncoding( "ISO-8859-1" ); > >log.addAppender( appender ); >log.addAppender( consoleAppender ); > >log.info( linhaLog ); > >log.removeAllAppenders(); >} >} else { >ActionSupport action = ActionSupport.class.cast( > invocation.getAction() ); >Collection erros = action.getActionErrors(); >for( Object erro : erros ) { >linhaLog += erro + ","; >} > >linhaLog = linhaLog.substring( 0, linhaLog.length()-1 ); > >if( !linhaLog.equals("") ) { >PatternLayout layout = new PatternLayout( > "%d{HH:mm:ss} - " + loginUsuario + " - %c - %m%n" ); >String formatoData = "dd-MM-"; >SimpleDateFormat sdf = new SimpleDateFormat( formatoData ); >String hoje = sdf.format( new Date() ); > >String nomeArquivo = "logGerAtividadeERROR.log"; > >DailyRollingFileAppender appender = new > DailyRollingFileAppender( layout, nomeArquivo, "dd-MM-" ); >appender.setEncoding( "ISO-8859-1" ); > >ConsoleAppender consoleAppender = new ConsoleAppender( > layout, "System.out" ); >consoleAppender.setEncoding( "ISO-8859-1" ); > >log.addAppender( appender ); >log.addAppender( consoleAppender ); > >log.info( linhaLog ); > >log.removeAllAppenders(); >} >} >return retorno; >} > > } > > On Fri, Dec 5, 2008 at 9:07 AM, Eugenio Perrotta Neto > <[EMAIL PROTECTED]> wrote: >> anybody has the answer? >> >> On Thu, Dec 4, 2008 at 2:05 PM, Eugenio Perrotta Neto < >> [EMAIL PROTECTED]> wrote: >> >>> the code is here: >>> >>> >>> >>> i have a tag file called page.tag >>> >>> >>> <%@ tag body-content="scriptless" %> >>> <%@ tag pageEncoding="UTF-8" %> >>> <[EMAIL PROTECTED] prefix="s" uri="/struts-tags" %> >>> <[EMAIL PROTECTED] prefix="sicat2" uri="/WEB-INF/sicat2.tld" %> >>> >> http://www.w3.org/TR/html4/loose.dtd";> >>> >>> >>> >> /> >>> " type="text/css"/> >>> >>> : >> value="moduleName" /> : >>> >> type="text/javascript"> >>> >> charset="UTF-8" type="text/javascript"> >>> >>> >>> >>> : >>> >>> >>> >>> >>> >>
Re: launching some code after action execution and before result
Thanks for that. Don't know how I missed it in the documentation, it is of course pretty much exactly what I need. Ideally I guess I'd like it to be configurable in the struts.xml, but it's fine as it is. PreResultListener? --- On Sun, 12/7/08, Adam Hardy <[EMAIL PROTECTED]> wrote: > From: Adam Hardy <[EMAIL PROTECTED]> > Subject: launching some code after action execution and before result > To: "Struts Users Mailing List" > Date: Sunday, December 7, 2008, 3:29 PM > Is this possible somehow in the struts2 framework? > > I'd like to execute some code for all requests after > the action has executed, but before the result, the JSP and > all are processed. > > The code will look at the result type from the action and > do some work based on that. > > Something like an interceptor would be great, but obviously > the interceptor framework doesn't enable me to do > anything at that particular stage. > > I am using Tiles and I guess a bit of research there will > show up something I can employ, but I'd rather have the > code logically nearer the Action class - actually on the > action class would be ideal since that's where I already > have the various managers and entities. -- View this message in context: http://www.nabble.com/launching-some-code-after-action-execution-and-before-result-tp20885443p20898629.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]
Multiple Validation Options?
I have a situation where we have a single code base and struts config files that support multiple sites. I want to be able to do different validation on each site. If I have a form A that has field a, I want to apply one set of rules for web-site 123 and a different set of rules for web-site abc. How would I do this? I see that struts supports formsets but selection of the formset seems to be solely by locale. Is there a way to use the formset framework and have my code specify dynamically which formset to use? I thought about overloading org.apache.struts.validator.ValidatorPlugIn. Any thoughts would be appreciated. John -- View this message in context: http://www.nabble.com/Multiple-Validation-Options--tp20898122p20898122.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: setting a text field
Hi, have you ever read something about struts forms before asking questions here? Don't feel offended but this is a base functionality and I'm pretty sure you will not receive much help about issues like this. And you'll need to provide at least the version of Struts you're using. I guess you're using Struts 1.x Setting the value of the form field in the action that precedes the forward to the jsp will do what you need if all your configurations are OK. The form field is property of a struts form configured for your action. If this does not ring any bells for you you'll really need to read something for the version of Struts you're using. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: JSP tags calling action directives
2008/12/8 Dave Newton <[EMAIL PROTECTED]> > --- On Mon, 12/8/08, Raquel Pau Fernández wrote: > > Excuse me for insisting, but the problem of using is that > > you need to offer always it as url... > > Using Codebehind you don't need to configure it via XML; I don't see any > practical difference between using URLs or classnames to access an action. An URL can be accessible from the browser but not a class. Codebehind offers automatically an URL...but I don't want it. All is for security reasons... Is the same reason that you don't have to permit access directly to your JSPs.. For instance, you only want to show this data under some conditions (submit an specific form). In order to satisfy it, the people puts the service call code in the previous action but it produces a dependency between what do you want to show and what do you need perform under a submit. > > > [...] but also perhaps is necessary pass some request or session > > parameters to this service and they have not been necessary for the > > executed action. > > Another reason I think it's a bad idea and more trouble than it's worth. I only need to execute the logic of Params interceptor...or getting all the parameters and using BeanUtils to put their value to the action. > > IIRC the action tag uses the current value stack (which includes the > request and session maps) for the action being executed, so (if that's > correct) the only thing you're asking for is the ability to instantiate the > action based on its classname rather than a URL? Yes because my action may not be an URL. > > > > Therefore, using Spring or any other IoC framework having > > Struts2 is unnecessary and you lost a lot of performance [...] > > S2 uses (a version of) Guice to do its IoC/DI by default. I also think > you're over-estimating the performance penalties of Spring (for example). Anyway, you need to call two java reflections.. > Dave > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > -- Raquel Pau
setting a text field
Hi, I am trying to set a html:text value from one action. That text field is in the jsp page which is shown once the page (for action action is defined) is successfully submitted. But the problem is that the value in the jsp page is not set. It is null all the time. Do I have to send value with url? If so then where should I fill that text field Any idea?
No action instance for path [/path] could be created
Hi list, With my last question still standing (even though the struts list might not be the right resource for it), I'm off to the next question. I've created a portlet application wrapping two portlets. My first goal should be an easy one - trying to link from the one portlet to the other. In order to do so I've created a JSP for each portlet: /my/namespace/applications/view.jsp And /my/namespace/submit/view.jsp Using struts I defined these actions: And with Tiles I created these: In the JSP I link to the other JSP and vica versa using: and The links do work - they do load the other JSP - but also generate the following error: ERROR [RequestProcessor:296] No action instance for path /my/namespace/submit/view could be created java.lang.NullPointerException Why is this happening, can anybody explain? Thanks! Evert Lammerts
Re: JSP tags calling action directives
--- On Mon, 12/8/08, Raquel Pau Fernández wrote: > Excuse me for insisting, but the problem of using is that > you need to offer always it as url... Using Codebehind you don't need to configure it via XML; I don't see any practical difference between using URLs or classnames to access an action. > [...] but also perhaps is necessary pass some request or session > parameters to this service and they have not been necessary for the > executed action. Another reason I think it's a bad idea and more trouble than it's worth. IIRC the action tag uses the current value stack (which includes the request and session maps) for the action being executed, so (if that's correct) the only thing you're asking for is the ability to instantiate the action based on its classname rather than a URL? > Therefore, using Spring or any other IoC framework having > Struts2 is unnecessary and you lost a lot of performance [...] S2 uses (a version of) Guice to do its IoC/DI by default. I also think you're over-estimating the performance penalties of Spring (for example). Dave - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How to make three text boxes appear in one row using struts2 tags?
Hey! Thanks a lot. :-) --- On Mon, 12/8/08, Dave Newton <[EMAIL PROTECTED]> wrote: From: Dave Newton <[EMAIL PROTECTED]> Subject: Re: How to make three text boxes appear in one row using struts2 tags? To: "Struts Users Mailing List" Date: Monday, December 8, 2008, 7:47 AM --- On Mon, 12/8/08, taj uddin <[EMAIL PROTECTED]> wrote: > Thank u for ur suggestion. As given, the application is > able to display three boxes(textfields) in one row but how > to append label name( phonenumber) and hyphens(-) b/w the > textfields(boxes). (1) Use the text or label tag. (2) ... Put a hyphen between each textfield tag??? Dave - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How to make three text boxes appear in one row using struts2 tags?
--- On Mon, 12/8/08, taj uddin <[EMAIL PROTECTED]> wrote: > Thank u for ur suggestion. As given, the application is > able to display three boxes(textfields) in one row but how > to append label name( phonenumber) and hyphens(-) b/w the > textfields(boxes). (1) Use the text or label tag. (2) ... Put a hyphen between each textfield tag??? Dave - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: JSP tags calling action directives
Dave, Excuse me for insisting, but the problem of using is that you need to offer always it as url... In other words, 'yes' i need to call a service from the JSP without an action mapping that serves it and skip the intermediate layer, but also perhaps is necessary pass some request or session parameters to this service and they have not been necessary for the executed action. Any solution? I would want to insist that with Struts2 (as main difference with Struts1) you do not need an intermediate layer.. It has become unnecessary because you have lost the coupling with the kind of communication interface (in this case HTTP) and you could use your actions for instance, in a swing application. Therefore, using Spring or any other IoC framework having Struts2 is unnecessary and you lost a lot of performance because you need to use reflection twice (one for the action and another one for the service). In fact, when I used Struts1, I used the commons-chain library to make the same task as Struts 2 to call the command passing a map with all request and session parameters. Therefore, in general, only one action class was necessary in all the configuration, because this default action returns the result (put by the command) than gives the forward.. Thank you very much 2008/12/8 Dave Newton <[EMAIL PROTECTED]> > --- On Mon, 12/8/08, Raquel Pau Fernández wrote: > > I want to call services, but if I put the service in the > > action, at code level, the action must know(implicitly) > > what is the following content page. > > IMO the action should always be responsible for what's available in the > view, but that may just be me. > > I'm still not sure I like the idea of calling *action* code to get the data > that you want, though--I think it would be much cleaner to provide a > mechanism for accessing service instances in the JSP and skip the > intermediate layer. > > > I need to call an action code from a JSP page without > > becoming it an URL. I've not found that the framework > > could provide it because always calls an action that > > must be an URL. > > Again, while I don't think this is a good idea, it'd be easy enough to use > Codebehind and the tag to do this, although there are a few > potential "gotchas" with the action tag. > > > PD: Excuse me for my poor English. > > It's better than mine ;) > > Dave > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > -- Raquel Pau
Re: How to make three text boxes appear in one row using struts2 tags?
Hi, Thank u for ur suggestion. As given, the application is able to display three boxes(textfields) in one row but how to append label name( phonenumber) and hyphens(-) b/w the textfields(boxes). Here i used the label attribute in the textfield tag but the name was not being rendered as well the hyphens even. So, could u pls help me out --- On Mon, 12/8/08, Dave Newton <[EMAIL PROTECTED]> wrote: From: Dave Newton <[EMAIL PROTECTED]> Subject: Re: How to make three text boxes appear in one row using struts2 tags? To: "Struts Users Mailing List" Date: Monday, December 8, 2008, 6:55 AM The mailing list usually (always?) doesn't allow attachments. I feel, however, that I have understood the requirement of "three text boxes on a single row separated by hypens". You can use theme="simple" on each one to render only the textbox and build the rest of the form row manually. You'll need to do validation manually (which you'd probably want to do anyway for this composite field) and check for the presence of the "field" error manually. Dave --- On Mon, 12/8/08, taj uddin <[EMAIL PROTECTED]> wrote: > First please go through the attachment in which the rquired > GUI to be generated using struts2 tags was shown. > In > my application, the GUI should appear with three textfield > boxes > separated with hyphens(-), ("as shown in the > attachment")where each textfield boxes has unique > names. > > I'm working on the label PhoneNumber which displays > three boxes(one for STD code, second and third for phone > number prefix and suffix). Here three textfileds should have > the label name as PhoneNumber but each textfield or box is > of unique name. > Note: all the three boxes should appear in GUI separated by > hyphens. > I hope u have understood. > Pls help me in this issue > > > > > - > 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: JSP tags calling action directives
--- On Mon, 12/8/08, Raquel Pau Fernández wrote: > I want to call services, but if I put the service in the > action, at code level, the action must know(implicitly) > what is the following content page. IMO the action should always be responsible for what's available in the view, but that may just be me. I'm still not sure I like the idea of calling *action* code to get the data that you want, though--I think it would be much cleaner to provide a mechanism for accessing service instances in the JSP and skip the intermediate layer. > I need to call an action code from a JSP page without > becoming it an URL. I've not found that the framework > could provide it because always calls an action that > must be an URL. Again, while I don't think this is a good idea, it'd be easy enough to use Codebehind and the tag to do this, although there are a few potential "gotchas" with the action tag. > PD: Excuse me for my poor English. It's better than mine ;) Dave - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Can't get definitions factory from context
2008/12/5 Benjamin Dittwald <[EMAIL PROTECTED]>: > thanks for your help. i use tiles 2 now. with the common dependencies > includet in the distribution. > > now, my tomcat log says: > > 05.12.2008 16:05:23 org.apache.catalina.core.StandardContext listenerStart > SCHWERWIEGEND: Error configuring application listener of class > org.apache.tiles.web.startup.TilesListener > java.lang.ClassNotFoundException: org.apache.tiles.web.startup.TilesListener There was a bug with that, which version do you use? Regards -- Lukasz http://www.lenart.org.pl/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How to make three text boxes appear in one row using struts2 tags?
The mailing list usually (always?) doesn't allow attachments. I feel, however, that I have understood the requirement of "three text boxes on a single row separated by hypens". You can use theme="simple" on each one to render only the textbox and build the rest of the form row manually. You'll need to do validation manually (which you'd probably want to do anyway for this composite field) and check for the presence of the "field" error manually. Dave --- On Mon, 12/8/08, taj uddin <[EMAIL PROTECTED]> wrote: > First please go through the attachment in which the rquired > GUI to be generated using struts2 tags was shown. > In > my application, the GUI should appear with three textfield > boxes > separated with hyphens(-), ("as shown in the > attachment")where each textfield boxes has unique > names. > > I'm working on the label PhoneNumber which displays > three boxes(one for STD code, second and third for phone > number prefix and suffix). Here three textfileds should have > the label name as PhoneNumber but each textfield or box is > of unique name. > Note: all the three boxes should appear in GUI separated by > hyphens. > I hope u have understood. > Pls help me in this issue > > > > > - > 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]
More portlets in portlet-app
Hi list, I'm trying to get a grip on portlet development with struts and it would be great if someone can help me out! I'm using a Tomcat 6 application server icw a Liferay 5.1.2 portal. I've managed to get struts 1.3.8 portlets working through a struts bridge and now I want to start developing. My use case is the following: I need to generate a list of available applications that run at different locations. The content of this list is based on user attributes, but that is out of the context of this use case. When a link to an application is clicked it should pull up an application specific form containing input fields for all parameters necessary to run the application. Intuitively I'd say the list of applications is a single portlet, while the form represents a second portlet. There should be a parent class / portlet for the form that can handle submission. The portlet that lists the available applications needs to initialize the portlet that displays the form with specific parameters - it should tell the portlet which form to display. So, starting to develop, I put two portlets inside a single portlet-app definition in portlet.xml and I started with defining two actions, one to display the list of applications and one to display a sample form. But now I need to find a way to specify which portlet when the portlet-app is started. How would I do that? If you need some more information just let me know. Also, I'd be very interested in suggestions on the design of this use case! Thanks a bunch! Evert Lammerts
Re: JSP tags calling action directives
Yes, I want to call services, but if I put the service in the action, at code level, the action must know(implicitly) what is the following content page. In addition, if an action code has two URL and for each URL has to send different JSP content, your code must change or yo have to produce redundant code in other action. It produces that if the workflow changes, your code changes. You could also produce a chain of actions, but in my expirience, it produces a bad maintenance because, for instance, you loss the traceability between the code and the URL. Struts tutorials also says that it could produce an spagetti code. Consequently, I think that separating the workflow (actions) and the view (calling it in some way, the service) is better . (I have solved it in Struts 1 using a controller (now presented as view preparer) of the tiles framework). However, Struts2/Xwork implements the Command pattern without coupling with the HTTP interface. For this reason, I think that it is unnecessary two layers because the same framework offers the HTTP presentation/interface layer, and then the action is a service. Following these arguments, I need to call an action code from a JSP page without becoming it an URL. I've not found that the framework could provide it because always calls an action that must be an URL.. MAIN USE CASES: -Each action that produces a forward to the same JSP does not need to know what data is necessary to load for creating the page. -The action code can be used in any URL without changing the code to show any JSP. Thank you in advance. PD: Excuse me for my poor English. 2008/12/7 Dave Newton <[EMAIL PROTECTED]> > --- On Sun, 12/7/08, Raquel Pau Fernández wrote: > > I'm thinking about calling actions code (that perhaps they are not > > an URL and then they don't appear in the struts.xml) from JSP > > [...] > > For instance, in more than one page I could need the list > > of users in different formats (combobox, lists and so on) > > and perhaps I don't need to list them alone as an url > > 'userList.action'. > > [...] > > I'm not entirely sure I understand where you're coming from. > > The use-cases you describe sound like services. Service instances can be > properties of actions, thus exposed to the JSP. Arbitrary methods can be > called on action properties already. > > I'm not saying it's a bad idea, I just don't understand it or, so far, see > a need for it. > > Dave > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > -- Raquel Pau
Re: Cannot find bean in any scope
Hi, thanks very much for your help. I understood your explanation but I didn't solve. Now I did: but I still have: javax.servlet.ServletException: javax.servlet.jsp.JspException: Cannot find bean: "DVD" in any scope I'm missing something? Thanks Nils-Helge Garli wrote: > > From the taglib reference for "iterate" [1]: > > id - The name of a page scope JSP bean that will contain the current > element of the collection on each iteration, if it is not null. > > In your example, you have used id="dvds" which means that you would > have to use > Nils-H > > [1] - > http://struts.apache.org/1.3.8/struts-taglib/tagreference.html#logic:iterate > > On Sun, Dec 7, 2008 at 5:39 PM, gbattine <[EMAIL PROTECTED]> wrote: >> >> Hello guys, >> I'm newbie of Struts, please help me. >> I've an action that calls some business logic, retrieve a a list and set >> it >> into request, calling later a jsp, in which I try to show this list >> through >> iterate tag. >> >> this is jsp to show list >> >> <%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> >> <%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> >> >> >> >>JSP Page >> >> >>Ricerca film >> >> >> >> Titolo >> Regia >> Sceneggiatura >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> this is action that pass to list a list of dvds >> Collection c = new ArrayList(); >>try { >>c = manager.getAll(); >>} catch (DAOException e) { >>String message = "DVDs could not be listed"; >>errors.add("label", new ActionError("error.listfailed")); >>saveErrors(request, errors); >>return (mapping.findForward("error")); >> >> >>} >> session.setAttribute("dvds", c); >> >> >> besides dvd (shown in jsp) is a bean to show each item of dvds list. >> Instead of show jsp with list of dvd I've this error: >> >> javax.servlet.ServletException: javax.servlet.jsp.JspException: Cannot >> find >> bean: "DVD" in any scope >> >> How can I solve it? >> please help me, >> Thanks >> >> >> -- >> View this message in context: >> http://www.nabble.com/Cannot-find-bean-in-any-scope-tp20882790p20882790.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] > > > -- View this message in context: http://www.nabble.com/Cannot-find-bean-in-any-scope-tp20882790p20893064.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]
How to make three text boxes appear in one row using struts2 tags?
Hi, First please go through the attachment in which the rquired GUI to be generated using struts2 tags was shown. In my application, the GUI should appear with three textfield boxes separated with hyphens(-), ("as shown in the attachment")where each textfield boxes has unique names. I'm working on the label PhoneNumber which displays three boxes(one for STD code, second and third for phone number prefix and suffix). Here three textfileds should have the label name as PhoneNumber but each textfield or box is of unique name. Note: all the three boxes should appear in GUI separated by hyphens. I hope u have understood. Pls help me in this issue - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
How to represent three textfield boxes in one row?
Hi, In my application, the GUI should appear with three textfield boxes separated with hyphens(-), where each textfield boxes has unique names. I'm working on the label PhoneNumber which displays three boxes(one for STD code, second and third for phone number prefix and suffix). Here three textfileds should have the label name as PhoneNumber but each textfield or box is of unique name. Note: all the three boxes should appear in GUI separated by hyphens. I hope u have understood. Pls help me in this issue
Re: How to append a string to a label name?
Thnak U :-) --- On Mon, 12/8/08, Andras Balogh <[EMAIL PROTECTED]> wrote: From: Andras Balogh <[EMAIL PROTECTED]> Subject: Re: How to append a string to a label name? To: "Struts Users Mailing List" Date: Monday, December 8, 2008, 4:18 AM Hi, You need to add required="true" than Struts will add the "*" automatically. BR, Andras. taj uddin wrote: > Hi, > > In my application, the textfield label name should be appended with "*". I tried to add the string (*) to my label name using labelSeparator attribute. In my eclipse it shows the warning as "unknown attribut name(labelSeparator). Can u pls help me out in this issue. > > here (*) was added to my label name to indicate that this particular field is required to be filled. > > code: > > > > > > > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How to append a string to a label name?
Hi, You need to add required="true" than Struts will add the "*" automatically. BR, Andras. taj uddin wrote: Hi, In my application, the textfield label name should be appended with "*". I tried to add the string (*) to my label name using labelSeparator attribute. In my eclipse it shows the warning as "unknown attribut name(labelSeparator). Can u pls help me out in this issue. here (*) was added to my label name to indicate that this particular field is required to be filled. code: - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
How to append a string to a label name?
Hi, In my application, the textfield label name should be appended with "*". I tried to add the string (*) to my label name using labelSeparator attribute. In my eclipse it shows the warning as "unknown attribut name(labelSeparator). Can u pls help me out in this issue. here (*) was added to my label name to indicate that this particular field is required to be filled. code:
Re: Any issues with using OGNL ver 2.7.3
I've been using OGNL 2.7.2 with Struts 2.1.2 for a while and haven't noticed any problems. (*Chris*) On Sun, Dec 7, 2008 at 9:34 PM, Adam Ruggles <[EMAIL PROTECTED]> wrote: > > Are there any known issues with using OGNL 2.7.3 with Struts 2.1.2? > -- > View this message in context: > http://www.nabble.com/Any-issues-with-using-OGNL-ver-2.7.3-tp20889755p20889755.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] > >