Re: Context relative URL
looks like a basic javascript question to me but here goes anyway. Stop trying to put everything in the event context = c:url value=/ /; imgdir = context + /images/; //perhaps create an array to preload. images = [inico]; function mover(name) { document.images[name].src = imgdir + name +-over.gif; } function mout(name) { document.images[name].src = imgdir + name +.gif; } html:link page=/foo.do linkName=inicio onmouseover=mover('inicio') onmouseout=mout('inicio') .. On 16 Mar 2004, at 08:00, [EMAIL PROTECTED] wrote: Try using html:rewrite page='/images/inicial.gif'/ Subramaniam Olaganthan Tata Consultancy Services Mailto: [EMAIL PROTECTED] Website: http://www.tcs.com Joao Batistella [EMAIL PROTECTED] 03/16/2004 12:35 AM Please respond to Struts Users Mailing List [EMAIL PROTECTED] To 'Struts Users Mailing List' [EMAIL PROTECTED] cc Subject Context relative URL Hello! I have the following HTML img tag: html:img page=/images/inicial.gif border=0 onmouseover=this.src='/images/inicio-over.gif' onmousedown=this.src='/images/inicio-down.gif' onmouseout=this.src='/images/inicio.gif'/ The problem is that the page attribute is ok, img tag add the app context before de page attribute and the image appears. But the others images in the javascript events dosn't appear because struts doesn't put the app context before the address. I got the following HTML: img src=/myapp/images/inicio.gif border=0 onmouseover=this.src='/images/inicio-over.gif' onmouseout=this.src='/images/inicio.gif' onmousedown=this.src='/images/inicio-down.gif' How can I have this generated with all the images with myapp before the source of the image? Like this: img src=/myapp/images/inicio.gif border=0 onmouseover=this.src='/myapp/images/inicio-over.gif' onmouseout=this.src='/myapp/images/inicio.gif' onmousedown=this.src='/myapp/images/inicio-down.gif' Thanks, JP ForwardSourceID:NT6182 InterScan_Disclaimer.txt- 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]
AW: server side date validation
I guess if one really, really wanted to, one could perform the validation in java using something along the lines of the SimpleDateFormat class. Though I do see the advantage of letting the validator handle the chore for you. Andreas -Ursprüngliche Nachricht- Von: Anderson, James H [IT] [mailto:[EMAIL PROTECTED] Gesendet: Montag, 15. März 2004 22:26 An: Struts Users Mailing List Betreff: RE: server side date validation formset form name=ActivityViewForm field property=starting depends=date arg0 key=ActivityViewForm.starting.displayname/ var var-namedatePatternStrict/var-name var-valueMM/dd//var-value /var /field ... /form /formset -Original Message- From: Jignesh Patel [mailto:[EMAIL PROTECTED] Sent: Monday, March 15, 2004 2:04 PM To: Struts Users Mailing List Subject: server side date validation Can anybody give me example code to validate date towards server side? -Jignesh - 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: validation
ok, trying that on my machine (struts 1.1) ..at least bean:message bundle=alternate does find it ..no bundle attribute in field tag in this version ..there's a bundle attribute in the msg tag ..and it's plainly ignored looks like a bug to me. ok, spent enough time on this... hm in the commons they claim to be past version 1.1 ... though can't see any related resource there Frank, could you please check if the bug is in the bugtracker and if not, file it?? And ask the validator people for putting the release on the server (and please tell me if they did ;). tschüss derweil, Axel On 2004-03-16 at 08:29:11 +0100, Otto, Frank wrote: Sorry, I use struts 1.1, but commons-validaton is version 1.0.2 -Ursprüngliche Nachricht- Von: Axel Gross [mailto:[EMAIL PROTECTED] Gesendet: Dienstag, 16. März 2004 08:22 An: Struts Users Mailing List Betreff: Re: validation hi! I don't if you problem is related to your version, do you really need struts 1.0? struts 1.1 you'll find under: http://jakarta.apache.org/site/binindex.cgi On 2004-03-16 at 07:50:22 +0100, Otto, Frank wrote: Thanks for your answer, but it doesn't function. I use struts-validation 1.0.2. Perhaps is this the problem? I don't find a newer version on jakarte site. With nightly build it didn't validate my form. The same proplem I have with struts-config.xml. If I use bundle=alternate in my action definitions, it will not be used. -Ursprüngliche Nachricht- Von: Shobhana.S, ASDC Chennai [mailto:[EMAIL PROTECTED] Gesendet: Montag, 15. März 2004 13:43 An: Struts Users Mailing List Betreff: RE: validation you can hve more than one resource bundle ..In struts-config file: ~ message-resources parameter=org.apache.struts.webapp.example.ApplicationResources/ message-resources parameter=org.apache.struts.webapp.example.AlternateApplicationResources key=alternate /message-resources Then in validation.xml u can give like this for a specific form-field a seperate resource bundle: field property=password depends=required, minlength,maxlength bundle=alternate and for otheres it will take the default bundle: applicationresources.. Shobhana -Original Message- From: Otto, Frank [mailto:[EMAIL PROTECTED] Sent: Monday, March 15, 2004 6:08 PM To: Struts-User (E-Mail) Subject: validation Hi, is there any possibility to use another resource bundle in validaton.xml? Or can I set somewhere which resources validation should use? Regards, Frank - 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]
using Two struts-config
Hello, I want to use two different struts-config files for my Admin and other for main site. How can I do that. I have made changes in web.xml file declared two diffferent servlets but it is working for one site not for other... i don't know why?? and giving me error like nvalid path /Login was requested The request sent by the client was syntactically incorrect (Invalid path /Login was requested). Pls help..
AW: using Two struts-config
Hi, use the web.xml in this way: servlet servlet-namexyz/servlet-name servlet-classxyz.CAppActionServlet/servlet-class init-param param-nameconfig/param-name param-value/WEB-INF/struts-config-1.xml, /WEB-INF/struts-config-2.xml, /WEB-INF/struts-config-3.xml/param-value /init-param ... Regards, Frank -Ursprüngliche Nachricht- Von: Raman [mailto:[EMAIL PROTECTED] Gesendet: Dienstag, 16. März 2004 10:02 An: Struts Users Mailing List Betreff: using Two struts-config Hello, I want to use two different struts-config files for my Admin and other for main site. How can I do that. I have made changes in web.xml file declared two diffferent servlets but it is working for one site not for other... i don't know why?? and giving me error like nvalid path /Login was requested The request sent by the client was syntactically incorrect (Invalid path /Login was requested). Pls help.. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: using Two struts-config
Nopes... This is not working with me.. and giving me message Servlet action is currently unavailable description The requested service (Servlet action is currently unavailable) is not currently available. servlet servlet-nameaction/servlet-name descriptionApplication's Front Controller/description servlet-classorg.apache.struts.action.ActionServlet/servlet-class init-param param-nameconfig/param-name param-value/WEB-INF/struts-config.xml, /WEB-INF/struts-config1.xml/param-value /init-param init-param param-namedebug/param-name param-value0/param-value /init-param init-param param-namedetail/param-name param-value0/param-value /init-param load-on-startup2/load-on-startup /servlet servlet-mapping servlet-nameaction/servlet-name url-pattern*.do/url-pattern /servlet-mapping Initially I have declared two servlet tags with names action and action1 and in mapping changed *.do for action and *.do1 for action1 servlet but that too was not picking up.. -- Raman - Original Message - From: Otto, Frank [EMAIL PROTECTED] To: 'Struts Users Mailing List' [EMAIL PROTECTED] Sent: Tuesday, March 16, 2004 2:41 PM Subject: AW: using Two struts-config Hi, use the web.xml in this way: servlet servlet-namexyz/servlet-name servlet-classxyz.CAppActionServlet/servlet-class init-param param-nameconfig/param-name param-value/WEB-INF/struts-config-1.xml, /WEB-INF/struts-config-2.xml, /WEB-INF/struts-config-3.xml/param-value /init-param ... Regards, Frank -Ursprüngliche Nachricht- Von: Raman [mailto:[EMAIL PROTECTED] Gesendet: Dienstag, 16. März 2004 10:02 An: Struts Users Mailing List Betreff: using Two struts-config Hello, I want to use two different struts-config files for my Admin and other for main site. How can I do that. I have made changes in web.xml file declared two diffferent servlets but it is working for one site not for other... i don't know why?? and giving me error like nvalid path /Login was requested The request sent by the client was syntactically incorrect (Invalid path /Login was requested). Pls help.. - 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: RE: Debug ON/OFF
In your web.xml, for Action servlet the following init params will be declared. Give them a value greater than 0 to make it ON and 0 to OFF. init-param param-namedebug/param-name param-value0/param-value /init-param init-param param-namedetail/param-name param-value0/param-value /init-param I am not using logging yet. Struts is using I think Log4j. Which is in commonsLogging.jar. If I want to make debug statements of struts programms on or off what should I do? Shashank S. Dixit Cognizant Technology Solutions Pvt. Ltd. Hinjewadi, Pune Mobile : 98904 25400 An Obstacle is something you see when you take your eyes off the goal. -Original Message- From: kishor Patil [mailto:[EMAIL PROTECTED] Sent: Monday, 1 March 2004 7:12 PM To: 'Struts Users Mailing List' Subject: RE: Debug ON/OFF Hi Shashank, First check out which logging tools you are using. By default the commomns-logging uses hte Simple-Logging. If you are using the log4j for logging purpose, then check out the log4j.properties file. If there is no properties then add one overridding the default setting. thanks and regards kishor -Original Message- From: Dixit, Shashank (Cognizant) [mailto:[EMAIL PROTECTED] Sent: Monday, March 01, 2004 1:27 PM To: [EMAIL PROTECTED] Subject: Debug ON/OFF Hi All Anybody knows how to make debug on/off to make on/off struts-logging messages. I couldn't see any xml file for struts logging, Pls tell me how to make debug ON or OFF. Shashank S. Dixit Cognizant Technology Solutions Pvt. Ltd. Hinjewadi, Pune Mobile : 98904 25400 An Obstacle is something you see when you take your eyes off the goal. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Using XSLT on an xsl JSP
Hi My requirement is to process a JSp template using xalan and direct the transformed output to the JSP servlet engine. XSL/XML - JSP - HTML is this possible?? also i was planning to use the jsp:include tag eg jsp:include page=http://127.0.0.1:9080/XSLTServlet; / This would give a transformed page. is this ok?? Now when i started doing the basic transformation on an xsl derived from a JSP PAge came across an error The prefix bean for element bean:message is not bound. can this be resolved. regards Alan The XSL is as follows ?xml version=1.0? xsl:stylesheet xmlns:xsl=http://www.w3.org/1999/XSL/Transform; version=1.0 xmlns:xalan=http://xml.apache.org/xslt; xsl:output method=html/ xsl:template match=/ html headtitle/title/head bodytable tr valign=bottom td style=width: 145 px;span class=labelitem bean:message key=label.views//spanbr/ td valign=top style=width: 85 px; padding-left: 2 px;span class=labelitem bean:message key=label.dateRated/ /spanbr/ span class=normalitemxsl:value-of select=/DATA/DATE//span/td td valign=top style=width: 216 px;span class=labelitembean:message key=label.ratingCo//spanbr/ span class=normalitemxsl:value-of select=/DATA/COMPANY//span/td td valign=top style=width: 126 px;span class=labelitembean:message key=label.username//spanbr/ span class=normalitemxsl:value-of select=/DATA/USER//span/td td valign=top style=width: 146 px;span class=labelitembean:message key=label.expiringContractNo//spanbr/ span class=normalitemxsl:value-of select=/DATA/NUMBER//span/td /tr /table /body /html /xsl:template /xsl:stylesheet MASTEK Making a valuable difference Mastek in NASSCOM's 'India Top 20' Software Service Exporters List. In the US, we're called MAJESCO ~~ Opinions expressed in this e-mail are those of the individual and not that of Mastek Limited, unless specifically indicated to that effect. Mastek Limited does not accept any responsibility or liability for it. This e-mail and attachments (if any) transmitted with it are confidential and/or privileged and solely for the use of the intended person or entity to which it is addressed. Any review, re-transmission, dissemination or other use of or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. This e-mail and its attachments have been scanned for the presence of computer viruses. It is the responsibility of the recipient to run the virus check on e-mails and attachments before opening them. If you have received this e-mail in error, kindly delete this e-mail from all computers. ~~ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
html:link vs. html:submit vs. input
The JSP code below prints out a nice list of company names, with links called Edit and Delete which call a suitable form with a pair of parameters, one being the action, the other being an identifying property of the company to played with. logic:iterate name=CompanyProfile property=candidateSystems id=aSystem bean:write name=aSystem property=fullName/ % // Assemble a hashmap of args for the html:link java.util.HashMap editMap = new java.util.HashMap(); java.util.HashMap delMap = new java.util.HashMap(); editMap.put(action, Edit); editMap.put(system, ((CandidateSystem) aSystem).getFullName()); delMap.put(action, Delete); delMap.put(system, ((CandidateSystem) aSystem).getFullName()); pageContext.setAttribute(editMap, editMap); pageContext.setAttribute(delMap, delMap); % html:link page=/editCompanySystem.do name=editMapbean:message key=button.edit//html:link html:link page=/editCompanySystem.do name=delMapbean:message key=button.delete//html:link /logic:iterate It all works fine, but I'd much rather have two proper buttons, rather than links. Is this even possible? Regards, Stuart McGrigor - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Pls help
Hi All I have a shopping cart apps.The user is buying items it is coming to my cart .In my mycart page I am showing all the products and the beside that I have a update button by which I can update the quantity of my each item which is in a textbox.I am follwing struts for that.My text box name is same in each time.if its name is quantity in servlet I am getting an array of quantity.But when I am coming to the same page its showing value=[Ljava.lang.String;@1765ae which is the reference of my string array.How to get the original value Thanks Sougata - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
To Access DynaActionForm from EJB?
i am using DynaActionForm in my application. Now I need to set the properties of my DynaActionForm from within my EJB,i need to knnow the code for accesssing my DynaActionForm from EJB that has already been accesed by Action class and contains values. Thanks in advance. Regards, Farrukh Naqvi. 15 Mbytes Free Web-based and POP3 Sign up now: http://www.gawab.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: What is the best way to pass a parameter to a forward?
It's funny that you say that it will not work, because it does for me, and without throwing any exceptions. That being said, your point about modifying an action mappings forwards is a good one. It is unfortunate that the ActionForward class doesn't have a copy constructor -- Jay Glanville -Original Message- From: news [mailto:[EMAIL PROTECTED] On Behalf Of Martin Cooper Sent: Monday, March 15, 2004 8:30 PM To: [EMAIL PROTECTED] Subject: Re: What is the best way to pass a parameter to a forward? What you are doing will not work - at least, not the way you are doing it. You are trying to modify the ActionForward instance that is owned by Struts, and calling setPath() on that instance will result in an IllegalStateException. You need to create your own ActionForward instance, instead of trying to modify Struts' one. You can do that with something like this: ActionForward goto = mapping.findForward( success ); String path = ...; // Put together your new path ActionForward myGoto = new ActionForward(path, goto.getRedirect()); return myGoto; -- Martin Cooper Glanville, Jay [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] I'm trying to solve a problem, but I'm not sure my solution is the best way. Basically, I want to set a parameter on a forward within the action's execute. I'm in my action's execute method. I've just successfully performed some work, and I now want to forward/redirect to the next page. So, I've got some code that looks like this: public ActionForward execute(ActionMapping.) { // do some work ActionForward goto = mapping.findForward( success ); return goto; } With an action mapping that looks like this: action path=/EntrySave type=com.package.EntrySaveAction name=EntryForm validate=true input=/Entry.do forward name=success redirect=true path=/Container.do/ forward name=failure redirect=false path=/Entry.do / /action Basically, if I left the EntrySaveAction.execute do what's doing right now, then upon successful completion, it would redirect to /Container.do. However, what I want it to do is redirect to /Container.do?id=45, where 45 is the id of the container that I want to go to. The value of 45 is dynamic, and is know at the time of the EntrySaveAction.execute command. The way I'm currently doing it is something like this: public ActionForward execute(ActionMapping.) { // do some work ActionForward goto = mapping.findForward( success ); String path = goto.getPath(); path += ?id= + container.getId(); goto.setPath( path ); return goto; } Is this the correct way to do this? Is there a better way? Thanks in advance JDG -- Jay Glanville - 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: [OT] Jericho == Struts 2.0?
On Mon, 15 Mar 2004 13:07:10 -0800, Nadeem Bitar wrote: Which role will struts play when JSF matures, and JSF 2.0 is released is what interests me more than the proposed name of struts 2.0. Struts will be whatever the community needs it to be. The Struts-JSF taglib Craig put together demonstrates that it's not an either/or proposition. Even today, not every application needs to use Struts. For smaller, simpler applications a Model 1 approach works just fine. With JSF, many moderate-sized applications might not need Struts either. But, in my experience, large, complex applications do need front controllers. Even Microsoft admits that now. The next generation of .NET (Whidbey) will include a front controller out of the box. The core role of Struts has always been to provide missing pieces that help enterprise developers connect the dots. As we discover what JSF is missing, we can help provide those pieces too. Same old, same old :) -Ted. Developing Web Applications Using Open Source Tools Saturday, 3 Apr 2004, New York City http://basebeans.com/do/website - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
SV: What is the best way to pass a parameter to a forward? Create a utility class
Some time ago this question has been asked before and someone showed some utility class code. I used the code and created a class like this: import java.util.HashMap; import java.util.Hashtable; import java.util.Iterator; import java.util.Map; import org.apache.struts.action.ActionForward; /** * Simple utility class to add parameters to an ActionForward * from within an action. This action is useful when you from * within an action need to pass parameters to the jsp page or another action * you are forwarding to. */ public class ActionForwardParameters { /** * Encupsulates parameters for ActionForward. */ private Map params = new HashMap(); /** * add all the parameters and values from the hashtable to the actionforward * @param parametersValues a hastable with key value pairs * @return ActionForwardParameters object */ public ActionForwardParameters add(Hashtable parametersValues) { for(Iterator i = parametersValues.keySet().iterator();i.hasNext();){ String key = (String) i.next(); params.put(key,(String) parametersValues.get(key)); } return this; } /** * Add parameters to provided ActionForward * @param forward ActionForward to add parameters to * @return ActionForward with added parameters to URL */ public ActionForward forward(ActionForward forward) { StringBuffer path = new StringBuffer(forward.getPath()); Iterator iter = params.entrySet().iterator(); if (iter.hasNext()) { //add first parameter, if avaliable Map.Entry entry = (Map.Entry) iter.next(); path.append(? + entry.getKey() + = + entry.getValue()); //add other parameters while (iter.hasNext()) { entry = (Map.Entry) iter.next(); path.append( + entry.getKey() + = + entry.getValue()); } } return new ActionForward(path.toString()); } } Please note that I didn't come up with the idea of this class, I simply created the class after reading the information that a fellow programmer Provided.! -Oprindelig meddelelse- Fra: Jay Glanville [mailto:[EMAIL PROTECTED] Sendt: 16. marts 2004 13:13 Til: 'Struts Users Mailing List' Emne: RE: What is the best way to pass a parameter to a forward? It's funny that you say that it will not work, because it does for me, and without throwing any exceptions. That being said, your point about modifying an action mappings forwards is a good one. It is unfortunate that the ActionForward class doesn't have a copy constructor -- Jay Glanville -Original Message- From: news [mailto:[EMAIL PROTECTED] On Behalf Of Martin Cooper Sent: Monday, March 15, 2004 8:30 PM To: [EMAIL PROTECTED] Subject: Re: What is the best way to pass a parameter to a forward? What you are doing will not work - at least, not the way you are doing it. You are trying to modify the ActionForward instance that is owned by Struts, and calling setPath() on that instance will result in an IllegalStateException. You need to create your own ActionForward instance, instead of trying to modify Struts' one. You can do that with something like this: ActionForward goto = mapping.findForward( success ); String path = ...; // Put together your new path ActionForward myGoto = new ActionForward(path, goto.getRedirect()); return myGoto; -- Martin Cooper Glanville, Jay [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] I'm trying to solve a problem, but I'm not sure my solution is the best way. Basically, I want to set a parameter on a forward within the action's execute. I'm in my action's execute method. I've just successfully performed some work, and I now want to forward/redirect to the next page. So, I've got some code that looks like this: public ActionForward execute(ActionMapping.) { // do some work ActionForward goto = mapping.findForward( success ); return goto; } With an action mapping that looks like this: action path=/EntrySave type=com.package.EntrySaveAction name=EntryForm validate=true input=/Entry.do forward name=success redirect=true path=/Container.do/ forward name=failure redirect=false path=/Entry.do / /action Basically, if I left the EntrySaveAction.execute do what's doing right now, then upon successful completion, it would redirect to /Container.do. However, what I want it to do is redirect to /Container.do?id=45, where 45 is the id of the container that I want to go to. The value of 45 is dynamic, and is know at the time of the EntrySaveAction.execute command. The way I'm currently doing it is something like this: public ActionForward execute(ActionMapping.) { // do some work ActionForward goto =
SV: What is the best way to pass a parameter to a forward? Create a utility class .Client code
Forgot to show the code how to use it! In your action you should not return return mapping.findForward(bla) but Hashtable a = new Hashtable();//add what ever key/value pairs you need return new ActionForwardParameters().add(a).forward(mapping.findForward(success)) ; -Oprindelig meddelelse- Fra: Tommy Holm - TELMORE Sendt: 16. marts 2004 13:48 Til: Struts Users Mailing List Emne: SV: What is the best way to pass a parameter to a forward? Create a utility class Some time ago this question has been asked before and someone showed some utility class code. I used the code and created a class like this: import java.util.HashMap; import java.util.Hashtable; import java.util.Iterator; import java.util.Map; import org.apache.struts.action.ActionForward; /** * Simple utility class to add parameters to an ActionForward * from within an action. This action is useful when you from * within an action need to pass parameters to the jsp page or another action * you are forwarding to. */ public class ActionForwardParameters { /** * Encupsulates parameters for ActionForward. */ private Map params = new HashMap(); /** * add all the parameters and values from the hashtable to the actionforward * @param parametersValues a hastable with key value pairs * @return ActionForwardParameters object */ public ActionForwardParameters add(Hashtable parametersValues) { for(Iterator i = parametersValues.keySet().iterator();i.hasNext();){ String key = (String) i.next(); params.put(key,(String) parametersValues.get(key)); } return this; } /** * Add parameters to provided ActionForward * @param forward ActionForward to add parameters to * @return ActionForward with added parameters to URL */ public ActionForward forward(ActionForward forward) { StringBuffer path = new StringBuffer(forward.getPath()); Iterator iter = params.entrySet().iterator(); if (iter.hasNext()) { //add first parameter, if avaliable Map.Entry entry = (Map.Entry) iter.next(); path.append(? + entry.getKey() + = + entry.getValue()); //add other parameters while (iter.hasNext()) { entry = (Map.Entry) iter.next(); path.append( + entry.getKey() + = + entry.getValue()); } } return new ActionForward(path.toString()); } } Please note that I didn't come up with the idea of this class, I simply created the class after reading the information that a fellow programmer Provided.! -Oprindelig meddelelse- Fra: Jay Glanville [mailto:[EMAIL PROTECTED] Sendt: 16. marts 2004 13:13 Til: 'Struts Users Mailing List' Emne: RE: What is the best way to pass a parameter to a forward? It's funny that you say that it will not work, because it does for me, and without throwing any exceptions. That being said, your point about modifying an action mappings forwards is a good one. It is unfortunate that the ActionForward class doesn't have a copy constructor -- Jay Glanville -Original Message- From: news [mailto:[EMAIL PROTECTED] On Behalf Of Martin Cooper Sent: Monday, March 15, 2004 8:30 PM To: [EMAIL PROTECTED] Subject: Re: What is the best way to pass a parameter to a forward? What you are doing will not work - at least, not the way you are doing it. You are trying to modify the ActionForward instance that is owned by Struts, and calling setPath() on that instance will result in an IllegalStateException. You need to create your own ActionForward instance, instead of trying to modify Struts' one. You can do that with something like this: ActionForward goto = mapping.findForward( success ); String path = ...; // Put together your new path ActionForward myGoto = new ActionForward(path, goto.getRedirect()); return myGoto; -- Martin Cooper Glanville, Jay [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] I'm trying to solve a problem, but I'm not sure my solution is the best way. Basically, I want to set a parameter on a forward within the action's execute. I'm in my action's execute method. I've just successfully performed some work, and I now want to forward/redirect to the next page. So, I've got some code that looks like this: public ActionForward execute(ActionMapping.) { // do some work ActionForward goto = mapping.findForward( success ); return goto; } With an action mapping that looks like this: action path=/EntrySave type=com.package.EntrySaveAction name=EntryForm validate=true input=/Entry.do forward name=success redirect=true path=/Container.do/ forward name=failure redirect=false path=/Entry.do / /action Basically, if I left the EntrySaveAction.execute do what's doing right
RE: using Two struts-config
Frank is correct; we're doing it the same way, with nearly 20 struts config files (and tiles def files) to help organize things. Try it without the space between the comma and the next entry, e.g.: param-value/WEB-INF/struts-config.xml,/WEB-INF/struts-config1.xml/param-value -Original Message- From: Raman [mailto:[EMAIL PROTECTED] Sent: Tuesday, March 16, 2004 4:25 AM To: Struts Users Mailing List Subject: Re: using Two struts-config Nopes... This is not working with me.. and giving me message Servlet action is currently unavailable description The requested service (Servlet action is currently unavailable) is not currently available. servlet servlet-nameaction/servlet-name descriptionApplication's Front Controller/description servlet-classorg.apache.struts.action.ActionServlet/servlet-class init-param param-nameconfig/param-name param-value/WEB-INF/struts-config.xml, /WEB-INF/struts-config1.xml/param-value /init-param init-param param-namedebug/param-name param-value0/param-value /init-param init-param param-namedetail/param-name param-value0/param-value /init-param load-on-startup2/load-on-startup /servlet servlet-mapping servlet-nameaction/servlet-name url-pattern*.do/url-pattern /servlet-mapping Initially I have declared two servlet tags with names action and action1 and in mapping changed *.do for action and *.do1 for action1 servlet but that too was not picking up.. -- Raman - Original Message - From: Otto, Frank [EMAIL PROTECTED] To: 'Struts Users Mailing List' [EMAIL PROTECTED] Sent: Tuesday, March 16, 2004 2:41 PM Subject: AW: using Two struts-config Hi, use the web.xml in this way: servlet servlet-namexyz/servlet-name servlet-classxyz.CAppActionServlet/servlet-class init-param param-nameconfig/param-name param-value/WEB-INF/struts-config-1.xml, /WEB-INF/struts-config-2.xml, /WEB-INF/struts-config-3.xml/param-value /init-param ... Regards, Frank -Ursprüngliche Nachricht- Von: Raman [mailto:[EMAIL PROTECTED] Gesendet: Dienstag, 16. März 2004 10:02 An: Struts Users Mailing List Betreff: using Two struts-config Hello, I want to use two different struts-config files for my Admin and other for main site. How can I do that. I have made changes in web.xml file declared two diffferent servlets but it is working for one site not for other... i don't know why?? and giving me error like nvalid path /Login was requested The request sent by the client was syntactically incorrect (Invalid path /Login was requested). Pls help.. - 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: Fundamental Struts Concept
The reason I ask is that since it is my understanding that either a new Action Form is created when the user submits the form or if one already exists it is reset, how can the Action Form have all of the original data, including the one or 2 fields the user just submitted? The ActionForm won't have all the original data, just what was submitted on the form, including any hidden fields. Unless, as you say, it's in session scope. (Also note that reset does nothing by default. So it only clears what *you* tell it to clear.) If you need to redisplay the form, say because validation fails, then put an Action in front of the page that will populate the controls (and nothing else). Where ever you have a reference to that page, even in the configuration, put a reference to the Action instead. On the DEV list, we've started to call these PageControllers or PageLoaders. The idea is that a business Action may be able to choose between several display pages. But, that Action doesn't need to know what controls are on a given page. All a business action should know is the logical name. A PageLoader Action serves as the page's proxy. It knows how to populate a certain page's controls, but it doesn't know anything about setting the control's default value. That's left to the ActionForm, which may have been pre-populated from the request or by a business Action. Generally, the PageLoader should also forward only to success and not make navigational decisions. (One possible exception being choosing between localized versions of the same page -- but that's another discussion.) Note that we don't consider this action chaining since the PageLoader Action is the page's proxy. It doesn't branch off to some other action to continue the business operation. Most of still recommend using a single business action that fulfills the request and selects a resource to complete the response. In this case, the resource completing the response is the PageLoader Action working directly with the server page. (Consider them a couple.) It's important to note that you don't *need* to put lists that populate controls on the ActionForm. The lists can also exist on a separate object (or objects) separate from the ActionForm. In fact, in a post 1.1 world, I'd recommend using a separate chrome bean to populate select boxes and such. You can then use DynaActionForms to represent only The ActionForm can then represent only the input fields on the form. Under Struts 1.0, I tended to use coarse-grained ActionForms that represented a series of related ActionForms (or even all the ActionForms in the application). And, I used to embed the lists for the controls too. But this was mainly to make conventional ActionForms easier to maintain. Post 1.1, I tend to use finely-grained, single-use DynaActionForms that represent the output of a given page, and then put the lists and such on a separate bean. HTH, Ted. Developing Web Applications Using Open Source Tools Saturday, 3 Apr 2004, New York City http://basebeans.com/do/website On Sun, 14 Mar 2004 15:31:32 -0500, Ed Tornick wrote: Let's assume you have a Action Form with much data, including lists (you are using nested tags for example). When you create the Action Form you load it up with the data from your data source wherever it is. Let's also assume that you have set the action path in the configuration file so that the scope of this form is request. If the jsp on the server that is going to create your form on the client has only a few of the fields from the Action Form then how much data is actually sent to the client in the httpRequest? The reason I ask is that since it is my understanding that either a new Action Form is created when the user submits the form or if one already exists it is reset, how can the Action Form have all of the original data, including the one or 2 fields the user just submitted? If the scope was session then it would make sense to me that the data would still be on the server and the users input would just modify a few fields.. but when it is request scope...This is what I don't understand. As you can see, probably a very fundamental question but it is key to me understanding what is going on. Thanks in advance for your input.. Ed - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Struts Depolyment in Weblogic Query.
HI, How to Deploy the struts framwork in weblogicApplication server7.0. Give with an example and procedure. Thanx, balaji Do you Yahoo!? Yahoo! Mail - More reliable, more storage, less spam
RE: using Two struts-config
On Tue, 16 Mar 2004 08:03:10 -0500, [EMAIL PROTECTED] wrote: Frank is correct; we're doing it the same way, with nearly 20 struts config files (and tiles def files) to help organize things. Try it without the space between the comma and the next entry, e.g.: param-value/WEB-INF/struts-config.xml,/WEB-INF/struts- config1.xml/param-value I've started to use more and config files too. On one team, we started to call it config-behind-story. The idea is that most use-cases (or stories) correspond to a discrete set of ActionForms and ActionMappings. It can be much easier to understand how these elements work together when the are in a file of their own. We give each story a symbolic name (like InsertPermit) and then try to keep using this symbol throughout, as kind of a metaphor. Of course, there are shared configuration files too. But separating the shared from the single-use also helps to clarify intent. Meanwhile, whether whitespace makes a difference might depend on the parser. I've put them on a separate line with no problem using Tomcat 4.x and 1.4. Just be sure there's a comma after each one save the last. -Ted. Developing Web Applications Using Open Source Tools Saturday, 3 Apr 2004, New York City http://basebeans.com/do/website - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Struts Depolyment in Weblogic Query
HI, How to Deploy the struts framwork in weblogicApplication server7.0. Give with an example and procedure. Thanx, Do you Yahoo!? Yahoo! Mail - More reliable, more storage, less spam
HI All Regarding Struts Depolyment in Weblogic
HI, How to depoly struts in weblogicApplications erver7.0 Give with an example and proecdure. Tx, balaji Do you Yahoo!? Yahoo! Mail - More reliable, more storage, less spam
Struts Depolyment in Weblogic Query
HI, How to Deploy the struts framwork in weblogicApplication server7.0. Give with an example and procedure. Thanx, balaji Do you Yahoo!? Yahoo! Mail - More reliable, more storage, less spam
RE: Struts Depolyment in Weblogic Query
I think one request would have sufficed! I haven't used Struts with WL, but check out the BEA newsgroup devoted to Struts at: http://newsgroups.bea.com/cgi-bin/dnewsweb?cmd=xovergroup=weblogic.developer.interest.portal.strutsutag= -Original Message- From: jbalaji [mailto:[EMAIL PROTECTED] Sent: Tuesday, March 16, 2004 8:45 AM To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: Struts Depolyment in Weblogic Query HI, How to Deploy the struts framwork in weblogicApplication server7.0. Give with an example and procedure. Thanx, balaji Do you Yahoo!? Yahoo! Mail - More reliable, more storage, less spam - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: using Two struts-config
Ted Husted wrote: On Tue, 16 Mar 2004 08:03:10 -0500, [EMAIL PROTECTED] wrote: Frank is correct; we're doing it the same way, with nearly 20 struts config files (and tiles def files) to help organize things. Try it without the space between the comma and the next entry, e.g.: param-value/WEB-INF/struts-config.xml,/WEB-INF/struts- config1.xml/param-value I've started to use more and config files too. On one team, we started to call it config-behind-story. The idea is that most use-cases (or stories) correspond to a discrete set of ActionForms and ActionMappings. It can be much easier to understand how these elements work together when the are in a file of their own. We give each story a symbolic name (like InsertPermit) and then try to keep using this symbol throughout, as kind of a metaphor. Of course, there are shared configuration files too. But separating the shared from the single-use also helps to clarify intent. I've just started using Struts on something that will eventually become a fairly large project. We were looking at using modules to break things up, but I haven't actually tried it yet. Can you explain how this config-behind-story approach compares to using modules? In my project, I want to avoid having huge config files, but I'd like the application to treat all ActionForms and ActionMappings the same way regardless of which config file they come from. Eventually, I may want to re-use parts of the configuration in multiple web apps. Would this approach be good for that, or would it make more sense to look at setting up modules? Any tips would be appreciated. -Beth - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: [OT] Search string tokenizer
I wrote some code to do this for an open-source project on sf.net an eon or two ago, before the regex packages matured. You can probably enhance what I wrote with regex, but it's at least a starting point... http://cvs.sourceforge.net/viewcvs.py/omd/java/coruscant/omd/util/StringSear cher.java?rev=1.2view=markup Anyway, what the code does is split the input into lists (ok, so I used vectors, I was still learning Java!) of 3 types: required present (i.e. +) , required absent (i.e. -), and optional terms. In short, the yahoo search style. Usage: 1) call setCriteriaString (passing your user search input) 2) call compareString (passing the content to search/validate) In your case, since you're going to pass the search criteria to SQL, you can probably just use the tokeinzing logic and add some getters for the criteria lists... David Hibbs, ACS Staff Programmer / Analyst American National Insurance Company -Original Message- From: Robert Taylor [mailto:[EMAIL PROTECTED] Sent: Monday, March 15, 2004 3:20 PM To: [EMAIL PROTECTED] Subject: [OT] Search string tokenizer I did a google search on this and didn't really come up with anything useful. Before I implement this myself, is there an existing implementation of parsing a search string which would produce tokens similar to how Google or other search engines parse search strings. For example, I would like to parse a search string into tokens where tokens are delimited by either a blank space or a quoted phrase. So the string: 'Struts web presentation tier' would return 2 tokens: - Struts - web presentation tier but the string: 'Struts web presentation tier' would return 4 tokens: - Struts - web - presentation - tier Any help is appreciated. robert - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Does Tiles has performance?
Anybody can tell me if using Tiles in an application make it slower? is there a way to make this better? Thanks, JP
Struts: Session Serialization
Hello everybody! I have noticed that my Struts integration always tries to serialize existing sessions on undeploy of my webapp. I started my webapp with the default that came with the struts-blank.war. This serialization fails with WriteAbortedException cause some of my session-attributes are not Serializable (don't implement it). So my questions is, either: How do I prevent these Exceptions (like turning off Session-Serialization in cfg)? Or should I add Serializable to my not-serializable attributes, and what would be the benefit of that?? Thx for the help! Tim ___ Tim Adler, Abt. SDA1 Adress Management Solutions AZ | Direct Carl-Bertelsmann Straße 161s D-33311 Gütersloh Tel.: 05241/ 80 - 89574 [EMAIL PROTECTED]
RE: [OT] Search string tokenizer
Cool! I'll take a look. Thanks David. robert -Original Message- From: Hibbs, David [mailto:[EMAIL PROTECTED] Sent: Tuesday, March 16, 2004 9:20 AM To: 'Robert Taylor'; [EMAIL PROTECTED] Subject: RE: [OT] Search string tokenizer I wrote some code to do this for an open-source project on sf.net an eon or two ago, before the regex packages matured. You can probably enhance what I wrote with regex, but it's at least a starting point... http://cvs.sourceforge.net/viewcvs.py/omd/java/coruscant/omd/util/StringSear cher.java?rev=1.2view=markup Anyway, what the code does is split the input into lists (ok, so I used vectors, I was still learning Java!) of 3 types: required present (i.e. +) , required absent (i.e. -), and optional terms. In short, the yahoo search style. Usage: 1) call setCriteriaString (passing your user search input) 2) call compareString (passing the content to search/validate) In your case, since you're going to pass the search criteria to SQL, you can probably just use the tokeinzing logic and add some getters for the criteria lists... David Hibbs, ACS Staff Programmer / Analyst American National Insurance Company -Original Message- From: Robert Taylor [mailto:[EMAIL PROTECTED] Sent: Monday, March 15, 2004 3:20 PM To: [EMAIL PROTECTED] Subject: [OT] Search string tokenizer I did a google search on this and didn't really come up with anything useful. Before I implement this myself, is there an existing implementation of parsing a search string which would produce tokens similar to how Google or other search engines parse search strings. For example, I would like to parse a search string into tokens where tokens are delimited by either a blank space or a quoted phrase. So the string: 'Struts web presentation tier' would return 2 tokens: - Struts - web presentation tier but the string: 'Struts web presentation tier' would return 4 tokens: - Struts - web - presentation - tier Any help is appreciated. robert - 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]
setting cookies from an action?
i'm trying this in my action and it's not working: Cookie myCookie = new Cookie(name, value); response.addCookie(myCookie); - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Element putList requires additional elements.
Hi, I am using putList in Tiles to dynamically generate menus. It works fine in Weblogic.But now when I tried to run it on Tomcat 4.1, I got some errors in log (see attached below) in the login page (scr0Def). But after I log in, it takes me to next page and I can see the menus displayed and there are no new error messages in the log. Why is this happening? Can someone please advise. I am attaching my struts-config.xml, tiles-def.xml and log file contents. Thanks. Peter Vennel strut-config.xml ?xml version=1.0 encoding=UTF-8? !DOCTYPE struts-config PUBLIC -//Apache Software Foundation//DTD Struts Configuration 1.1//EN http://jakarta.apache.org/struts/dtds/struts-config_1_1.dtd; struts-config form-beans form-bean name=submitForm type=pfo.DesktopSubmitForm / form-bean name=policyDocActionForm type=com.infinity.pfo.policyDocActionForm / /form-beans action-mappings action path=/start type=com.infinity.pfo.DoFirst forward name=success path=scr0Def / /action action path=/doAuthenticate scope=session type=com.infinity.pfo.DoAuthenticateAction forward name=success path=scr1Def / forward name=unknown-error path=scr5Def / /action action name=submitForm path=/submit scope=request type=pfo.SubmitAction forward name=success path=scr1Def / forward name=failure path=scr5Def / /action action name=policyDocActionForm path=/getPolicyDocAction scope=request type=com.infinity.pfo.getPolicyDocAction validate=false forward name=success path=scr2Def / forward name=error path=scr5Def / /action action path=/doMenuAction type=com.infinity.pfo.DoMenuAction / /action-mappings plug-in className=org.apache.struts.tiles.TilesPlugin set-property property=definitions-config value=/WEB-INF/tiles-defs.xml / /plug-in /struts-config tiles-def.xml === ?xml version=1.0 encoding=UTF-8? !DOCTYPE tiles-definitions PUBLIC -//Apache Software Foundation//DTD Tiles Configuration 1.1//EN http://jakarta.apache.org/struts/dtds/tiles-config_1_1.dtd; tiles-definitions definition name=baseDef path=/tiles/layout.jsp put name=title value=First Query Tiles Example / put name=header value=/tiles/header.jsp / put name=leftmenu value=/tiles/leftmenu.jsp / put name=menu value=menuDef / put name=body value=/tiles/body.jsp / put name=footer value=/tiles/footer.jsp / /definition definition controllerUrl=/doMenuAction.do name=menuDef path=/tiles/menu.jsp putList name=items / /definition definition extends=baseDef name=scr0Def put name=body value=/common/login.jsp / put name=menu value=/common/blank.jsp / /definition definition extends=baseDef name=scr1Def put name=body value=/desktop/desktop.jsp / /definition definition extends=baseDef name=scr2Def put name=body value=/index/index.jsp / /definition definition extends=baseDef name=scr3Def put name=body value=/common/doNothing.jsp / /definition definition extends=baseDef name=scr4Def put name=body value=/common/doNothing.jsp / /definition definition extends=baseDef name=scr5Def put name=body value=/common/error.jsp / /definition /tiles-definitions Start of Log == INFO: Initializing, config='ApplicationResources', returnNull=true Mar 16, 2004 9:38:08 AM org.apache.commons.digester.Digester error SEVERE: Parse Error at line 13 column -1: Element putList requires additional elements. org.xml.sax.SAXParseException: Element putList requires additional elements. at org.apache.crimson.parser.Parser2.error(Parser2.java:3317) at org.apache.crimson.parser.ValidatingParser$ChildrenValidator.done(ValidatingParser.java:361) at org.apache.crimson.parser.Parser2.maybeElement(Parser2.java:1666) at org.apache.crimson.parser.Parser2.content(Parser2.java:1926) at org.apache.crimson.parser.Parser2.maybeElement(Parser2.java:1654) at org.apache.crimson.parser.Parser2.content(Parser2.java:1926) at org.apache.crimson.parser.Parser2.maybeElement(Parser2.java:1654) at org.apache.crimson.parser.Parser2.parseInternal(Parser2.java:634) at org.apache.crimson.parser.Parser2.parse(Parser2.java:333) at org.apache.crimson.parser.XMLReaderImpl.parse(XMLReaderImpl.java:448) at org.apache.commons.digester.Digester.parse(Digester.java:1567) at org.apache.struts.tiles.xmlDefinition.XmlParser.parse(XmlParser.java:334) at org.apache.struts.tiles.xmlDefinition.I18nFactorySet.parseXmlFile(I18nFactorySet.java:542) at org.apache.struts.tiles.xmlDefinition.I18nFactorySet.parseXmlFiles(I18nFactorySet.java:479) at org.apache.struts.tiles.xmlDefinition.I18nFactorySet.createDefaultFactory(I18nFactorySet.java:295) at org.apache.struts.tiles.xmlDefinition.I18nFactorySet.initFactory(I18nFactorySet.java:269) at
Tiles and html:link onclick=submit()
I've noticed an annoying feature using html:link page=# onclick=submit(); someText /html:link. It does one of the following: a) It tries to search the page /somePage.jsp# or b) submits the form and continues to the right page, where my action forward points. Because the only JSP-pages I have is just index.jsp, which just checks the users role and redirects to right XYZlayout.jsp. XYZlayout.jsp is also a complete JSP-page, but if the user is not in the right role, container based authentication prevents the page from being retrieved. Also in the most cases the XYZlayout.jsp requires some parameters, so a forward action must be called before continuing to that page. I've solved this problem, by replacing the actual links by td onclick=submit(); someText /td And using some style definition the look and feel are almost exactly the same as when using html:link. Anyway I was just wondering if someone else has encountered the same kind of problem and are there any work-arounds for this issue? The same problem occurs with both IE and Opera. -- One more question: Is it possible to use form-property name=strings type=java.lang.String[] / for set of html:text areas? For example if I iterate through a collection of strings, logic:iterate id=aString property=stringArray html:text property=strings indexed=true value=${aString} / /logic:iterate can I retrieve them by using DynaActionForm dynaForm = (DynaActionForm) form; String[] strings = dynaForm.get(strings); -- Jaakko Rytinki - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Does Tiles has performance?
When ever I am using method isDate of GenericValidator I am getting following error. Even for my date format 12-DEC-2004 I am getting same exception. I coudn't able to figure out what is the problem. -Jignesh ava.lang.IllegalArgumentException: Illegal pattern character 'O' java.text.SimpleDateFormat.compile(SimpleDateFormat.java:675) java.text.SimpleDateFormat.initialize(SimpleDateFormat.java:494) java.text.SimpleDateFormat.init(SimpleDateFormat.java:443) java.text.SimpleDateFormat.init(SimpleDateFormat.java:424) com.bang.registration.RegistrationForm.checkDate(RegistrationForm.java:139) com.bang.registration.RegistrationForm.validate(RegistrationForm.java:131) org.apache.struts.action.RequestProcessor.processValidate(RequestProcessor.java:942) org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:255) org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482) org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525) javax.servlet.http.HttpServlet.service(HttpServlet.java:763) javax.servlet.http.HttpServlet.service(HttpServlet.java:856) note - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
date validation problem
On Tuesday 16 March 2004 21:03, Jignesh Patel wrote: When ever I am using method isDate of GenericValidator I am getting following error. Even for my date format 12-DEC-2004 I am getting same exception. I coudn't able to figure out what is the problem. -Jignesh ava.lang.IllegalArgumentException: Illegal pattern character 'O' java.text.SimpleDateFormat.compile(SimpleDateFormat.java:675) java.text.SimpleDateFormat.initialize(SimpleDateFormat.java:494) java.text.SimpleDateFormat.init(SimpleDateFormat.java:443) java.text.SimpleDateFormat.init(SimpleDateFormat.java:424) com.bang.registration.RegistrationForm.checkDate(RegistrationForm.java:139 ) com.bang.registration.RegistrationForm.validate(RegistrationForm.java:131) org.apache.struts.action.RequestProcessor.processValidate(RequestProcessor. java:942) org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:255 ) org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482) org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525) javax.servlet.http.HttpServlet.service(HttpServlet.java:763) javax.servlet.http.HttpServlet.service(HttpServlet.java:856) note - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Struts: Session Serialization
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] I have noticed that my Struts integration always tries to serialize existing sessions on undeploy of my webapp. I started my webapp with the default that came with the struts-blank.war. I don't think Struts is really doing it, it's your servlet container. If you're using Tomcat, this might help: http://jakarta.apache.org/tomcat/faq/misc.html#persist -- Wendy Smoak Application Systems Analyst, Sr. ASU IA Information Resources Management - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: What is the best way to pass a parameter to a forward?
I wrote an extension to help me do this. I use this in all my projects. http://www.rabago.net/struts/redirect hth, Hubert --- Jay Glanville [EMAIL PROTECTED] wrote: I'm trying to solve a problem, but I'm not sure my solution is the best way. Basically, I want to set a parameter on a forward within the action's execute. I'm in my action's execute method. I've just successfully performed some work, and I now want to forward/redirect to the next page. So, I've got some code that looks like this: public ActionForward execute(ActionMapping.) { // do some work ActionForward goto = mapping.findForward( success ); return goto; } With an action mapping that looks like this: action path=/EntrySave type=com.package.EntrySaveAction name=EntryForm validate=true input=/Entry.do forward name=success redirect=true path=/Container.do/ forward name=failure redirect=false path=/Entry.do / /action Basically, if I left the EntrySaveAction.execute do what's doing right now, then upon successful completion, it would redirect to /Container.do. However, what I want it to do is redirect to /Container.do?id=45, where 45 is the id of the container that I want to go to. The value of 45 is dynamic, and is know at the time of the EntrySaveAction.execute command. The way I'm currently doing it is something like this: public ActionForward execute(ActionMapping.) { // do some work ActionForward goto = mapping.findForward( success ); String path = goto.getPath(); path += ?id= + container.getId(); goto.setPath( path ); return goto; } Is this the correct way to do this? Is there a better way? Thanks in advance JDG -- Jay Glanville __ Do you Yahoo!? Yahoo! Mail - More reliable, more storage, less spam http://mail.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: setting cookies from an action?
From: Menke, John [mailto:[EMAIL PROTECTED] i'm trying this in my action and it's not working: Cookie myCookie = new Cookie(name, value); response.addCookie(myCookie); I think you have to set an age, or else it's a memory-only cookie and will disappear when you close the browser. Is that what you wanted? Here's what I use: myCookie.setMaxAge( 2592000 ); (I think it's the number of seconds... Check the API.) If that's not the problem, can you be more specific about what's not working? -- Wendy Smoak Application Systems Analyst, Sr. ASU IA Information Resources Management - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[OT?] Integrating Multi-Module Struts Applications
We're developing a large scale Struts app along with a subcontractor. While the subcontractor produces a lot of library code in the form of common components, they are also developing some web modules. As the developer here with the best Ant background, it's falling into my lap to unite the modules into a single application. All of the modules must share a single login, and in some cases must share the same session for communication between them. Currently they exist in separate CVS modules, with separate Ant scripts, DB config, and other config files. I believe in the end they must deploy to the same .WAR file, and I suspect it's not going to be trivial in the least to merge them into a single application. Has anyone out there dealt with a similar scenario and could give me some advice? This might be more of an Ant question, but is relevant here as well. I'm mainly looking for high level advice, or suggestions in general, but here's a few of the questions I have off the top of my head: 1. Each company currently has their own web.xml - how to merge these in hopefully in an automated manner 2. Is there a limit to the number of struts modules an application can have? Any repurcusions for having many (dozens?) of struts modules? 3. Best practices for structuring both the individual projects and the final product 4. How to integrate? Let Ant sort it out? Try to convince them to merge into a single repository and directory structure? Build a common structure for each build and then build that with Ant? Thanks in advance for advice, hopefully someone out there has had to endure this before and can at least give me some mistakes not to make =) Chip Paul Sr Software Engineer ComFrame Software Corporation Listen.Understand.Innovate www.comframe.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Tiles and html:link onclick=submit()
If the sole purpose of your link is to call the client side javascript function submit() do you really need to use html:link ? It ads no functionality for you and just wastes server side processing time converting the html:link tag to the final output a href=. html:link/ is hugely useful to automagically manage non-cookie sessions by adding session ids to your URLs but in this case you're not using that ability as you are just calling some javascript. I'd just use a href=# onclick=submit() If anyone has a reason why this would be bad, please let me know -Original Message- From: Jaakko Rytinki [mailto:[EMAIL PROTECTED] Sent: 16 March 2004 15:31 To: Struts Users Mailing List Subject: Tiles and html:link onclick=submit() I've noticed an annoying feature using html:link page=# onclick=submit(); someText /html:link. It does one of the following: a) It tries to search the page /somePage.jsp# or b) submits the form and continues to the right page, where my action forward points. Because the only JSP-pages I have is just index.jsp, which just checks the users role and redirects to right XYZlayout.jsp. XYZlayout.jsp is also a complete JSP-page, but if the user is not in the right role, container based authentication prevents the page from being retrieved. Also in the most cases the XYZlayout.jsp requires some parameters, so a forward action must be called before continuing to that page. I've solved this problem, by replacing the actual links by td onclick=submit(); someText /td And using some style definition the look and feel are almost exactly the same as when using html:link. Anyway I was just wondering if someone else has encountered the same kind of problem and are there any work-arounds for this issue? The same problem occurs with both IE and Opera. -- One more question: Is it possible to use form-property name=strings type=java.lang.String[] / for set of html:text areas? For example if I iterate through a collection of strings, logic:iterate id=aString property=stringArray html:text property=strings indexed=true value=${aString} / /logic:iterate can I retrieve them by using DynaActionForm dynaForm = (DynaActionForm) form; String[] strings = dynaForm.get(strings); -- Jaakko Rytinki - 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: Passing Value to Tile
More useful is another version of tiles:put tiles:insert name=tile.actionList flush=false tiles:put name=actionTileBean beanName=ActionsForm beanProperty=currentActionList beanScope=request / /tiles:insert This gets a bean from the request scoped form, and passes it to the tile. As mentioned below you then use tiles:importAttribute to get the bean back out of the tiles context and into the page. We use this to create reusable components out of our tiles. I personally define an interface that corresponds to the properties the tile will output, and then implement this in either a form or a bean, and pass the object in to the tile. This allows the same tile to be used multiple times in the same page, yet still show different data. This technique doesn't work as well if the tile has actual form elements, as the name of the html form element won't get rendered correctly to keep the nested nature of the property. But for display only tiles I've found it to be a wonderful way to get reuse. Chip -Original Message- From: Gopalakrishnan, Jayesh [mailto:[EMAIL PROTECTED] Sent: Monday, March 15, 2004 6:09 PM To: Struts Users Mailing List Subject: RE: Passing Value to Tile Tiles attributes can be made available as request attributes using the tiles:importAttribute / or tiles:useAttribute / tags. Any name/value that you tiles:put can be made available. eg: template.jsp tiles:insert page=/test/tt.jsp tiles:put name=param1 value=1 / /tiles:insert tt.jsp tiles:importAttribute / bean:write name=param1 / Struts documentation http://jakarta.apache.org/struts/userGuide/struts-tiles.html#importAttribute should help. hth -jayash -Original Message- From: Ramadoss Chinnakuzhandai [mailto:[EMAIL PROTECTED] Sent: Monday, March 15, 2004 3:48 PM To: [EMAIL PROTECTED] Subject: Passing Value to Tile Hi, I have a main jsp contains set of tiles included and contents of each tile should be generated based on the value passed into it from its parent jsp.can anybody suggest me how can I send a value to tile from parent jsp and access that value inside tile? Thanks in advance, -Ramadoss - 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: setting cookies from an action?
it appears the setting maxAge to -1 was the problem. cookie does not get set with this. set to (24*60*60) and it works -Original Message- From: Wendy Smoak [mailto:[EMAIL PROTECTED] Sent: Tuesday, March 16, 2004 10:39 AM To: Struts Users Mailing List Subject: RE: setting cookies from an action? From: Menke, John [mailto:[EMAIL PROTECTED] i'm trying this in my action and it's not working: Cookie myCookie = new Cookie(name, value); response.addCookie(myCookie); I think you have to set an age, or else it's a memory-only cookie and will disappear when you close the browser. Is that what you wanted? Here's what I use: myCookie.setMaxAge( 2592000 ); (I think it's the number of seconds... Check the API.) If that's not the problem, can you be more specific about what's not working? -- Wendy Smoak Application Systems Analyst, Sr. ASU IA Information Resources Management - 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: Does Tiles has performance?
I find no trouble with Tiles performance. At 06:59 AM 3/16/2004, you wrote: Anybody can tell me if using Tiles in an application make it slower? is there a way to make this better? Thanks, JP - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Does Tiles has performance?
yes no problems, (in production) but sometimes, my laptops memory is FULL, (home_development_system) than you can see, each tile gets included, step by step by step... but its more notebook-issue :-) cheers. -Original Message- From: Michael McGrady [mailto:[EMAIL PROTECTED] Sent: Tuesday, March 16, 2004 5:22 PM To: Struts Users Mailing List Subject: Re: Does Tiles has performance? I find no trouble with Tiles performance. At 06:59 AM 3/16/2004, you wrote: Anybody can tell me if using Tiles in an application make it slower? is there a way to make this better? Thanks, JP - 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]
non-ascii characters
I have a database with ISO 3166 country names and codes that I use to populate an html:select. There is one country in the list that contains a non-ascii character and I want to make sure it shows up properly. That country is listed in HTML as Aring;LAND ISLANDS I have two questions regarding this non-ascii: 1) How should I encode it in my (mysql) database? Right now I put it in with the character reference as written above. 2) Assuming I leave it the way it is in the database as stated in 1) above, how do I get the html tag machinery to not attempt to escape the ampersand? This is the code I am using: td align=left html:select property=contactInfoWidgetsSubFormCountryCode html:options collection=countries property=value labelProperty=label/ /html:select Thanks in advance for help. Dean Hoover - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Should I be able to put a path of a Action Class in a global forward?
Should I be able to put a path of a Action Class in a global forward? global-forwards forward name=startHere path=/contentView.do / /global-forwards
RE: Should I be able to put a path of a Action Class in a global forward?
Yes you can -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Tuesday, March 16, 2004 11:02 PM To: Struts Users Mailing List Subject: Should I be able to put a path of a Action Class in a global forward? Should I be able to put a path of a Action Class in a global forward? global-forwards forward name=startHere path=/contentView.do / /global-forwards Confidentiality Notice The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain confidential or privileged information. If you are not the intended recipient, please notify the sender at Wipro or [EMAIL PROTECTED] immediately and destroy all copies of this message and any attachments. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Using ExpressionEvaluatorManager in Struts Action execute() method
Hi, I am currently developping custom tags library for my company. We use ExpressionEvaluatorManager in our custom tags. That works really fine. But one of our action class will be called from cells in a table of data (Html DataTable). The Web Developper should be able to specify what to put in the session under a given name when this kind of link is clicked. And the way to do that is an expression in Expression Language (JSTL). So my Struts Action code should be able to evaluate the (request Parameter) expression in the Action execute() method to be able to put the right object in session before next forward. I got the Page context with: PageContext pc = javax.servlet.jsp.JspFactory.getDefaultFactory().getPageContext( this.getServlet(),request, response, null, true, 4096 , false ); I evaluated the expression evaluatedDetailRef = ExpressionEvaluatorManager.evaluate(null, detailRef, Object.class, pc); I released the Page Context javax.servlet.jsp.JspFactory.getDefaultFactory().releasePageContext(pc); And now my servlet container (Jetty) seems crazy and instead of processing JSP file and sending result to browser, it sends JSP source directly to browser Does it make sense for you ? Is it crazy to use EL in Action execute( ) method ?? (Was an idea of my Team leader ) I am stuck. Thanks for your help. Regards, Thanks Denis. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
(Newbie) Separating Client From Server side errors
Hi all, in my application I use both the validator for client side validation and server side validation. My problem is that when validation fails, I get the error reported as server side and not in a Javascript fashion. Additionally when a validation error occurs my reset button does not work. In my Action I have code like this ActionErrors errors = new ActionErrors(); errors.add(ActionErrors.GLOBAL_ERROR, new ActionError(error.logon.invalid)); saveErrors(request,errors); In my JSP I try to separate those errors like this logic:messagesPresent UL logic:iterate id=errors LIbean:write name=errors//LI /logic:iterate /UL /logic:messagesPresent But I get this exception java.lang.NullPointerException at java.util.Hashtable.get(Hashtable.java:333) at org.apache.jasper.runtime.PageContextImpl.findAttribute(PageContextImpl.java:308) at org.apache.struts.util.RequestUtils.lookup(RequestUtils.java:663) at org.apache.struts.util.RequestUtils.lookup(RequestUtils.java:710) at org.apache.struts.taglib.logic.IterateTag.doStartTag(IterateTag.java:303) What am I doing wrong here? Thank you for your time, Theo
logic:iterate
How can I make to print 3 coluns for line with iterate, the modulos is a ArrayList populate with myBean (atributes:modulo_nome,modulo_path) objects , the problem is divide it in 3 coluns for line.Here my source code : logic:iterate id=listModulos name=modulos indexId=index % int line = index.intValue() % 3; % logic:equal parameter=0 value=%line% br a href=bean:write name=listModulos property=modulo_path / bean:write name=listModulos property=modulo_nome //a /logic:equal logic:notEqual value=%line% parameter=0 a href=bean:write name=listModulos property=modulo_path / bean:write name=listModulos property=modulo_nome //a /logic:notEqual /logic:iterate cheers Daniel S.
Re: logic:iterate
Daniel, A litle bit more info on what the columns are holding... becuase can you make them rows...then logic:iterate is easy to use... -Sam. Daniel [EMAIL PROTECTED] wrote: How can I make to print 3 coluns for line with iterate, the modulos is a ArrayList populate with myBean (atributes:modulo_nome,modulo_path) objects , the problem is divide it in 3 coluns for line.Here my source code : parameter=0 parameter=0 cheers Daniel S. Do you Yahoo!? Yahoo! Mail - More reliable, more storage, less spam
RE: using Two struts-config
I've just started using Struts on something that will eventually become a fairly large project. We were looking at using modules to break things up, but I haven't actually tried it yet. Can you explain how this config-behind-story approach compares to using modules? Using modules allows a greater degree of separation, i.e. decoupling, of actions. It also means that you can use the same action name in more than one place, calling a different action. In my project, I want to avoid having huge config files, but I'd like the application to treat all ActionForms and ActionMappings the same way regardless of which config file they come from. Eventually, I may want to re-use parts of the configuration in multiple web apps. Would this approach be good for that, or would it make more sense to look at setting up modules? Any tips would be appreciated. I was in the same boat a few months ago--or thought I was! I started trying to build with the multiple config file approach, but some pieces kept getting cluttered as actions were given more and more dynamic forwards. So I split it into modules, making things much cleaner and clearer. Each main menu in my app now corresponds to a module, which makes it MUCH easier to follow behind the scenes. BTW, note that you can use multiple config files for each module as well. So if you know there are common configuration items such as a welcome action, toss it in say struts-config-common.xml and add that to the module config line. Be careful of using plug-ins in the common file, though! Whatever gets loaded first 'wins' and controls the entire configuration of that plugin. For example, don't declare the tiles plugin in the common struts config. Instead, make a separate tiles-defs-common.xml file and reuse *that* file when you initialize the tiles plugin for the module. Good luck; hopefully my mistakes can save you some pain. =) David Hibbs, ACS Staff Programmer / Analyst American National Insurance Company - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: please help, using logic:iterate and html:form
Mike, What error are you getting -Sam. Mu Mike [EMAIL PROTECTED] wrote: Hi, all, last week, I spent a whole day trying to figure the below problem out, and you warmhearted guys just came and helped me,but to greatly disappiont you, I m still at a loss to know where the problem is ,so I decided to explain detailedly and completely of what I did and hope you nice buddies can help me find the problem goal: I want to submit an array of Fonbean(java class file listed below) to an action strategy: I decide to use html:form and logic:iterate to do this 1.what I have in my configruation xml type=com.mycom.form.TestBeanForm/ type=com.mycom.action.TestAction name=testBeanForm scope=session 2.TestBeanForm.java public class TestBeanForm extends ActionForm { public FontBean[] getTestBean() { if(testBean==null) { testBean=new FontBean[2]; testBean[0]=new FontBean(); testBean[1]=new FontBean(); } return testBean; } public void setTestBean(FontBean[] testBean) { this.testBean = testBean; } FontBean[] testBean; } 3. FontBean.java public class FontBean { public int getSize() { return size; } public void setSize(int size) { this.size = size; } public String getFontName() { return fontName; } public void setFontName(String fontName) { this.fontName = fontName; } private int size; private String fontName; } 4. my jsp file type=com.mycom.bean.propertybean.FontBean id=mybean indexId=index1 indexed=true/ /* I think when I submit, the testBeanForm will automatically fill its testBean's elements of their fontName attributes with font1 */ Submit Changes 5.my action class file public class TestAction extends Action { public ActionForward execute(ActionMapping actionMapping, ActionForm form, HttpServletRequest servletRequest, HttpServletResponse servletResponse) throws Exception { System.out.println(stepped into action); TestBeanForm bform=(TestBeanForm)form; /*I stopped here to check if the form has its testBean variable filled with font1 of its fontName attribute, but it doesnt, the testBean of form is just the object I created in getTestBean(),that is, contains two elements, both the fontName attributes of the two elements are null */ return actionMapping.findForward(error); } } so what on earth is the problem? ThanksRegards Mike _ ÏíÓÃÊÀ½çÉÏ×î´óµÄµç×ÓÓʼþϵͳ¡ª MSN Hotmail¡£ http://www.hotmail.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] Do you Yahoo!? Yahoo! Mail - More reliable, more storage, less spam
RE: Should I be able to put a path of a Action Class in a global forward?
Everytime I put the global forward in the config-struts.xml document I get the following error Warning Target /contentView.do does not exist in the following modules: / It is like the contentView.do can not be resolved. [EMAIL PROTECTED] 03/16/2004 12:32 PM Please respond to Struts Users Mailing List To: [EMAIL PROTECTED] cc: Subject:RE: Should I be able to put a path of a Action Class in a global forward? Yes you can -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Tuesday, March 16, 2004 11:02 PM To: Struts Users Mailing List Subject: Should I be able to put a path of a Action Class in a global forward? Should I be able to put a path of a Action Class in a global forward? global-forwards forward name=startHere path=/contentView.do / /global-forwards Confidentiality Notice The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain confidential or privileged information. If you are not the intended recipient, please notify the sender at Wipro or [EMAIL PROTECTED] immediately and destroy all copies of this message and any attachments. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Should I be able to put a path of a Action Class in a global forward?
what does the action definition look like? -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Tuesday, March 16, 2004 11:52 AM To: Struts Users Mailing List Subject: RE: Should I be able to put a path of a Action Class in a global forward? Everytime I put the global forward in the config-struts.xml document I get the following error Warning Target /contentView.do does not exist in the following modules: / It is like the contentView.do can not be resolved. [EMAIL PROTECTED] 03/16/2004 12:32 PM Please respond to Struts Users Mailing List To: [EMAIL PROTECTED] cc: Subject:RE: Should I be able to put a path of a Action Class in a global forward? Yes you can -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Tuesday, March 16, 2004 11:02 PM To: Struts Users Mailing List Subject: Should I be able to put a path of a Action Class in a global forward? Should I be able to put a path of a Action Class in a global forward? global-forwards forward name=startHere path=/contentView.do / /global-forwards Confidentiality Notice The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain confidential or privileged information. If you are not the intended recipient, please notify the sender at Wipro or [EMAIL PROTECTED] immediately and destroy all copies of this message and any attachments. - 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: Drop box problem please help
Hi, Try my snippet below I populated my jsp/form bean with values from database (dynamic) td % java.util.List driversList = (java.util.List)request.getAttribute(drivers); % select name=fullName style=width:225px logic:iterate id=supervisor name=supervisors option value=bean:write name=supervisor property =employeeID/ bean:write name=supervisor property =fullName/ /option /logic:iterate /select /td ddd ddd [EMAIL PROTECTED] wrote: Hi All I am new bie and learning to populate the drop box by all different ways . 1. By Collections of strings 2. By collections beans 3. Hard coding I am unable to achieve even first way tried a lot but failed can any body suggest me where I am wrong. Also pl. suggest me how the collection of beans will be coded . any body has simple java nd jsp code please Post me Manay many thanks Regrds StrutsGuy [EMAIL PROTECTED] Below is Jps ,stutsconfig and java files and errors of browser . LOGIN PAGE LOGIN ID PASSWORD import org.apache.struts.action.ActionError; import org.apache.struts.action.ActionErrors; import org.apache.struts.action.Action; import org.apache.struts.action.ActionForward; import org.apache.struts.action.ActionMapping; import org.apache.struts.action.ActionForm; import org.apache.commons.beanutils.BeanUtils; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.util.*; import javax.servlet.jsp.PageContext; // use The seSSion stuf public class StudentAction extends Action { public ActionForward execute( ActionMapping map,ActionForm form, HttpServletRequest req , HttpServletResponse res) throws Exception { String action = req.getParameter(action); if (action == null) { StudentDatabase stBase = new StudentDatabase (); StudentForm sf= new StudentForm(); String[] str = stBase.getAllNames(); String strng =blah ; sf.setPasswd(strng); req.setAttribute(sf, sf); ActionErrors er= new ActionErrors(); er.add(ActionErrors.GLOBAL_ERROR , new ActionError(errorRakesh)); if(!er.empty()) { saveErrors(req,er); return(map.findForward(RakyError)); } else return(map.findForward(RakyCancel)); } else { return(map.findForward(RakyCancel)); } }// end of class } import org.apache.struts.action.ActionForm; import org.apache.struts.action.ActionMapping; import javax.servlet.http.HttpServletRequest; import org.apache.struts.action.ActionErrors; import org.apache.struts.action.*; import org.apache.struts.validator.ValidatorForm; public class StudentForm extends ValidatorForm { private int student =0; private String passwd = null; public StudentForm() { student=0; passwd = new String(); } public StudentForm( int student ,String passwd) { student=student; passwd= passwd; } public int getStudent() { return this.student; } public void setStudent(int student) { this.student=student; } public String getPasswd( ) { return this.passwd; } public void setPasswd(String passwd) { this.passwd=passwd; } public void reset(ActionMapping mapping ,HttpServletRequest request) { this.student=0; this.passwd=null; } public ActionErrors validate( ActionMapping map,HttpServletRequest req) { ActionErrors errors=super.validate(map,req); if(student == 0) { System.out.println(HELLO blah +student); errors.add(student, new ActionError(IDProblem)); } return errors; } // end of action errors }// end of Student from class -//Apache Software Foundation//DTD Struts Configuration 1.1//EN http://jakarta.apache.org/struts/dtds/struts-config_1_0.dtd; propertyInfo.properties hello=This is test page start=This is first page of the application info=This page stores contains text files and drop downs error=There is problem please have a look submit=ADD TO DATABASE clear=Clear the Data cancel=Cancel Button click=Please Click to start the application button=Login cancel=CancelButton reset=ResetButton IDProblem=There is problem in id has greater value than 4 pl. recheck it prompt.username= Please Enter the User Name by blah prompt.password=Please enter the password by bla errors.required={0} is required. errors.minlength={0} cannot be less than {1} characters. errors.maxlength={0} cannot be greater than {2} characters. errors.invalid={0} is invalid. errors.byte={0} must be an byte. errors.short={0} must be an short. errors.integer={0} must be an integer. errors.long={0} must be an long. errors.float={0} must be an float. errors.double={0} must be an double. errors.date={0} is not a date. errors.range={0} is not in the range {1} through {2}. errors.creditcard={0} is not a valid credit card number. errors.email={0} is an invalid e-mail address. rakeshErROR=This is first ssuccessfyl errro by blah errorRakesh=This is type of error in jsp page eError is HTTP Status 500 - type Exception report message description The server encountered an internal error () that prevented it from fulfilling this request. exception
RE: Should I be able to put a path of a Action Class in a global forward?
Are you getting this from Struts or the container, or from your IDE? What IDE are you using? Some IDEs that try to support Struts aren't really *that* in touch with what a developer can do with Struts. If you have a doubt, try running the app and see if it behaves the way you (and not your IDE) expects it to behave. Hubert --- [EMAIL PROTECTED] wrote: Everytime I put the global forward in the config-struts.xml document I get the following error Warning Target /contentView.do does not exist in the following modules: / It is like the contentView.do can not be resolved. [EMAIL PROTECTED] 03/16/2004 12:32 PM Please respond to Struts Users Mailing List To: [EMAIL PROTECTED] cc: Subject:RE: Should I be able to put a path of a Action Class in a global forward? Yes you can -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Tuesday, March 16, 2004 11:02 PM To: Struts Users Mailing List Subject: Should I be able to put a path of a Action Class in a global forward? Should I be able to put a path of a Action Class in a global forward? global-forwards forward name=startHere path=/contentView.do / /global-forwards Confidentiality Notice The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain confidential or privileged information. If you are not the intended recipient, please notify the sender at Wipro or [EMAIL PROTECTED] immediately and destroy all copies of this message and any attachments. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do you Yahoo!? Yahoo! Mail - More reliable, more storage, less spam http://mail.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Should I be able to put a path of a Action Class in a global forward?
action-mappings action path=/contentView type=com.fm.portal.vignette.action.ContentViewAction forward name=success path=/pages/Welcome.jsp / /action /action-mappings Jarnot Voytek Contr AU/SC [EMAIL PROTECTED] 03/16/2004 12:53 PM Please respond to Struts Users Mailing List To: 'Struts Users Mailing List' [EMAIL PROTECTED] cc: Subject:RE: Should I be able to put a path of a Action Class in a global forward? what does the action definition look like? -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Tuesday, March 16, 2004 11:52 AM To: Struts Users Mailing List Subject: RE: Should I be able to put a path of a Action Class in a global forward? Everytime I put the global forward in the config-struts.xml document I get the following error Warning Target /contentView.do does not exist in the following modules: / It is like the contentView.do can not be resolved. [EMAIL PROTECTED] 03/16/2004 12:32 PM Please respond to Struts Users Mailing List To: [EMAIL PROTECTED] cc: Subject:RE: Should I be able to put a path of a Action Class in a global forward? Yes you can -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Tuesday, March 16, 2004 11:02 PM To: Struts Users Mailing List Subject: Should I be able to put a path of a Action Class in a global forward? Should I be able to put a path of a Action Class in a global forward? global-forwards forward name=startHere path=/contentView.do / /global-forwards Confidentiality Notice The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain confidential or privileged information. If you are not the intended recipient, please notify the sender at Wipro or [EMAIL PROTECTED] immediately and destroy all copies of this message and any attachments. - 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: Should I be able to put a path of a Action Class in a global forward?
WSSD 5.0.1 (WebSphere Studio Site Developer) Hubert Rabago [EMAIL PROTECTED] 03/16/2004 12:58 PM Please respond to Struts Users Mailing List To: Struts Users Mailing List [EMAIL PROTECTED] cc: Subject:RE: Should I be able to put a path of a Action Class in a global forward? Are you getting this from Struts or the container, or from your IDE? What IDE are you using? Some IDEs that try to support Struts aren't really *that* in touch with what a developer can do with Struts. If you have a doubt, try running the app and see if it behaves the way you (and not your IDE) expects it to behave. Hubert --- [EMAIL PROTECTED] wrote: Everytime I put the global forward in the config-struts.xml document I get the following error Warning Target /contentView.do does not exist in the following modules: / It is like the contentView.do can not be resolved. [EMAIL PROTECTED] 03/16/2004 12:32 PM Please respond to Struts Users Mailing List To: [EMAIL PROTECTED] cc: Subject:RE: Should I be able to put a path of a Action Class in a global forward? Yes you can -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Tuesday, March 16, 2004 11:02 PM To: Struts Users Mailing List Subject: Should I be able to put a path of a Action Class in a global forward? Should I be able to put a path of a Action Class in a global forward? global-forwards forward name=startHere path=/contentView.do / /global-forwards Confidentiality Notice The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain confidential or privileged information. If you are not the intended recipient, please notify the sender at Wipro or [EMAIL PROTECTED] immediately and destroy all copies of this message and any attachments. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do you Yahoo!? Yahoo! Mail - More reliable, more storage, less spam http://mail.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: WSAD problems with Struts (was: Should I be able to put a path of a Action Class in a global forward?)
Just as I suspected. I'm forced to use WSAD where I work, and I've turned off a whole bunch of validations by it, including Struts. It complains of a lot of things that either it doesn't know about or it's just plain wrong about. Fortunately, I only have to run the app there, and not have to do any serious coding with it. My teammates aren't as fortunate, though. Hubert --- [EMAIL PROTECTED] wrote: WSSD 5.0.1 (WebSphere Studio Site Developer) Hubert Rabago [EMAIL PROTECTED] 03/16/2004 12:58 PM Please respond to Struts Users Mailing List To: Struts Users Mailing List [EMAIL PROTECTED] cc: Subject:RE: Should I be able to put a path of a Action Class in a global forward? Are you getting this from Struts or the container, or from your IDE? What IDE are you using? Some IDEs that try to support Struts aren't really *that* in touch with what a developer can do with Struts. If you have a doubt, try running the app and see if it behaves the way you (and not your IDE) expects it to behave. Hubert --- [EMAIL PROTECTED] wrote: Everytime I put the global forward in the config-struts.xml document I get the following error Warning Target /contentView.do does not exist in the following modules: / It is like the contentView.do can not be resolved. [EMAIL PROTECTED] 03/16/2004 12:32 PM Please respond to Struts Users Mailing List To: [EMAIL PROTECTED] cc: Subject:RE: Should I be able to put a path of a Action Class in a global forward? Yes you can -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Tuesday, March 16, 2004 11:02 PM To: Struts Users Mailing List Subject: Should I be able to put a path of a Action Class in a global forward? Should I be able to put a path of a Action Class in a global forward? global-forwards forward name=startHere path=/contentView.do / /global-forwards Confidentiality Notice The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain confidential or privileged information. If you are not the intended recipient, please notify the sender at Wipro or [EMAIL PROTECTED] immediately and destroy all copies of this message and any attachments. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do you Yahoo!? Yahoo! Mail - More reliable, more storage, less spam http://mail.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do you Yahoo!? Yahoo! Mail - More reliable, more storage, less spam http://mail.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: WSAD problems with Struts (was: Should I be able to put a path of a Action Class in a global forward?)
My suggestion is to familiarize yourself with how Struts works, and apply that knowledge when editing your config file. From my experience, WSAD gets a lot of things wrong. If it complains about something you believe should work, try it out yourself. If you're pretty confident that you're correct, and your tests prove it, and yet WSAD still complains, ignore it. [You can also do what I do -- filter out WSAD's Struts complaints :) ] Hubert --- Hubert Rabago [EMAIL PROTECTED] wrote: Just as I suspected. I'm forced to use WSAD where I work, and I've turned off a whole bunch of validations by it, including Struts. It complains of a lot of things that either it doesn't know about or it's just plain wrong about. Fortunately, I only have to run the app there, and not have to do any serious coding with it. My teammates aren't as fortunate, though. Hubert --- [EMAIL PROTECTED] wrote: WSSD 5.0.1 (WebSphere Studio Site Developer) Hubert Rabago [EMAIL PROTECTED] 03/16/2004 12:58 PM Please respond to Struts Users Mailing List To: Struts Users Mailing List [EMAIL PROTECTED] cc: Subject:RE: Should I be able to put a path of a Action Class in a global forward? Are you getting this from Struts or the container, or from your IDE? What IDE are you using? Some IDEs that try to support Struts aren't really *that* in touch with what a developer can do with Struts. If you have a doubt, try running the app and see if it behaves the way you (and not your IDE) expects it to behave. Hubert --- [EMAIL PROTECTED] wrote: Everytime I put the global forward in the config-struts.xml document I get the following error Warning Target /contentView.do does not exist in the following modules: / It is like the contentView.do can not be resolved. [EMAIL PROTECTED] 03/16/2004 12:32 PM Please respond to Struts Users Mailing List To: [EMAIL PROTECTED] cc: Subject:RE: Should I be able to put a path of a Action Class in a global forward? Yes you can -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Tuesday, March 16, 2004 11:02 PM To: Struts Users Mailing List Subject: Should I be able to put a path of a Action Class in a global forward? Should I be able to put a path of a Action Class in a global forward? global-forwards forward name=startHere path=/contentView.do / /global-forwards Confidentiality Notice The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain confidential or privileged information. If you are not the intended recipient, please notify the sender at Wipro or [EMAIL PROTECTED] immediately and destroy all copies of this message and any attachments. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do you Yahoo!? Yahoo! Mail - More reliable, more storage, less spam http://mail.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do you Yahoo!? Yahoo! Mail - More reliable, more storage, less spam http://mail.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do you Yahoo!? Yahoo! Mail - More reliable, more storage, less spam http://mail.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: logic:iterate
%int rest=3;% logic:iterate id=listModulos name=modulos indexId=index % int line = index.intValue() % 3; % %=linha% logic:equal name=%=line% value=%=rest% Printed br /logic:equal logic:notEqual name=%=line% value=%=rest% Printed /logic:notEqual /logic:iterate How can I compare line with rest, what atributes I need to use, at the logic:notEqual I don't need bean information, I just need compare line value with rest value, if line value is zero jump for the other line. cheers Daniel S. - Original Message - From: as as [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Tuesday, March 16, 2004 2:43 PM Subject: Re: logic:iterate Daniel, A litle bit more info on what the columns are holding... becuase can you make them rows...then logic:iterate is easy to use... -Sam. Daniel [EMAIL PROTECTED] wrote: How can I make to print 3 coluns for line with iterate, the modulos is a ArrayList populate with myBean (atributes:modulo_nome,modulo_path) objects , the problem is divide it in 3 coluns for line.Here my source code : parameter=0 parameter=0 cheers Daniel S. Do you Yahoo!? Yahoo! Mail - More reliable, more storage, less spam - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: WSAD problems with Struts (was: Should I be able to put a pat h of a Action Class in a global forward?)
Quite correct. I've turned 'em off, too. Usually, though, the action validations are correct. On the opposite side, tiles validation is non-existent but it tries anyway. So any forward path=.myTileDef / fails validation. I filed PMRs with IBM on these. While they would not fix them for me (it's not stopping the product from working, right?) I've been promised by IBM that WSAD 6 will be immeasurably better as far as Struts/Tiles validation goes. Of course, by then Struts will have advanced again and WSAD will again be behind... =^p David Hibbs, ACS Staff Programmer / Analyst American National Insurance Company -Original Message- From: Hubert Rabago [mailto:[EMAIL PROTECTED] Sent: Tuesday, March 16, 2004 12:08 PM To: Struts Users Mailing List Subject: RE: WSAD problems with Struts (was: Should I be able to put a path of a Action Class in a global forward?) Just as I suspected. I'm forced to use WSAD where I work, and I've turned off a whole bunch of validations by it, including Struts. It complains of a lot of things that either it doesn't know about or it's just plain wrong about. Fortunately, I only have to run the app there, and not have to do any serious coding with it. My teammates aren't as fortunate, though. Hubert --- [EMAIL PROTECTED] wrote: WSSD 5.0.1 (WebSphere Studio Site Developer) Hubert Rabago [EMAIL PROTECTED] 03/16/2004 12:58 PM Please respond to Struts Users Mailing List To: Struts Users Mailing List [EMAIL PROTECTED] cc: Subject:RE: Should I be able to put a path of a Action Class in a global forward? Are you getting this from Struts or the container, or from your IDE? What IDE are you using? Some IDEs that try to support Struts aren't really *that* in touch with what a developer can do with Struts. If you have a doubt, try running the app and see if it behaves the way you (and not your IDE) expects it to behave. Hubert --- [EMAIL PROTECTED] wrote: Everytime I put the global forward in the config-struts.xml document I get the following error Warning Target /contentView.do does not exist in the following modules: / It is like the contentView.do can not be resolved. [EMAIL PROTECTED] 03/16/2004 12:32 PM Please respond to Struts Users Mailing List To: [EMAIL PROTECTED] cc: Subject:RE: Should I be able to put a path of a Action Class in a global forward? Yes you can -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Tuesday, March 16, 2004 11:02 PM To: Struts Users Mailing List Subject: Should I be able to put a path of a Action Class in a global forward? Should I be able to put a path of a Action Class in a global forward? global-forwards forward name=startHere path=/contentView.do / /global-forwards Confidentiality Notice The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain confidential or privileged information. If you are not the intended recipient, please notify the sender at Wipro or [EMAIL PROTECTED] immediately and destroy all copies of this message and any attachments. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do you Yahoo!? Yahoo! Mail - More reliable, more storage, less spam http://mail.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do you Yahoo!? Yahoo! Mail - More reliable, more storage, less spam http://mail.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: WSAD problems with Struts (was: Should I be able to put a pat h of a Action Class in a global forward?)
Well the real fun is trying to develop IBM Portlets using Struts in the WSSD IDE that does not support both very well at all. Of course its IBM so I shouldn't expect working products. Hibbs, David [EMAIL PROTECTED] 03/16/2004 01:30 PM Please respond to Struts Users Mailing List To: Struts Users Mailing List [EMAIL PROTECTED] cc: Subject:RE: WSAD problems with Struts (was: Should I be able to put a pat h of a Action Class in a global forward?) Quite correct. I've turned 'em off, too. Usually, though, the action validations are correct. On the opposite side, tiles validation is non-existent but it tries anyway. So any forward path=.myTileDef / fails validation. I filed PMRs with IBM on these. While they would not fix them for me (it's not stopping the product from working, right?) I've been promised by IBM that WSAD 6 will be immeasurably better as far as Struts/Tiles validation goes. Of course, by then Struts will have advanced again and WSAD will again be behind... =^p David Hibbs, ACS Staff Programmer / Analyst American National Insurance Company -Original Message- From: Hubert Rabago [mailto:[EMAIL PROTECTED] Sent: Tuesday, March 16, 2004 12:08 PM To: Struts Users Mailing List Subject: RE: WSAD problems with Struts (was: Should I be able to put a path of a Action Class in a global forward?) Just as I suspected. I'm forced to use WSAD where I work, and I've turned off a whole bunch of validations by it, including Struts. It complains of a lot of things that either it doesn't know about or it's just plain wrong about. Fortunately, I only have to run the app there, and not have to do any serious coding with it. My teammates aren't as fortunate, though. Hubert --- [EMAIL PROTECTED] wrote: WSSD 5.0.1 (WebSphere Studio Site Developer) Hubert Rabago [EMAIL PROTECTED] 03/16/2004 12:58 PM Please respond to Struts Users Mailing List To: Struts Users Mailing List [EMAIL PROTECTED] cc: Subject:RE: Should I be able to put a path of a Action Class in a global forward? Are you getting this from Struts or the container, or from your IDE? What IDE are you using? Some IDEs that try to support Struts aren't really *that* in touch with what a developer can do with Struts. If you have a doubt, try running the app and see if it behaves the way you (and not your IDE) expects it to behave. Hubert --- [EMAIL PROTECTED] wrote: Everytime I put the global forward in the config-struts.xml document I get the following error Warning Target /contentView.do does not exist in the following modules: / It is like the contentView.do can not be resolved. [EMAIL PROTECTED] 03/16/2004 12:32 PM Please respond to Struts Users Mailing List To: [EMAIL PROTECTED] cc: Subject:RE: Should I be able to put a path of a Action Class in a global forward? Yes you can -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Tuesday, March 16, 2004 11:02 PM To: Struts Users Mailing List Subject: Should I be able to put a path of a Action Class in a global forward? Should I be able to put a path of a Action Class in a global forward? global-forwards forward name=startHere path=/contentView.do / /global-forwards Confidentiality Notice The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain confidential or privileged information. If you are not the intended recipient, please notify the sender at Wipro or [EMAIL PROTECTED] immediately and destroy all copies of this message and any attachments. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do you Yahoo!? Yahoo! Mail - More reliable, more storage, less spam http://mail.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do you Yahoo!? Yahoo! Mail - More reliable, more storage, less spam http://mail.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: What is the best way to pass a parameter to a forward?
Jay Glanville [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] It's funny that you say that it will not work, because it does for me, and without throwing any exceptions. What version of Struts are you using? It's not supposed to work, at least with the latest code, so I'd like to find out whether we have a bug, or you're using a version prior to the forwards being frozen. -- Martin Cooper That being said, your point about modifying an action mappings forwards is a good one. It is unfortunate that the ActionForward class doesn't have a copy constructor -- Jay Glanville -Original Message- From: news [mailto:[EMAIL PROTECTED] On Behalf Of Martin Cooper Sent: Monday, March 15, 2004 8:30 PM To: [EMAIL PROTECTED] Subject: Re: What is the best way to pass a parameter to a forward? What you are doing will not work - at least, not the way you are doing it. You are trying to modify the ActionForward instance that is owned by Struts, and calling setPath() on that instance will result in an IllegalStateException. You need to create your own ActionForward instance, instead of trying to modify Struts' one. You can do that with something like this: ActionForward goto = mapping.findForward( success ); String path = ...; // Put together your new path ActionForward myGoto = new ActionForward(path, goto.getRedirect()); return myGoto; -- Martin Cooper Glanville, Jay [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] I'm trying to solve a problem, but I'm not sure my solution is the best way. Basically, I want to set a parameter on a forward within the action's execute. I'm in my action's execute method. I've just successfully performed some work, and I now want to forward/redirect to the next page. So, I've got some code that looks like this: public ActionForward execute(ActionMapping.) { // do some work ActionForward goto = mapping.findForward( success ); return goto; } With an action mapping that looks like this: action path=/EntrySave type=com.package.EntrySaveAction name=EntryForm validate=true input=/Entry.do forward name=success redirect=true path=/Container.do/ forward name=failure redirect=false path=/Entry.do / /action Basically, if I left the EntrySaveAction.execute do what's doing right now, then upon successful completion, it would redirect to /Container.do. However, what I want it to do is redirect to /Container.do?id=45, where 45 is the id of the container that I want to go to. The value of 45 is dynamic, and is know at the time of the EntrySaveAction.execute command. The way I'm currently doing it is something like this: public ActionForward execute(ActionMapping.) { // do some work ActionForward goto = mapping.findForward( success ); String path = goto.getPath(); path += ?id= + container.getId(); goto.setPath( path ); return goto; } Is this the correct way to do this? Is there a better way? Thanks in advance JDG -- Jay Glanville - 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: [OT] Jericho == Struts 2.0?
I guess what I was trying to say that JSF currently complement struts and the overlap is very small but I think future version of JSF would improve upon JSF current navigation model and would have an improved controller, validation ... and the two frameworks would be very similar and it would be hard to choose struts over JSF or even bother to use a hybrid solution. Personally I think if struts 2.0 would be able to leverage JSF and JSTL and add IoC, cleaner interfaces, workflow, chained actions and JMX configured ActionMapping it would make it my ideal framework and would probably make it the best framework for medium to large scale projects. On Tue, 2004-03-16 at 07:29 -0500, Ted Husted wrote: On Mon, 15 Mar 2004 13:07:10 -0800, Nadeem Bitar wrote: Which role will struts play when JSF matures and JSF 2.0 is released is what interests me more than the proposed name of struts 2.0. Struts will be whatever the community needs it to be. The Struts-JSF taglib Craig put together demonstrates that it's not an either/or proposition. Even today, not every application needs to use Struts. For smaller, simpler applications a Model 1 approach works just fine. With JSF, many moderate-sized applications might not need Struts either. But, in my experience, large, complex applications do need front controllers. Even Microsoft admits that now. The next generation of .NET (Whidbey) will include a front controller out of the box. The core role of Struts has always been to provide missing pieces that help enterprise developers connect the dots. As we discover what JSF is missing, we can help provide those pieces too. Same old, same old :) -Ted. Developing Web Applications Using Open Source Tools Saturday, 3 Apr 2004, New York City http://basebeans.com/do/website - 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]
redirecting to Google...
List, Struts noob. I'm checking a form for a parameter that determines whether the user is searching the web at large or the local site: input type=radio name=isLocal value=true/Sitenbsp; input type=radio name=isLocal value=false/Web If false.equalsIgnoreCase( isLocal ) then my actionMapping.findForward( gogoGoogleSearch ) is envoked. This is where I get lost... I need to format the query string and pass it to Google in the redirect. At a minimum Google looks for a query string like: http://www.google.com/search?q=hearts How do I do this? I think I'm looking for something similar to this, which is what I'm most familiar with: response.sendRedirect(http://www.google.com/search?q=; + queryString); actions action ... forward ... redirect=true / /action /actions doesn't seem to be doing enough. Many thanks in advance! Warmest Regards, Tim - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: What is the best way to pass a parameter to a forward?
Latest stable release: 1.1 -- Jay Glanville -Original Message- From: news [mailto:[EMAIL PROTECTED] On Behalf Of Martin Cooper Sent: Tuesday, March 16, 2004 1:33 PM To: [EMAIL PROTECTED] Subject: Re: What is the best way to pass a parameter to a forward? Jay Glanville [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] It's funny that you say that it will not work, because it does for me, and without throwing any exceptions. What version of Struts are you using? It's not supposed to work, at least with the latest code, so I'd like to find out whether we have a bug, or you're using a version prior to the forwards being frozen. -- Martin Cooper That being said, your point about modifying an action mappings forwards is a good one. It is unfortunate that the ActionForward class doesn't have a copy constructor -- Jay Glanville - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
logic:equal
Why it doesn't work, but if I change the value of bean:define value attribute for value=1, it's work? I need compare dinamic values. bean:define id=string value=%=1% / logic:equal name=string value=1 The string contained the word Struts /logic:equal cheers Danie S.
Re: [OT] Jericho == Struts 2.0?
Personally I think if struts 2.0 would be able to leverage JSF and JSTL and add IoC, cleaner interfaces, workflow, chained actions and JMX configured ActionMapping it would make it my ideal framework and would probably make it the best framework for medium to large scale projects. Sounds great! C'mon over to struts-dev and help us build it! Joe -- Joe Germuska [EMAIL PROTECTED] http://blog.germuska.com Imagine if every Thursday your shoes exploded if you tied them the usual way. This happens to us all the time with computers, and nobody thinks of complaining. -- Jef Raskin - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
The browser cache JS resources?
Hello. I have a doubt. I'm thinking about including in all my pages the same javascrip file with the code: script language=Javascript1.1 src=js/staticJavascript.jsp//script This is because I want this file with all javascript code (or including code) in all pages, even the page doesn't make use of it. Is this bad? My doubt is if the browser will always request the JS file, every request or put it in cache. Thanks, JP
RE: The browser cache JS resources?
Yes, that is good. -Original Message- From: Joao Batistella [mailto:[EMAIL PROTECTED] Sent: Tuesday, March 16, 2004 1:32 PM To: 'Struts Users Mailing List' Subject: The browser cache JS resources? Hello. I have a doubt. I'm thinking about including in all my pages the same javascrip file with the code: script language=Javascript1.1 src=js/staticJavascript.jsp//script This is because I want this file with all javascript code (or including code) in all pages, even the page doesn't make use of it. Is this bad? My doubt is if the browser will always request the JS file, every request or put it in cache. Thanks, JP - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: redirecting to Google...
Timothy Stone wrote: List, Struts noob. I'm checking a form for a parameter that determines whether the user is searching the web at large or the local site: input type=radio name=isLocal value=true/Sitenbsp; input type=radio name=isLocal value=false/Web If false.equalsIgnoreCase( isLocal ) then my actionMapping.findForward( gogoGoogleSearch ) is envoked. This is where I get lost... I need to format the query string and pass it to Google in the redirect. At a minimum Google looks for a query string like: http://www.google.com/search?q=hearts How do I do this? I think I'm looking for something similar to this, which is what I'm most familiar with: response.sendRedirect(http://www.google.com/search?q=; + queryString); What about: if( false.equalsIgnoreCase( isLocal ) ) { return( new ActionForward( http://www.google.com/search?q=; + query, true ); } I can't seem to find a way of envoking this via the struts-config.xml and a logical mapping name. The docs seem to suggest that this is okay. Thoughts? actions action ... forward ... redirect=true / /action /actions doesn't seem to be doing enough. Many thanks in advance! Warmest Regards, Tim - 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]
urgent - data-source and container managed datasource
Hi There, I'm getting ready to ship off my application and I'm trying to use the application server (standalone oc4j) to hold the data source information instead of having it in struts-config.xml. Is this possible? When jDeveloper deploys to the server it builds me a data-sources.xml file which I presume is correct. When I test the connection, its fine. In web.xml I entered: resource-ref res-ref-namejdbc/bartCoreDS/res-ref-name res-typejavax.sql.DataSource/res-type res-authContainer/res-auth /resource-ref Where jdbc/bartCoreDS matches the location entry of the data-source in data-sources.xml. Then I took out the data-sources from struts-config.xml. I'm not terribly surprised that now my application can't find the database. The problem is I don't know where to look for instructions on how to do this or if its even possible. Is there a way to put a data-source configuration in struts-config.xml that tells it to look at the container, so that the username and password aren't in it?? If I can provide more information, I will. Time is running a bit short, so I'd really, really appreciate a quick response. Janice - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: urgent - data-source and container managed datasource
Janice, Check out these links: http://otn.oracle.com/sample_code/tech/java/codesnippet/j2ee/jdbc/JDBC_in_J2EE.html http://otn.oracle.com/products/jdev/tips/duff/mysql_and_oc4j3.html It works fine for me. -Richard --- Janice [EMAIL PROTECTED] wrote: Hi There, I'm getting ready to ship off my application and I'm trying to use the application server (standalone oc4j) to hold the data source information instead of having it in struts-config.xml. Is this possible? When jDeveloper deploys to the server it builds me a data-sources.xml file which I presume is correct. When I test the connection, its fine. In web.xml I entered: resource-ref res-ref-namejdbc/bartCoreDS/res-ref-name res-typejavax.sql.DataSource/res-type res-authContainer/res-auth /resource-ref Where jdbc/bartCoreDS matches the location entry of the data-source in data-sources.xml. Then I took out the data-sources from struts-config.xml. I'm not terribly surprised that now my application can't find the database. The problem is I don't know where to look for instructions on how to do this or if its even possible. Is there a way to put a data-source configuration in struts-config.xml that tells it to look at the container, so that the username and password aren't in it?? If I can provide more information, I will. Time is running a bit short, so I'd really, really appreciate a quick response. Janice - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do you Yahoo!? Yahoo! Mail - More reliable, more storage, less spam http://mail.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: redirecting to Google...
From: Timothy Stone [mailto:[EMAIL PROTECTED] How do I do this? I think I'm looking for something similar to this, which is what I'm most familiar with: response.sendRedirect(http://www.google.com/search?q=; + queryString); I've never done this from an Action, but I *think* you can do exactly that and then return null from Action.execute() to indicate to the framework that you have taken care of the response and it doesn't need to do anything further. Either try it or someone will correct me in a bit. You can also construct your own ActionForward and return that-- you don't have to look it up from the mappings. actions action ... forward ... redirect=true / /action /actions doesn't seem to be doing enough. Mine looks more like this, I _forward_ to 'redirect.jsp' which pulls something out of request or session scope and does a meta-refresh to send them off wherever they belong. -- Wendy Smoak Application Systems Analyst, Sr. ASU IA Information Resources Management - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: urgent - data-source and container managed datasource
Hello, I have configured my data source on OC4J standalone version. Given below are snippets from the relevant files: In my data-sources.xml , I have data-source class=com.evermind.sql.DriverManagerDataSource name=TestDS location=jdbc/OracleCoreDS xa-location=jdbc/xa/OracleXADS ejb-location=jdbc/TestDS connection-driver=oracle.jdbc.driver.OracleDriver url=jdbc:oracle:thin:@servername:1521:test username=username password=password min-connections=5 max-connections=20 inactivity-timeout=30 / I lookup this data source in a DatabaseServlet, which is loaded on server startup, and intialize a static variable in my DBConnection class, which manages database connections. I use the code below: snip InitialContext ic = new InitialContext(); DataSource ds = (DataSource)ic.lookup(jdbc/TestDS); .. DBConnection.dataSource=ds; //initializeDataSource in the DBConnection class snip In my DBConnection class, I have methods like openConnection(), closeConnection() et al to handle connections from the data source. snip public Connection openConnection() { Connection con=null; try { con = dataSource.getConnection(); } catch(Exception e) { System.out.println(Error: Unable to get connection + e.getMessage()); } return con; } snip In order to load the DatabaseServlet on starup, I have the following in the web.xml file: servlet servlet-namedatabase/servlet-name servlet-classobs.application.DatabaseServlet/servlet-class load-on-startup1/load-on-startup /servlet HTH, Shyam --- Janice [EMAIL PROTECTED] wrote: Hi There, I'm getting ready to ship off my application and I'm trying to use the application server (standalone oc4j) to hold the data source information instead of having it in struts-config.xml. Is this possible? When jDeveloper deploys to the server it builds me a data-sources.xml file which I presume is correct. When I test the connection, its fine. In web.xml I entered: resource-ref res-ref-namejdbc/bartCoreDS/res-ref-name res-typejavax.sql.DataSource/res-type res-authContainer/res-auth /resource-ref Where jdbc/bartCoreDS matches the location entry of the data-source in data-sources.xml. Then I took out the data-sources from struts-config.xml. I'm not terribly surprised that now my application can't find the database. The problem is I don't know where to look for instructions on how to do this or if its even possible. Is there a way to put a data-source configuration in struts-config.xml that tells it to look at the container, so that the username and password aren't in it?? If I can provide more information, I will. Time is running a bit short, so I'd really, really appreciate a quick response. Janice - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do you Yahoo!? Yahoo! Mail - More reliable, more storage, less spam http://mail.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Is there a way to have more than one controller servlets?
Is there a way to have more than one controller servlets in Struts. My aim is to have a main controller manager several other controllers. Any suggestions or help? Thanks in advance. -amit - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: The browser cache JS resources?
First, I'd recommend renaming it with a .js file extension, since JSP is probably misleading if it's only got JS functions. I don't see where you could (forcibly) cache it on the client machine, nor would you want to. Most modern browsers try to cache files (I know HTML and images, and I'm assuming .js files as well), so this might already be done for you by most clients. Unless this is a huge .js file, and most/all of your clients are over a dial-up connection, I wouldn't worry about it too much. But, for performance and modularity, it's generally best to create a single main.js for common/shared javascript functionality, and a page- or use-case-specific javascript file in addition depending on the page. (You can, of course, embed as many as you like.) -Original Message- From: Joao Batistella [mailto:[EMAIL PROTECTED] Sent: Tuesday, March 16, 2004 2:32 PM To: 'Struts Users Mailing List' Subject: The browser cache JS resources? Hello. I have a doubt. I'm thinking about including in all my pages the same javascrip file with the code: script language=Javascript1.1 src=js/staticJavascript.jsp//script This is because I want this file with all javascript code (or including code) in all pages, even the page doesn't make use of it. Is this bad? My doubt is if the browser will always request the JS file, every request or put it in cache. Thanks, JP - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: logic:equal
Daniel, it would be easier to use JSTL for this: c:if test=${myValue == 1} The string contained the word Struts. /c:if JSTL can compare values coming from any scope; application, session, pagecontext, request, or request parameters. Currently, the bean:define .../ value attribute doesn not accept runtime values. You can verify this by looking at the struts-bean.tld Another alternative would be to use the Struts-EL tag libraries. robert -Original Message- From: Daniel [mailto:[EMAIL PROTECTED] Sent: Tuesday, March 16, 2004 2:30 PM To: Struts Users Mailing List Subject: logic:equal Why it doesn't work, but if I change the value of bean:define value attribute for value=1, it's work? I need compare dinamic values. bean:define id=string value=%=1% / logic:equal name=string value=1 The string contained the word Struts /logic:equal cheers Danie S. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
urgent - data-source and container managed datasource
A big thank you to Richard and Shyam! I have things working again and am back on track to get this app deployed!! Janice - Original Message - From: Janice To: [EMAIL PROTECTED] Sent: Tuesday, March 16, 2004 11:56 AM Subject: urgent - data-source and container managed datasource Hi There, I'm getting ready to ship off my application and I'm trying to use the application server (standalone oc4j) to hold the data source information instead of having it in struts-config.xml. Is this possible? When jDeveloper deploys to the server it builds me a data-sources.xml file which I presume is correct. When I test the connection, its fine. In web.xml I entered: resource-ref res-ref-namejdbc/bartCoreDS/res-ref-name res-typejavax.sql.DataSource/res-type res-authContainer/res-auth /resource-ref Where jdbc/bartCoreDS matches the location entry of the data-source in data-sources.xml. Then I took out the data-sources from struts-config.xml. I'm not terribly surprised that now my application can't find the database. The problem is I don't know where to look for instructions on how to do this or if its even possible. Is there a way to put a data-source configuration in struts-config.xml that tells it to look at the container, so that the username and password aren't in it?? If I can provide more information, I will. Time is running a bit short, so I'd really, really appreciate a quick response. Janice - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Text Area
Hi, How to make the below a text area? html:text property=info/ Thanks, Samy. Do you Yahoo!? Yahoo! Mail - More reliable, more storage, less spam
[OT] JDBC-ODBC Driver Recommendation
All, I find myself in need of an open-source JDBC-ODBC driver so I can access a MS-SQLServer database from a Struts web app. Can anyone recommend a driver? Thanks! Jerry Jalenak Development Manager, Web Publishing LabOne, Inc. 10101 Renner Blvd. Lenexa, KS 66219 (913) 577-1496 [EMAIL PROTECTED] This transmission (and any information attached to it) may be confidential and is intended solely for the use of the individual or entity to which it is addressed. If you are not the intended recipient or the person responsible for delivering the transmission to the intended recipient, be advised that you have received this transmission in error and that any use, dissemination, forwarding, printing, or copying of this information is strictly prohibited. If you have received this transmission in error, please immediately notify LabOne at the following email address: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Text Area
How to make the below a text area? html:text property=info/ html:textarea property=info/ -- Tim Slattery [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Text Area
html:textarea property=info/ -Mensaje original- De: as as [mailto:[EMAIL PROTECTED] Enviado el: Martes, 16 de Marzo de 2004 03:42 p.m. Para: [EMAIL PROTECTED] Asunto: Text Area Hi, How to make the below a text area? html:text property=info/ Thanks, Samy. Do you Yahoo!? Yahoo! Mail - More reliable, more storage, less spam Este correo fue revisado automáticamente por el sistema antivirus institucional, C.C.S.S. Este correo es de índole confidencial de interes único del destinatario, si por error ha sido recibido por favor eliminelo. Este correo fue revisado automáticamente por el sistema antivirus institucional, C.C.S.S.
Re: Text Area
as as wrote: Hi, How to make the below a text area? html:text property=info/ Thanks, Samy. Do you Yahoo!? Yahoo! Mail - More reliable, more storage, less spam http://jakarta.apache.org/struts/userGuide/struts-html.html#textarea html:textarea property=info/ -- Jason Lea - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: [OT] JDBC-ODBC Driver Recommendation
I've used JTDS with success in the past. http://jtds.sourceforge.net/ -Original Message- From: Jerry Jalenak [mailto:[EMAIL PROTECTED] Sent: Tuesday, March 16, 2004 3:42 PM To: '[EMAIL PROTECTED]' Subject: [OT] JDBC-ODBC Driver Recommendation All, I find myself in need of an open-source JDBC-ODBC driver so I can access a MS-SQLServer database from a Struts web app. Can anyone recommend a driver? Thanks! Jerry Jalenak Development Manager, Web Publishing LabOne, Inc. 10101 Renner Blvd. Lenexa, KS 66219 (913) 577-1496 [EMAIL PROTECTED] This transmission (and any information attached to it) may be confidential and is intended solely for the use of the individual or entity to which it is addressed. If you are not the intended recipient or the person responsible for delivering the transmission to the intended recipient, be advised that you have received this transmission in error and that any use, dissemination, forwarding, printing, or copying of this information is strictly prohibited. If you have received this transmission in error, please immediately notify LabOne at the following email address: [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: [OT] JDBC-ODBC Driver Recommendation
Thanks! I'll take a look at it... Jerry Jalenak Development Manager, Web Publishing LabOne, Inc. 10101 Renner Blvd. Lenexa, KS 66219 (913) 577-1496 [EMAIL PROTECTED] -Original Message- From: Smith, Darrin [mailto:[EMAIL PROTECTED] Sent: Tuesday, March 16, 2004 3:48 PM To: 'Struts Users Mailing List' Subject: RE: [OT] JDBC-ODBC Driver Recommendation I've used JTDS with success in the past. http://jtds.sourceforge.net/ -Original Message- From: Jerry Jalenak [mailto:[EMAIL PROTECTED] Sent: Tuesday, March 16, 2004 3:42 PM To: '[EMAIL PROTECTED]' Subject: [OT] JDBC-ODBC Driver Recommendation All, I find myself in need of an open-source JDBC-ODBC driver so I can access a MS-SQLServer database from a Struts web app. Can anyone recommend a driver? Thanks! Jerry Jalenak Development Manager, Web Publishing LabOne, Inc. 10101 Renner Blvd. Lenexa, KS 66219 (913) 577-1496 [EMAIL PROTECTED] This transmission (and any information attached to it) may be confidential and is intended solely for the use of the individual or entity to which it is addressed. If you are not the intended recipient or the person responsible for delivering the transmission to the intended recipient, be advised that you have received this transmission in error and that any use, dissemination, forwarding, printing, or copying of this information is strictly prohibited. If you have received this transmission in error, please immediately notify LabOne at the following email address: [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] This transmission (and any information attached to it) may be confidential and is intended solely for the use of the individual or entity to which it is addressed. If you are not the intended recipient or the person responsible for delivering the transmission to the intended recipient, be advised that you have received this transmission in error and that any use, dissemination, forwarding, printing, or copying of this information is strictly prohibited. If you have received this transmission in error, please immediately notify LabOne at the following email address: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: [OT] Jericho == Struts 2.0?
hi nadeem Personally I think if struts 2.0 would be able to leverage JSF and JSTL and add IoC, cleaner interfaces, workflow, chained actions and JMX configured ActionMapping it would make it my ideal framework and would probably make it the best framework for medium to large scale projects. JMX sounds great to me! +1 on adding it to be supported :-) Chain, workflow and so on will be integrated until into 2.0 (http://jakarta.apache.org/struts/status.html) and of course supporting jsr-168 i really think, it matures struts! :-) PS: did you read that link: http://www.theserverside.com/news/thread.tss?thread_id=22097 ? cheers, Matthias On Tue, 2004-03-16 at 07:29 -0500, Ted Husted wrote: On Mon, 15 Mar 2004 13:07:10 -0800, Nadeem Bitar wrote: Which role will struts play when JSF matures and JSF 2.0 is released is what interests me more than the proposed name of struts 2.0. Struts will be whatever the community needs it to be. The Struts-JSF taglib Craig put together demonstrates that it's not an either/or proposition. Even today, not every application needs to use Struts. For smaller, simpler applications a Model 1 approach works just fine. With JSF, many moderate-sized applications might not need Struts either. But, in my experience, large, complex applications do need front controllers. Even Microsoft admits that now. The next generation of .NET (Whidbey) will include a front controller out of the box. The core role of Struts has always been to provide missing pieces that help enterprise developers connect the dots. As we discover what JSF is missing, we can help provide those pieces too. Same old, same old :) -Ted. Developing Web Applications Using Open Source Tools Saturday, 3 Apr 2004, New York City http://basebeans.com/do/website - 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]
Check all checkboxes in struts' jsp using javascript
HI, I am using following script to generate checkboxes and check them all on my jsp. SCRIPT LANGUAGE=JavaScript var checkflag = false; function check(field) { if (checkflag == false) { for (i = 0; i field.length; i++) {//ERROR OCCURING HERE field[i].checked = true;} checkflag = true; return Uncheck All; } else { for (i = 0; i field.length; i++) { field[i].checked = false; } checkflag = false; return Check All; } } input type=checkbox name=book_all value=Check All onClick=check(this.form.list)/th //so if user clicks above checkbox (which, on the resultant HTML page, appears above all the remaining rows in the table, each row has a checkbox., should check all the remaining checkboxes under it. When I run my script, i get error at above line - saying length is null. Wondering why. Any tips appreciated. Thanks, Sa. Do you Yahoo!? Yahoo! Mail - More reliable, more storage, less spam
action - delegate - facade
I've just been perusing the archive to check out what people have been saying about struts to EJB interfacing. One thing that occurs to me is that the only reason mentioned for having a business delegate layer between the Actions and the Session Facade is to allow for loose coupling of the struts-dependent code with the EJB dependent code. How necessary is that? If you choose to drop EJB and go with, say Hibernate, you would have to modify the interface, whether it is the Action - Facade interface or the Delegate - Facade interface. Or have I missed an important other reason for the existence of the Delegate layer? Adam -- struts 1.1 + tomcat 5.0.16 + java 1.4.2 Linux 2.4.20 Debian - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
how to implement such an action?
Hello,everyone, I want to implement such an action which is actually activated by within the meta:refresh tag. (that means it will be called every 30 seconds). What the action need to do is to make some judgements. If it get true result, it forward to another page, or else it stays at previous page and do nothing, so user will see no change. Obviously, action need to remember that page, but I do not know how to put it. I am just a newbie in struts. So could you kindly give me some clue to it. Thanks! Alex _ MSN Explorer: http://explorer.msn.com/lccn/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: What is the best way to pass a parameter to a forward?
i found this class a while ago on this list it works great, just create a parameter action forward and then add params forward.addParameter(name, value); return forward; import java.util.HashMap; import java.util.Iterator; public final class ParameterActionForward extends ActionForward { private static final String questionMark = ?; private static final String ampersand = ; private static final String equals = =; private HashMap parameters = new HashMap(); private String path; public ParameterActionForward(ActionForward forward) { setName(forward.getName()); setPath(forward.getPath()); setRedirect(forward.getRedirect()); } public void setPath(String path) { this.path = path; } public String getPath() { StringBuffer sb = new StringBuffer(); sb.append(path); boolean firstTimeThrough = true; if (parameters != null !parameters.isEmpty()) { sb.append(questionMark); Iterator it = parameters.keySet() .iterator(); while (it.hasNext()) { String paramName = (String)it.next(); String paramValue = (String)parameters.get(paramName); if (firstTimeThrough) { firstTimeThrough = false; } else { sb.append(ampersand); } sb.append(paramName); sb.append(equals); sb.append(paramValue); } } return sb.toString(); } public void addParameter(String paramName, Object paramValue) { addParameter( paramName, paramValue.toString()); } public void addParameter(String paramName, String paramValue) { parameters.put(paramName, paramValue); } } -Original Message- From: Jay Glanville [mailto:[EMAIL PROTECTED] Sent: Tuesday, March 16, 2004 2:12 PM To: 'Struts Users Mailing List' Subject: RE: What is the best way to pass a parameter to a forward? Latest stable release: 1.1 -- Jay Glanville -Original Message- From: news [mailto:[EMAIL PROTECTED] On Behalf Of Martin Cooper Sent: Tuesday, March 16, 2004 1:33 PM To: [EMAIL PROTECTED] Subject: Re: What is the best way to pass a parameter to a forward? Jay Glanville [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] It's funny that you say that it will not work, because it does for me, and without throwing any exceptions. What version of Struts are you using? It's not supposed to work, at least with the latest code, so I'd like to find out whether we have a bug, or you're using a version prior to the forwards being frozen. -- Martin Cooper That being said, your point about modifying an action mappings forwards is a good one. It is unfortunate that the ActionForward class doesn't have a copy constructor -- Jay Glanville - 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]
Using tiles
This is a newbie question on using the Tiles with Struts (never tried it before). I followed the instructions in the first half of Tiles 101/201, linked from the Tiles documentation but am having no luck on the Struts/Tiles integration front. I suspect I've simply missed a step somewhere. Here's what I've done: * Ensured Tiles is enabled in struts-conf.xml (it was by default): plug-in className=org.apache.struts.tiles.TilesPlugin set-property property=definitions-config value=/WEB-INF/conf/tiles-defs.xml / set-property property=moduleAware value=true / set-property property=definitions-parser-validate value=true / /plug-in * added a tile definition to teils-defs.xml: definition name=tiles.view put name=title value=PAGE TITLE/ put name=content value=/tiles-test/index.jsp/ /definition * added an action mapping to struts-conf.xml pointing to the tile: action path=/tiles type=DummyTilesAction forward name=view path=tiles.view/ /action * created /tiles-test/index.jsp with some static text content What I expected was that when I hit /tiles.do I'd get back the static content from /tiles-test/index.jsp. What I actually get back is the string 'htmlbody/body/html', which I haven't defined anywhere. I also tried implementing execute() in DummyTilesAction to do a 'return mappings.findForward(view);' but no luck. Changing the name of the view in struts-conf.xml or tiles-defs.xml makes no difference, and generates no error messages when they don't match, which makes me suspicious... The tiles defs do seem to be read in on startup: L4J 2004-03-15 19:22:47,801 DEBUG org.apache.struts.tiles.xmlDefinition.I18nFactorySet default factory:{tiles.layout.basic={name=tiles.layout.basic, path=/tiles.layout.basic.jsp, role=null, controller=null, controllerType=null, controllerInstance=null, attributes={title=DEFAULT TITLE, content=/tiles.content.default.jsp, menu=/tiles.layout.basic.menu.jsp}} , tiles.view={name=tiles.view, path=null, role=null, controller=null, controllerType=null, controllerInstance=null, attributes={title=PAGE TITLE, content=/tiles-test/index.jsp}} } L4J 2004-03-15 19:22:48,065 DEBUG org.apache.struts.tiles.xmlDefinition.I18nFactorySet Factory initialized from file '/WEB-INF/conf/tiles-defs.xml'. L4J 2004-03-15 19:22:48,065 INFO org.apache.struts.tiles.TilesPlugin Tiles definition factory loaded for module ''. and the action mapping was picked up correctly; when I hit /tiles.do I get this logged: L4J 2004-03-15 19:25:49,791 DEBUG org.apache.struts.action.RequestProcessor Looking for Action instance for class DummyTilesAction But no Tiles related logging, and the page specified in the tile definition isn't loaded. The taglib documentation at http://jakarta.apache.org/struts/userGuide/struts-tiles.html says that I have to call initComponentDefinitions or otherwise arrange to have Tiles initialized. I thought the configuration in struts-conf.xml would make that happen, but tried calling the tag in case. That didn't seem to help. What am I doing wrong? If I've left any information out, please ask and I'll post it. Thanks, L. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
help with access nested hash in jsp
Hi, For my structs application I have a Hash Map of Hash Maps, the outer hash is keyed by pagenumber and the inner hash is keyed by date. Sample data. hash{1}={ {2004-03-14 =34}, {2004-03-13 =33}... } hash{2}={ {2004-03-14 =33}, {2004-03-13 =23}... } How do I access a specific value of the inner hash inside a jsp page? For example if I want to display the count for page 2 on date 2004-03-13. I can render the whole inner hash with : nested:iterate id=innermap name=hash nested:write name=innerhash property=value/ /nested:iterate I tried to render a specific value using : nested:iterate id=innermap name=hash nested:write name=innerhash property=value(2004-03-13)/ /nested:iterate but it did not render anything. I've already wrapped the inner hash with a hasbean, which defines a getValue(String key) method, but that still doesn't work. Please help Thanks KK - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: action - delegate - facade
Adam, IMHO the Business Delegate pattern abstracts the client from knowing your business implementation, whether it be EBJ, JDO, POJO, roll your own. The client interfaces with the Business Delegate and not its implementation. For example, if you have an Action (client) interface with the Business Delegate instead of directly with a SessionFacade, then you can change the underlying implementation of the Business Delegate without changing anything in the client. If your really paranoid (or prepared), you can use the Abstract Factory pattern which you could then initialize/subclass to create the appropriate Business Delegate implementations (EJB, JDO, main frame). Also by using a Business Delegate the client isn't exposed to implementation details such as (if your using EJB) looking up the appropropriate EJB or handling implementation specific exceptions. The Business Delegate becomes a high level abstraction of the business rules raising application level exceptions when error occur to which the client can respond appropriately. So, you wouldn't necessarily have to modify the Delegate-Facade interface. The interface itself remains unchanged. You have to use a different implementation. That is where the factory comes in. I imagine you could do something like the following: Properties props = // get initialization properties // to initialize factory to return EJB BD implementations BusinessDelegateFactory bdf = BusinessDelegateFactory.init(props); In your client, suppose AccountBD is your BusinessDelegate interface: BusinessDelegateFactory bdf = BusinessDelegateFactory.getInstance(); AccountBD accountBD = (AccountBD)bdf.createBusinessDelegate(AccountBD.BD_NAME); So you just end up plugging in new implementations as needed. Anyhow, that's my interpretation of the some of the forces behind the pattern and an idea on implementing it. Here's more information: http://java.sun.com/blueprints/corej2eepatterns/Patterns/BusinessDelegate.html http://www.developer.com/java/other/article.php/626001 robert -Original Message- From: Adam Hardy [mailto:[EMAIL PROTECTED] Sent: Tuesday, March 16, 2004 6:26 PM To: Struts Users Mailing List Subject: action - delegate - facade I've just been perusing the archive to check out what people have been saying about struts to EJB interfacing. One thing that occurs to me is that the only reason mentioned for having a business delegate layer between the Actions and the Session Facade is to allow for loose coupling of the struts-dependent code with the EJB dependent code. How necessary is that? If you choose to drop EJB and go with, say Hibernate, you would have to modify the interface, whether it is the Action - Facade interface or the Delegate - Facade interface. Or have I missed an important other reason for the existence of the Delegate layer? Adam -- struts 1.1 + tomcat 5.0.16 + java 1.4.2 Linux 2.4.20 Debian - 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]
Struts book give-away
Hi all, I am the author of Struts Survival Guide - yet another entrant in the Struts book shelf. There is a free Struts book give-away of my book at JavaRanch this week. Interested can go to http://saloon.javaranch.com/cgi-bin/ubb/ultimatebb.cgi?ubb=forumf=58and post a question or respond to an existing one and are automatically entered into the contest. Four lucky winners will geta book each. See you there. Srikanth Shenoy Author Struts Survival Guide: Basics to Best Practices J2EE Project Survival Guide
RE: non-ascii characters
I have a database with ISO 3166 country names and codes that I use to populate an html:select. There is one country in the list that contains a non-ascii character and I want to make sure it shows up properly. That country is listed in HTML as Aring;LAND ISLANDS I have two questions regarding this non-ascii: 1) How should I encode it in my (mysql) database? Right now I put it in with the character reference as written above. 2) Assuming I leave it the way it is in the database as stated in 1) above, how do I get the html tag machinery to not attempt to escape the ampersand? This is the code I am using: td align=left html:select property=contactInfoWidgetsSubFormCountryCode html:options collection=countries property=value labelProperty=label/ /html:select RTFM. You want filter=false. Also if you are using struts 1.1 you can use html:optionsCollection instead of html:options. You will find it much nicer. Specifically you will not have to declare you value and label. In either case you will want filter=false. - Dan - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
how to submit javascript variable of array type
I now have a javascript array var, and I need to submit it by a form to an action class, how can I achieve this? ThanksRegards _ MSN Explorer: http://explorer.msn.com/lccn/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Using tiles
Dear Laurie, You forgot to set a page in your tile definition with the path attribute. The definition needs to be more like so: definition name=tiles.view path=/tiles-test/template.jsp put name=title value=PAGE TITLE/ put name=content value=/tiles-test/index.jsp/ /definition Where /tiles-test/template.jsp could look like: %@ taglib uri=/tags/struts-tiles prefix=tiles % html head title !-- insert the title attribute from your definition as a string -- tiles:getAsString name=title / /title /head body !-- insert the content attribute from your definition as a parsed JSP page -- tiles:insert attribute=content /body /html Regards, David -Original Message- From: news [mailto:[EMAIL PROTECTED] Behalf Of Laurie Harper Sent: Monday, March 15, 2004 7:31 PM To: [EMAIL PROTECTED] Subject: Using tiles This is a newbie question on using the Tiles with Struts (never tried it before). I followed the instructions in the first half of Tiles 101/201, linked from the Tiles documentation but am having no luck on the Struts/Tiles integration front. I suspect I've simply missed a step somewhere. Here's what I've done: * Ensured Tiles is enabled in struts-conf.xml (it was by default): plug-in className=org.apache.struts.tiles.TilesPlugin set-property property=definitions-config value=/WEB-INF/conf/tiles-defs.xml / set-property property=moduleAware value=true / set-property property=definitions-parser-validate value=true / /plug-in * added a tile definition to teils-defs.xml: definition name=tiles.view put name=title value=PAGE TITLE/ put name=content value=/tiles-test/index.jsp/ /definition * added an action mapping to struts-conf.xml pointing to the tile: action path=/tiles type=DummyTilesAction forward name=view path=tiles.view/ /action * created /tiles-test/index.jsp with some static text content What I expected was that when I hit /tiles.do I'd get back the static content from /tiles-test/index.jsp. What I actually get back is the string 'htmlbody/body/html', which I haven't defined anywhere. I also tried implementing execute() in DummyTilesAction to do a 'return mappings.findForward(view);' but no luck. Changing the name of the view in struts-conf.xml or tiles-defs.xml makes no difference, and generates no error messages when they don't match, which makes me suspicious... The tiles defs do seem to be read in on startup: L4J 2004-03-15 19:22:47,801 DEBUG org.apache.struts.tiles.xmlDefinition.I18nFactorySet default factory:{tiles.layout.basic={name=tiles.layout.basic, path=/tiles.layout.basic.jsp, role=null, controller=null, controllerType=null, controllerInstance=null, attributes={title=DEFAULT TITLE, content=/tiles.content.default.jsp, menu=/tiles.layout.basic.menu.jsp}} , tiles.view={name=tiles.view, path=null, role=null, controller=null, controllerType=null, controllerInstance=null, attributes={title=PAGE TITLE, content=/tiles-test/index.jsp}} } L4J 2004-03-15 19:22:48,065 DEBUG org.apache.struts.tiles.xmlDefinition.I18nFactorySet Factory initialized from file '/WEB-INF/conf/tiles-defs.xml'. L4J 2004-03-15 19:22:48,065 INFO org.apache.struts.tiles.TilesPlugin Tiles definition factory loaded for module ''. and the action mapping was picked up correctly; when I hit /tiles.do I get this logged: L4J 2004-03-15 19:25:49,791 DEBUG org.apache.struts.action.RequestProcessor Looking for Action instance for class DummyTilesAction But no Tiles related logging, and the page specified in the tile definition isn't loaded. The taglib documentation at http://jakarta.apache.org/struts/userGuide/struts-tiles.html says that I have to call initComponentDefinitions or otherwise arrange to have Tiles initialized. I thought the configuration in struts-conf.xml would make that happen, but tried calling the tag in case. That didn't seem to help. What am I doing wrong? If I've left any information out, please ask and I'll post it. Thanks, L. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
what would it take to build site navigation into struts?
I have been learning about a web portal tool called BroadVision Portal. One of the nice things that it provides out of the box are breadcrumbs. It allows you to define a hierarchical navigation system where each level of the hierarchy can have a sub-navigation element and/or one or more content items. You can compare this concept to a file system. Every webpage/link knows its relationship to the rest of the pages/links. This means that there is an API to know the current page's/link's parent, siblings, and children. Microsoft's Whidbey release of ASP.NET will provide an API for this. The bottom line is that having such a feature in Struts would make it easy to build things like breadcrumbs. Does anyone have any idea of what it would take to build a site navigation type concept into Struts? thanks, Andy - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: how to submit javascript variable of array type
I usually concatenate the array into a single string (using a delimiter such as a comma) and then put this value into a single field. In my actionform I have a getter (under different property name) that returns it as an array (using the delimiter to explode the string). -Original Message- From: Mu Mike [mailto:[EMAIL PROTECTED] Sent: Wednesday, 17 March 2004 10:24 To: [EMAIL PROTECTED] Subject: how to submit javascript variable of array type I now have a javascript array var, and I need to submit it by a form to an action class, how can I achieve this? ThanksRegards _ MSN Explorer: http://explorer.msn.com/lccn/ - 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]