RE: Tokens - a simple explanation wanted
The basic idea for the use of token is to deny duplicate request submissions. How do we use it? When the user goes to a form for the first time, the saveToken methods needs to be called, this will create a token in the user's session and a matching request token in the request object which will be defined as a hidden parameter on the jsp page. Once the form is submitted, we will need to check whether the request and session token match by calling isTokenValid. This will return true and we now call the saveToken method once again thereby creating a new token in the user's session. If the user now clicks on the browser's back button the hidden (request) parameter on the old jsp page will not match the new session token that has just been created. If the user decides to resubmit the old form we will call the isTokenValid method and it will return false. Struts have created the following token methods. generateToken protected java.lang.String generateToken(javax.servlet.http.HttpServletRequest request) Generate a new transaction token, to be used for enforcing a single request for a particular transaction. Parameters: request - The request we are processing isTokenValid protected boolean isTokenValid(javax.servlet.http.HttpServletRequest request) Return true if there is a transaction token stored in the user's current session, and the value submitted as a request parameter with this action matches it. Returns false under any of the following circumstances: * No session associated with this request * No transaction token saved in the session * No transaction token included as a request parameter * The included transaction token value does not match the transaction token in the user's session Parameters: request - The servlet request we are processing resetToken protected void resetToken(javax.servlet.http.HttpServletRequest request) Reset the saved transaction token in the user's session. This indicates that transactional token checking will not be needed on the next request that is submitted. Parameters: request - The servlet request we are processing saveToken protected void saveToken(javax.servlet.http.HttpServletRequest request) Save a new transaction token in the user's current session, creating a new session if necessary. Parameters: request - The servlet request we are processing -Original Message- From: David Bolsover [mailto:[EMAIL PROTECTED]] Sent: 06 December 2002 11:04 To: Struts User Subject: Tokens - a simple explanation wanted Hi Can anyone assist with a simple explanation of how Tokens work and their application within the Struts framework? I have read the docs and looked at the examples but still have problems understanding how (or if) Tokens solve the problem that arises when a user uses the browser back button and then re-submits a form for a second time. db -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Xdoclet and Struts
Could u plz describe wut exactly u generate Do u have to manualy edit somethin' after generation ? coz' if u do, then it is worthless - Original Message - From: Emil Korladinov [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Friday, December 06, 2002 5:36 PM Subject: Re: Xdoclet and Struts --- Jack R. [EMAIL PROTECTED] wrote: Is it a good practice to use xdoclet to generate Struts config file? Or it is not a good idea at all? I know there are GUI tool to edit struts config file. But I would think it will be easier to have the struts config file auto generate by xdoclet tag in my struts Form, Action files. Thanks for any suggestion. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] Hello, IHMO it is very good idea to use xdoclet for generation of struts config file. I'm using a slightly modified version of xdoclet 1.1 for this purpose and it works fine. __ Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now. http://mailplus.yahoo.com -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: How is property field used in errors.add
The property can be used if you want to display the error message next to a specific field on the jsp page. So after the form adds the errors, on the resulting jsp, if u have something like html:errors property=CG_Branch html:text blah blah.. wil make the error to be displayed next to the html:text tag.. regards, Shirish -Original Message- From: norman.klein [mailto:[EMAIL PROTECTED]] Sent: Friday, December 06, 2002 8:48 PM To: struts-user Subject: How is property field used in errors.add We are using just standard validation using a validate method within the ActionForm There are a series of validations, which look like the following: public ActionErrors validate(ActionMapping mapping, HttpServletRequest request) { ActionErrors errors = new ActionErrors(); if (getCG_Branch() == null || getCG_Branch().length() 1) { errors.add(CG_Branch, new ActionError(errors.required, Contact General: Branch)); System.out.println(getCG_Branch failed. Contact_General_LoanAction will not executed); } return errors; } The Contact General: Branch is passed as a parameter to errors:required (which is specified in the ApplicationsResources.properties file) {0} is required According to the Struts documentation, the errors.add call void add(java.lang.String property, ActionError error) Add an error message to the set of errors for the specified property. So what functionality does this specified property provide?? -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Question about adding ActionErrors
I think the errors are saved in session not in form. -Original Message- From: MohanR [mailto:[EMAIL PROTECTED]] Sent: Monday, December 09, 2002 7:27 AM To: struts-user Cc: MohanR Subject: RE: Question about adding ActionErrors Hi, We are validating against the database in the LoginAction through a business delegate. I think the validation in the form would be limited to checking for null or spaces... A related question. In my action, I use saveErrors. How are the 'errors' saved inside the form ? Thanks, Mohan -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Sunday, December 08, 2002 1:24 AM To: Struts Users Mailing List Subject: Question about adding ActionErrors Hi, i have a LoginForm ( ValidatorForm ), which will validate if username and password is entered. Ok, but after this i have to probe if the entered username/password combination really exists in the database. My question is where to perform the database-check ... in the LoginForm by overriding the validate method or in the requested Action ( /Login.do ) ? It seems to me a litte bit confusing that a ValidatorForm should make a database-connect instead of the Action. Any help would be appreciated. Jan Zimmek -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Question about adding ActionErrors
I thought it was normally request scope? -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Monday, December 09, 2002 17:44 To: [EMAIL PROTECTED] Subject: RE: Question about adding ActionErrors I think the errors are saved in session not in form. -Original Message- From: MohanR [mailto:[EMAIL PROTECTED]] Sent: Monday, December 09, 2002 7:27 AM To: struts-user Cc: MohanR Subject: RE: Question about adding ActionErrors Hi, We are validating against the database in the LoginAction through a business delegate. I think the validation in the form would be limited to checking for null or spaces... A related question. In my action, I use saveErrors. How are the 'errors' saved inside the form ? Thanks, Mohan -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Sunday, December 08, 2002 1:24 AM To: Struts Users Mailing List Subject: Question about adding ActionErrors Hi, i have a LoginForm ( ValidatorForm ), which will validate if username and password is entered. Ok, but after this i have to probe if the entered username/password combination really exists in the database. My question is where to perform the database-check ... in the LoginForm by overriding the validate method or in the requested Action ( /Login.do ) ? It seems to me a litte bit confusing that a ValidatorForm should make a database-connect instead of the Action. Any help would be appreciated. Jan Zimmek -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Re: Best Practices for Logging?
Just some addition to this logging discussion. If u are using log4j , then in any case,there wil be 1 instance per class and not per object.BEcause logger instances are named entities and they are cached.So if u ask for the same logger again(same class name I mean), u will retrieve same instance.New instance will not be created.I dont know how other logger implementations used in commons logging work.So u dont add any performance advantage by making them static. regards, Shirish -Original Message- From: ekbush [mailto:[EMAIL PROTECTED]] Sent: Friday, December 06, 2002 9:38 PM To: struts-user Cc: ekbush Subject: Re: Best Practices for Logging? Sri Sankaran wrote: -Original Message- From: Matt Raible [mailto:[EMAIL PROTECTED]] Sent: Friday, December 06, 2002 1:34 PM To: [EMAIL PROTECTED] Subject: Best Practices for Logging? I'm wondering what is considered the best practice for logging using commons-logging in a Struts app. My current approach is to have a Base class in every package that has the following: protected Log log = LogFactory.getLog(my.package.name); But I've noticed that some of the Struts examples have an instance of this in every class. Personally I prefer the class level. This provides you with a finer grain of control. However, I restrict it to only one per class and not one per object public class Foo { private static Log log = LogFactory.getLog(Foo.class); .. } General consensus seems to be that this is the best practice approach. You wind up with more loggers, but they give you very fine-grained control as Sri mentioned. You can still set a log-level for a package, but you then also have the ability to manipulate the log-level on a per class basis too - so you can relaly zoom-in on things. Is this recommended, so that logging can be done on a class level, as well as a package level? Any thoughts/opinions are appreciated. It should be a static member as per what Sri shows (so you only have one per class). Yes - it's so you can control logging on a package/class basis. Thanks, Matt Sri -- Eddie Bush -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Access/Manage client's file system
Sorry not to have answered earlier but I did not work Friday. By 'local' I mean the client's machine not the server. First, the server offers templates to the client. Example of JSP: Name = Toto; Type = Data; Value = 12; etc Save Load Apply Cancel If the user select the save button I would like to save data on the client's machine and the load button allows to load a file from the client's machine. We could store instances of the template on the server but it is specific to each client that's why we think that it is better to allow the client to access file system. For us server allows to store only common data. If you think it is better to save data on the server, thanks to explain. Do you understand my question better ? If I understand your reply, to do that I must use Client plugin technologies. Do you have an example ? Thanks a lot Sandra -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Lists, actions and links
Hello I've having trouble working out which is the best way of iterating though a result set , I can and have done this is several ways. 1. Imagine i have a class that querys a db and returns a result set. I pass the result set as a datastructure to my action class and all is well .. But I have to call the action to produce the list on my page. E.g. MyModelClassThatAsksTheDBForResults ListJismAction have an action listjism.do and link to this 2. or I have a bean that gets the resultset, via another class or in the bean, I instantiate the bean using the useBean jsp syntax and then iterate through using the gets defined in my bean. I don't have to have a list action, but there's something that smells about this (i'm not sure what). E.g. ListJismBean and have a normal link to listjism.jsp that uses a mix of standard jsp and struts. I know that the later is probably faster, but I'm not worried about that. I'll worry about that once my app all works (albeit slowly). An additional question is should i be only calling actions for every page or not, i read different views on this which has confused me. It seems that centralising all the links in action that can be adminstered from config.xml would only be more maintainable if and only if everything is in there. Many thanks in advance mark -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Access/Manage client's file system
Well, if you can make do with something thats rather user unfriendly you can use the standard html stuff: For the files to be saved on the users machine you could provide a link - clicking the link will allow the user to download the file which they can save on their machine. For the server to read the file you provide a file upload field and the user browses through their filesystem for the file required. Of course its a very manual process which is a lot more messy than the interface you hope for in your example and in both cases you have no control over the file names used. It is up to the user to choose where to save it, and also up to the user to select which file to send back. -Original Message- From: Heligon Sandra [mailto:[EMAIL PROTECTED]] Sent: Monday, December 09, 2002 17:17 To: '[EMAIL PROTECTED]' Cc: '[EMAIL PROTECTED]'; '[EMAIL PROTECTED]' Subject: Access/Manage client's file system Sorry not to have answered earlier but I did not work Friday. By 'local' I mean the client's machine not the server. First, the server offers templates to the client. Example of JSP: Name = Toto; Type = Data; Value = 12; etc Save Load Apply Cancel If the user select the save button I would like to save data on the client's machine and the load button allows to load a file from the client's machine. We could store instances of the template on the server but it is specific to each client that's why we think that it is better to allow the client to access file system. For us server allows to store only common data. If you think it is better to save data on the server, thanks to explain. Do you understand my question better ? If I understand your reply, to do that I must use Client plugin technologies. Do you have an example ? Thanks a lot Sandra -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Lists, actions and links
The way I would do this would be to have a Data Access Object (DAO) class that does your database access. The method would return a collection of Value Object. This collection can be passed back to your page, then you can use the iterator tag to work through the list. from:Mark [EMAIL PROTECTED] date:Mon, 09 Dec 2002 10:23:55 to: [EMAIL PROTECTED] subject: Re: Lists, actions and links Hello I've having trouble working out which is the best way of iterating though a result set , I can and have done this is several ways. 1. Imagine i have a class that querys a db and returns a result set. I pass the result set as a datastructure to my action class and all is well .. But I have to call the action to produce the list on my page. E.g. MyModelClassThatAsksTheDBForResults ListJismAction have an action listjism.do and link to this 2. or I have a bean that gets the resultset, via another class or in the bean, I instantiate the bean using the useBean jsp syntax and then iterate through using the gets defined in my bean. I don't have to have a list action, but there's something that smells about this (i'm not sure what). E.g. ListJismBean and have a normal link to listjism.jsp that uses a mix of standard jsp and struts. I know that the later is probably faster, but I'm not worried about that. I'll worry about that once my app all works (albeit slowly). An additional question is should i be only calling actions for every page or not, i read different views on this which has confused me. It seems that centralising all the links in action that can be adminstered from config.xml would only be more maintainable if and only if everything is in there. Many thanks in advance mark -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] http://www.amazon.co.uk/exec/obidos/redirect-home?tag=velloscouk-21placement=home_multi.gifsite=amazon -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Access/Manage client's file system
I don't think storing this on the client is a good approach to doing it... if you choose to do this, then you're breaking one of the Web's main advantages, which is client independency (you will most likely lock the user to a single browser that supports a specific plugin, 95% chance that it will be IE). You should really consider using the server to handle the templates. Do you have many clients accessing this application? Are the templates too big, and do you have many of these files for each user? You could even consider using a database to store templates, and read them when the user needs their data. Then you could save them in the user's session for optimal performance. There are many ways of doing it, but it all depends on how you are going to use the files. --- Heligon Sandra [EMAIL PROTECTED] wrote: Sorry not to have answered earlier but I did not work Friday. By 'local' I mean the client's machine not the server. First, the server offers templates to the client. Example of JSP: Name = Toto; Type = Data; Value = 12; etc Save Load Apply Cancel If the user select the save button I would like to save data on the client's machine and the load button allows to load a file from the client's machine. We could store instances of the template on the server but it is specific to each client that's why we think that it is better to allow the client to access file system. For us server allows to store only common data. If you think it is better to save data on the server, thanks to explain. Do you understand my question better ? If I understand your reply, to do that I must use Client plugin technologies. Do you have an example ? Thanks a lot Sandra -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] = Frederico Ferro Schuh [EMAIL PROTECTED] ICQ: 20486081 __ Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now. http://mailplus.yahoo.com -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Multiple Submit Buttons + Internationalisation
Multiple Submit Buttons + Internationalisation I have a jsp with three submit buttons (update, delete etc..) each with a value as loaded from the resource bundle: input type=submit name=Submit value=bean:message key='label.update'/ In my action class i do the following to identify which button has submitted the form: if (Update.equalsIgnoreCase(pRequest.getParameter(Submit))) { //Process my update } This works fine when viewed from a browser with an English locale, if the locale is anything different it fails. Its obvious why this doesn't work as i've hardcode the action class to one locale (English). Can someone please suggest a different approach? Cheers _ MSN 8 helps eliminate e-mail viruses. Get 2 months FREE*. http://join.msn.com/?page=features/virus -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Xdoclet and Struts
no. check out xdoclet at: http://xdoclet.sourceforge.net/ http://sourceforge.net/projects/xdoclet At 17:00 02/12/09 +0800, you wrote: Could u plz describe wut exactly u generate Do u have to manualy edit somethin' after generation ? coz' if u do, then it is worthless -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
html:file Problems
Greetings, i have a html:file tag. When i cklick to submit the form the following error appears: snippet type Exception report message description The server encountered an internal error () that prevented it from fulfilling this request. exception javax.servlet.ServletException: BeanUtils.populate at org.apache.struts.util.RequestUtils.populate(RequestUtils.java:774) at org.apache.struts.action.ActionServlet.processPopulate(ActionServlet.java:2061) at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1564) at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:510) at javax.servlet.http.HttpServlet.service(HttpServlet.java:760) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193) . . . /snippet what do i do wrong. how can i receive the uplaod filedata. how do i have to create my setter/getter methods for this form. (in mastering jakarta struts this part is missing). Any code samples? thx in advance. mit freundlichen Grüßen Georg XL. Mouratidis Web Application Developer Heiler|Software AG Mittlerer Pfad 9 D-70499 Stuttgart Tel: 0711-139 84-265 Fax: 0711-866 63 01 Email: [EMAIL PROTECTED] Connecting Buyer and Supplier http://www.heiler.com -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
EJB's and Collections of Objects
Hi, I have a finder method associated with an EJB that returns a collection of objects. I don't want to call the get Methods in my struts action class, in my JSP's or in form classes as I would like to keep everything in the same transaction. So what I was going to do was use a session bean which looped around the the collection returned from the finder method, getting the data objects and adding them to a new collection and then return out the collection of data objects. Is there a standard or better way to get my objects out into my struts application? thanks Jordan -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Xdoclet and Struts
well is seems that u generate xml from another xml i thinl xDoclet very usefull for EJB code generation - Original Message - From: tek1 [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Monday, December 09, 2002 7:38 PM Subject: Re: Xdoclet and Struts no. check out xdoclet at: http://xdoclet.sourceforge.net/ http://sourceforge.net/projects/xdoclet At 17:00 02/12/09 +0800, you wrote: Could u plz describe wut exactly u generate Do u have to manualy edit somethin' after generation ? coz' if u do, then it is worthless -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: html:file Problems
2002. december 9. 12:51 dátummal Mouratidis, Georg ezt írtad: Greetings, i have a html:file tag. When i cklick to submit the form the following error appears: What do you have in the ActionForm? Is the corresponding property's type FormFile? Hth, Tib -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: EJB's and Collections of Objects
2002. december 9. 12:52 dátummal Jordan Thomas ezt írtad: Is there a standard or better way to get my objects out into my struts application? I think that it is rather straightforward and clean. Is it working for you? Is it fast enough? Does it suit your needs? If yes, there is no problem. Btw this is how I do as well. Hth, Tib -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: html:file Problems
No i have String. i changed it into FormFile and it works. i also inserted import org.apache.struts.upload.FormFile; thank you -Original Message- From: Gemes Tibor [mailto:[EMAIL PROTECTED]] Sent: Montag, 9. Dezember 2002 13:10 To: Struts Users Mailing List Subject: Re: html:file Problems 2002. december 9. 12:51 dátummal Mouratidis, Georg ezt írtad: Greetings, i have a html:file tag. When i cklick to submit the form the following error appears: What do you have in the ActionForm? Is the corresponding property's type FormFile? Hth, Tib -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Multiple Submit Buttons + Internationalisation
You could probably compare pRequest.getParameter(Submit) against the internationalized string, though it might be better to go a way that won't make you dependent on those labels. You could flip it around and decide based on the Name of the submit button. Something like: if ( pRequest.getParameter(update_submit) != null ) { // do an update } else if ( pRequest.getParameter(delete_submit) != null ) { // do a delete } -john. - Original Message - From: Pat Quinn [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, December 09, 2002 6:35 AM Subject: Multiple Submit Buttons + Internationalisation Multiple Submit Buttons + Internationalisation I have a jsp with three submit buttons (update, delete etc..) each with a value as loaded from the resource bundle: input type=submit name=Submit value=bean:message key='label.update'/ In my action class i do the following to identify which button has submitted the form: if (Update.equalsIgnoreCase(pRequest.getParameter(Submit))) { //Process my update } This works fine when viewed from a browser with an English locale, if the locale is anything different it fails. Its obvious why this doesn't work as i've hardcode the action class to one locale (English). Can someone please suggest a different approach? Cheers _ MSN 8 helps eliminate e-mail viruses. Get 2 months FREE*. http://join.msn.com/?page=features/virus -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Multiple Submit Buttons + Internationalisation
2002. december 9. 13:48 dátummal John D Hume ezt írtad: You could probably compare pRequest.getParameter(Submit) against the internationalized string, though it might be better to go a way that won't make you dependent on those labels. You could flip it around and decide based on the Name of the submit button. Something like: LookupDispatchAction? http://husted.com/struts/tips/003.html Hth, Tib -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
No bean found under attribute key - any config problem?
Greetings, I am new to Struts list I am getting an exception with the message No bean found under attribute key customerForm when I am accessing the JSP where in which I am using the logic:equal tag. I am using this tag to check whether a formbean variable (called action) value is equal to new or not. I have configured the formbean with the name customerForm in the config file. and I am sure that the bean is in classpath. I am in need of the corrective action to solve the problem The following are the details.. Thanks, Satya I have written an Action Form class called org.ig.shopone.web.CustomerForm that is having following 6 fields with public getter and setter methods (along with validate and reset methods).. private String name; private String address; private String customerId; private String password; private String password2; private String action; I am using the above Form in a JSP to check whether the action field value is new or edit. html:html head logic:equal name=customerForm property=action scope=request value=new titlebean:message key=customer.new.title//title /logic:equal logic:notEqual name=customerForm property=action scope=request value=new titlebean:message key=customer.edit.title//title /logic:notEqual html:base/ /head body bgcolor=white html:errors/ ... .. When I am executing the above JSP file I am getting the following Exception -- HTTP Status 500 - type Exception report message description The server encountered an internal error () that prevented it from fulfilling this request. exception org.apache.jasper.JasperException: No bean found under attribute key customerForm void org.apache.jasper.servlet.JspServletWrapper.service(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, boolean) JspServletWrapper.java:248 void org.apache.jasper.servlet.JspServlet.serviceJspFile(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, java.lang.String, java.lang.Throwable, boolean) JspServlet.java:289 void org.apache.jasper.servlet.JspServlet.service(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse) JspServlet.java:240 ... -- The following is the configuration file ?xml version = '1.0' encoding = 'windows-1252'? !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=customerForm type=org.ig.shopone.web.CustomerForm/ /form-beans action-mappings action path=/customer type=org.ig.shopone.web.actions.CustomerAction name=customerForm scope=request/ /action-mappings message-resources parameter=ApplicationResources/ /struts-config --
RE: No bean found under attribute key - any config problem?
What do u mean by executing the jsp? The way u have done configuration, there will not be any problem if u are calling the CustomerAction and the CustomerAction action is doing a forward to the jsp. BEcause then only the form bean will be available. How u are executing the jsp? -Original Message- From: satyanarayana [mailto:[EMAIL PROTECTED]] Sent: Monday, December 09, 2002 1:57 PM To: struts-user Cc: satyanarayana Subject: No bean found under attribute key - any config problem? Greetings, I am new to Struts list I am getting an exception with the message No bean found under attribute key customerForm when I am accessing the JSP where in which I am using the logic:equal tag. I am using this tag to check whether a formbean variable (called action) value is equal to new or not. I have configured the formbean with the name customerForm in the config file. and I am sure that the bean is in classpath. I am in need of the corrective action to solve the problem The following are the details.. Thanks, Satya I have written an Action Form class called org.ig.shopone.web.CustomerForm that is having following 6 fields with public getter and setter methods (along with validate and reset methods).. private String name; private String address; private String customerId; private String password; private String password2; private String action; I am using the above Form in a JSP to check whether the action field value is new or edit. html:html head logic:equal name=customerForm property=action scope=request value=new titlebean:message key=customer.new.title//title /logic:equal logic:notEqual name=customerForm property=action scope=request value=new titlebean:message key=customer.edit.title//title /logic:notEqual html:base/ /head body bgcolor=white html:errors/ ... .. When I am executing the above JSP file I am getting the following Exception -- HTTP Status 500 - type Exception report message description The server encountered an internal error () that prevented it from fulfilling this request. exception org.apache.jasper.JasperException: No bean found under attribute key customerForm void org.apache.jasper.servlet.JspServletWrapper.service(javax.servlet.http.HttpServl etRequest, javax.servlet.http.HttpServletResponse, boolean) JspServletWrapper.java:248 void org.apache.jasper.servlet.JspServlet.serviceJspFile(javax.servlet.http.HttpServl etRequest, javax.servlet.http.HttpServletResponse, java.lang.String, java.lang.Throwable, boolean) JspServlet.java:289 void org.apache.jasper.servlet.JspServlet.service(javax.servlet.http.HttpServletReque st, javax.servlet.http.HttpServletResponse) JspServlet.java:240 ... -- The following is the configuration file ?xml version = '1.0' encoding = 'windows-1252'? !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=customerForm type=org.ig.shopone.web.CustomerForm/ /form-beans action-mappings action path=/customer type=org.ig.shopone.web.actions.CustomerAction name=customerForm scope=request/ /action-mappings message-resources parameter=ApplicationResources/ /struts-config -- -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Multiple Submit Buttons + Internationalisation
+1 Gemes Tibor wrote: 2002. december 9. 13:48 dátummal John D Hume ezt írtad: You could probably compare pRequest.getParameter(Submit) against the internationalized string, though it might be better to go a way that won't make you dependent on those labels. You could flip it around and decide based on the Name of the submit button. Something like: LookupDispatchAction? http://husted.com/struts/tips/003.html Hth, Tib -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: No bean found under attribute key - any config problem?
Hi, I am using Tomcat 4.1.1 I didn't configured any action forwards.. I think the main problem is with logic:equal usage I think the bean is not getting instantiated. Its working fine without any logic:equal tags in my JSP... but to add extra functionality, I have to use logic:equal tag Thanks - Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Monday, December 09, 2002 6:27 PM Subject: RE: No bean found under attribute key - any config problem? What do u mean by executing the jsp? The way u have done configuration, there will not be any problem if u are calling the CustomerAction and the CustomerAction action is doing a forward to the jsp. BEcause then only the form bean will be available. How u are executing the jsp? -Original Message- From: satyanarayana [mailto:[EMAIL PROTECTED]] Sent: Monday, December 09, 2002 1:57 PM To: struts-user Cc: satyanarayana Subject: No bean found under attribute key - any config problem? Greetings, I am new to Struts list I am getting an exception with the message No bean found under attribute key customerForm when I am accessing the JSP where in which I am using the logic:equal tag. I am using this tag to check whether a formbean variable (called action) value is equal to new or not. I have configured the formbean with the name customerForm in the config file. and I am sure that the bean is in classpath. I am in need of the corrective action to solve the problem The following are the details.. Thanks, Satya I have written an Action Form class called org.ig.shopone.web.CustomerForm that is having following 6 fields with public getter and setter methods (along with validate and reset methods).. private String name; private String address; private String customerId; private String password; private String password2; private String action; I am using the above Form in a JSP to check whether the action field value is new or edit. html:html head logic:equal name=customerForm property=action scope=request value=new titlebean:message key=customer.new.title//title /logic:equal logic:notEqual name=customerForm property=action scope=request value=new titlebean:message key=customer.edit.title//title /logic:notEqual html:base/ /head body bgcolor=white html:errors/ ... .. When I am executing the above JSP file I am getting the following Exception -- -- -- HTTP Status 500 - type Exception report message description The server encountered an internal error () that prevented it from fulfilling this request. exception org.apache.jasper.JasperException: No bean found under attribute key customerForm void org.apache.jasper.servlet.JspServletWrapper.service(javax.servlet.http.HttpS ervl etRequest, javax.servlet.http.HttpServletResponse, boolean) JspServletWrapper.java:248 void org.apache.jasper.servlet.JspServlet.serviceJspFile(javax.servlet.http.HttpS ervl etRequest, javax.servlet.http.HttpServletResponse, java.lang.String, java.lang.Throwable, boolean) JspServlet.java:289 void org.apache.jasper.servlet.JspServlet.service(javax.servlet.http.HttpServletR eque st, javax.servlet.http.HttpServletResponse) JspServlet.java:240 ... -- -- -- The following is the configuration file ?xml version = '1.0' encoding = 'windows-1252'? !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=customerForm type=org.ig.shopone.web.CustomerForm/ /form-beans action-mappings action path=/customer type=org.ig.shopone.web.actions.CustomerAction name=customerForm scope=request/ /action-mappings message-resources parameter=ApplicationResources/ /struts-config -- -- -- -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Re: No bean found under attribute key - any config problem?
No.U are not getting it right. U should understand the flow of struts for this. For the bean to get instantiated, it has to associated with some action. And from u r config file, it looks that u have mapped the form to /customer action.So if u call this customer action first, then in the action say mapping.findForward(success) and change the mapping for action as follows. action-mappings action path=/customer type=org.ig.shopone.web.actions.CustomerAction name=customerForm scope=request/ forward name=successpath=/yourjsp.jsp/ /action-mappings then this will work. If u are directly calling jsp, there is no way the form bean will be available. And the tag does not create any bean.It accesses the bean avaiblable already(generally created in action..) And it works without the logic tag is because in rest of u r page, u are not refering to any of bean attributes.i.e. form bean is not referred. regards, Shirish -Original Message- From: satyanarayana [mailto:[EMAIL PROTECTED]] Sent: Monday, December 09, 2002 2:13 PM To: struts-user Cc: satyanarayana Subject: Re: No bean found under attribute key - any config problem? Hi, I am using Tomcat 4.1.1 I didn't configured any action forwards.. I think the main problem is with logic:equal usage I think the bean is not getting instantiated. Its working fine without any logic:equal tags in my JSP... but to add extra functionality, I have to use logic:equal tag Thanks - Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Monday, December 09, 2002 6:27 PM Subject: RE: No bean found under attribute key - any config problem? What do u mean by executing the jsp? The way u have done configuration, there will not be any problem if u are calling the CustomerAction and the CustomerAction action is doing a forward to the jsp. BEcause then only the form bean will be available. How u are executing the jsp? -Original Message- From: satyanarayana [mailto:[EMAIL PROTECTED]] Sent: Monday, December 09, 2002 1:57 PM To: struts-user Cc: satyanarayana Subject: No bean found under attribute key - any config problem? Greetings, I am new to Struts list I am getting an exception with the message No bean found under attribute key customerForm when I am accessing the JSP where in which I am using the logic:equal tag. I am using this tag to check whether a formbean variable (called action) value is equal to new or not. I have configured the formbean with the name customerForm in the config file. and I am sure that the bean is in classpath. I am in need of the corrective action to solve the problem The following are the details.. Thanks, Satya I have written an Action Form class called org.ig.shopone.web.CustomerForm that is having following 6 fields with public getter and setter methods (along with validate and reset methods).. private String name; private String address; private String customerId; private String password; private String password2; private String action; I am using the above Form in a JSP to check whether the action field value is new or edit. html:html head logic:equal name=customerForm property=action scope=request value=new titlebean:message key=customer.new.title//title /logic:equal logic:notEqual name=customerForm property=action scope=request value=new titlebean:message key=customer.edit.title//title /logic:notEqual html:base/ /head body bgcolor=white html:errors/ ... .. When I am executing the above JSP file I am getting the following Exception -- -- -- HTTP Status 500 - type Exception report message description The server encountered an internal error () that prevented it from fulfilling this request. exception org.apache.jasper.JasperException: No bean found under attribute key customerForm void org.apache.jasper.servlet.JspServletWrapper.service(javax.servlet.http.HttpS ervl etRequest, javax.servlet.http.HttpServletResponse, boolean) JspServletWrapper.java:248 void org.apache.jasper.servlet.JspServlet.serviceJspFile(javax.servlet.http.HttpS ervl etRequest, javax.servlet.http.HttpServletResponse, java.lang.String, java.lang.Throwable, boolean) JspServlet.java:289 void org.apache.jasper.servlet.JspServlet.service(javax.servlet.http.HttpServletR eque st, javax.servlet.http.HttpServletResponse) JspServlet.java:240 ... -- -- -- The following is the configuration file ?xml version = '1.0' encoding = 'windows-1252'? !DOCTYPE struts-config PUBLIC -//Apache Software Foundation//DTD Struts Configuration 1.1//EN
RE: No bean found under attribute key - any config problem?
Hi Satya, From what you've included of your JSP file, it looks like the problem is that the page has no reference to the customrForm bean by the time you go to use it. The html:form.../ tag makes this bean available, but since you are using the logic tags inside your header rather than within an html:form, this bean is not available. If the action property does in fact belong in your form bean (as opposed to being its own request attribute), then you can import the form bean with a jsp:useBean.../ tag at the top of your JSP. I don't know how well jsp:useBean and html:form play together when referencing the same bean, but give it a try with something like this: jsp:useBean id=customerForm scope=request type=org.ig.shopone.web.CustomerForm/ Just put that line at the top of your JSP and see what you get. If the action property is never part of your form, then you might want to consider making it its own request attribute, populated within the Action class, and imported with a jsp:useBean tag similar to the one above. HTH, Justin -Original Message- From: Satyanarayana M [mailto:[EMAIL PROTECTED]] Sent: Monday, December 09, 2002 7:57 AM To: [EMAIL PROTECTED] Subject: No bean found under attribute key - any config problem? Greetings, I am new to Struts list I am getting an exception with the message No bean found under attribute key customerForm when I am accessing the JSP where in which I am using the logic:equal tag. I am using this tag to check whether a formbean variable (called action) value is equal to new or not. I have configured the formbean with the name customerForm in the config file. and I am sure that the bean is in classpath. I am in need of the corrective action to solve the problem The following are the details.. Thanks, Satya I have written an Action Form class called org.ig.shopone.web.CustomerForm that is having following 6 fields with public getter and setter methods (along with validate and reset methods).. private String name; private String address; private String customerId; private String password; private String password2; private String action; I am using the above Form in a JSP to check whether the action field value is new or edit. html:html head logic:equal name=customerForm property=action scope=request value=new titlebean:message key=customer.new.title//title /logic:equal logic:notEqual name=customerForm property=action scope=request value=new titlebean:message key=customer.edit.title//title /logic:notEqual html:base/ /head body bgcolor=white html:errors/ ... .. When I am executing the above JSP file I am getting the following Exception -- HTTP Status 500 - type Exception report message description The server encountered an internal error () that prevented it from fulfilling this request. exception org.apache.jasper.JasperException: No bean found under attribute key customerForm void org.apache.jasper.servlet.JspServletWrapper.service(javax.serv let.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, boolean) JspServletWrapper.java:248 void org.apache.jasper.servlet.JspServlet.serviceJspFile(javax.serv let.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, java.lang.String, java.lang.Throwable, boolean) JspServlet.java:289 void org.apache.jasper.servlet.JspServlet.service(javax.servlet.htt p.HttpServletRequest, javax.servlet.http.HttpServletResponse) JspServlet.java:240 ... -- The following is the configuration file ?xml version = '1.0' encoding = 'windows-1252'? !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=customerForm type=org.ig.shopone.web.CustomerForm/ /form-beans action-mappings action path=/customer type=org.ig.shopone.web.actions.CustomerAction name=customerForm scope=request/ /action-mappings message-resources parameter=ApplicationResources/ /struts-config -- -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Multiple Submit Buttons + Internationalisation
LookupDispatchAction is not for everyone in every situation. Understanding the mechanism can help you really solve your issues. Edgar -Original Message- From: Gemes Tibor [mailto:[EMAIL PROTECTED]] Sent: Monday, December 09, 2002 7:53 AM To: Struts Users Mailing List Subject: Re: Multiple Submit Buttons + Internationalisation 2002. december 9. 13:48 dátummal John D Hume ezt írtad: You could probably compare pRequest.getParameter(Submit) against the internationalized string, though it might be better to go a way that won't make you dependent on those labels. You could flip it around and decide based on the Name of the submit button. Something like: LookupDispatchAction? http://husted.com/struts/tips/003.html Hth, Tib -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
AW: Multiple Submit Buttons + Internationalisation
Hello! Just try out this little Javascript Function: function submitAndUpdate (action) { document.forms.fromName.action=action; document.forms.fromName.submit(); } formName have to be the name of your form. Kind regards, Arne Clauß gedas deutschland GmbH FG Electronic Systems Pascalstraße 11, D-10587 Berlin Telefon/phone +49-30-3997-1461 Telefax/telefax +49-30-3997-222-1461 mailto:[EMAIL PROTECTED] http://www.gedas.com -- -Ursprüngliche Nachricht- Von: Pat Quinn [mailto:[EMAIL PROTECTED]] Gesendet: Montag, 9. Dezember 2002 12:35 An: [EMAIL PROTECTED] Betreff: Multiple Submit Buttons + Internationalisation Multiple Submit Buttons + Internationalisation I have a jsp with three submit buttons (update, delete etc..) each with a value as loaded from the resource bundle: input type=submit name=Submit value=bean:message key='label.update'/ In my action class i do the following to identify which button has submitted the form: if (Update.equalsIgnoreCase(pRequest.getParameter(Submit))) { //Process my update } This works fine when viewed from a browser with an English locale, if the locale is anything different it fails. Its obvious why this doesn't work as i've hardcode the action class to one locale (English). Can someone please suggest a different approach? Cheers _ MSN 8 helps eliminate e-mail viruses. Get 2 months FREE*. http://join.msn.com/?page=features/virus -- To unsubscribe, e-mail: mailto:struts-user- [EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Multiple Submit Buttons + Internationalisation
On a related topic...does the HTTP standard specify that for a set of submit buttons with the same name, only the one that's pressed will be sent with the request? I seem to remember in earlier days that this wasn't always guaranteed, and therefore I generally make a rule to avoid it. Is my memory fuzzy and this always worked, or is this submit button functionality relying on the HTTP implementation of certain browsers, but not necessarily all of them. Thanks, Justin -Original Message- From: Gemes Tibor [mailto:[EMAIL PROTECTED]] Sent: Monday, December 09, 2002 7:53 AM To: Struts Users Mailing List Subject: Re: Multiple Submit Buttons + Internationalisation 2002. december 9. 13:48 dátummal John D Hume ezt írtad: You could probably compare pRequest.getParameter(Submit) against the internationalized string, though it might be better to go a way that won't make you dependent on those labels. You could flip it around and decide based on the Name of the submit button. Something like: LookupDispatchAction? http://husted.com/struts/tips/003.html Hth, Tib -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Multiple Submit Buttons + Internationalisation
2002. december 9. 14:55 dátummal Edgar P. Dollin ezt írtad: LookupDispatchAction is not for everyone in every situation. Understanding the mechanism can help you really solve your issues. Yes, you're right. But the details he provided us about his problem were exactly the same LookupDispathAction was created for imho. So I dared to suggest it. However if it doesn't fit the thread-starter I reckon he will provide more details. While I am writing this I try hard to come up with a case which LookupDispathAction doesn't solve and has the same charasteristics the thread-starter required. I cannot find it. Ideas? Tib -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Multiple Submit Buttons + Internationalisation
2002. december 9. 14:53 dátummal Justin Ashworth ezt írtad: On a related topic...does the HTTP standard specify that for a set of submit buttons with the same name, only the one that's pressed will be sent with the request? It is html not http. Check the successsful controls in html: http://www.w3.org/TR/html401/interact/forms.html#h-17.13.2 Hth, Tib -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Multiple Submit Buttons + Internationalisation
Thank you - that clears it all up. Thanks for the correction too. :) -Original Message- From: Gemes Tibor [mailto:[EMAIL PROTECTED]] Sent: Monday, December 09, 2002 9:08 AM To: Struts Users Mailing List Subject: Re: Multiple Submit Buttons + Internationalisation 2002. december 9. 14:53 dátummal Justin Ashworth ezt írtad: On a related topic...does the HTTP standard specify that for a set of submit buttons with the same name, only the one that's pressed will be sent with the request? It is html not http. Check the successsful controls in html: http://www.w3.org/TR/html401/interact/forms.ht ml#h-17.13.2 Hth, Tib -- To unsubscribe, e-mail: mailto:struts-user- [EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Validation Message Order
Hi, When using the validator, how do I change the order of the messages. Currently, the error messages returned are Password Username This doesn't correspond with how the fields are layed out in the form. I would like the JavaScript error to read Username Password Is there any way to do this? I tried setting the fieldOrder attribute in the validation.xml but that didn't work. Any suggestions? thanks Jordan -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
does ActionForm support inheritance field
Hello, Sorry to send the question again. But I didn't see the message appearing on the mailing list for some reasons. Besides the previous message has a wrong return email address. I have an ActionForm, which includes a field/getter/setter of subclass. The subclass inherits the description field/getter/setter method from its superclass. In my JSP page, I try to access the description. But it is complained no getter method for subclass.description in the ActionForm. Does anybody have any clue? Is it a limitation of Struts? Thanks. Denis -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: does ActionForm support inheritance field
if u cans end sample code(the form classs relavent code and jsp), may be somebody can help u... But there is no reason for struts to impose any such restriction .. -Original Message- From: dwang [mailto:[EMAIL PROTECTED]] Sent: Monday, December 09, 2002 3:28 PM To: struts-user Cc: dwang Subject: does ActionForm support inheritance field Hello, Sorry to send the question again. But I didn't see the message appearing on the mailing list for some reasons. Besides the previous message has a wrong return email address. I have an ActionForm, which includes a field/getter/setter of subclass. The subclass inherits the description field/getter/setter method from its superclass. In my JSP page, I try to access the description. But it is complained no getter method for subclass.description in the ActionForm. Does anybody have any clue? Is it a limitation of Struts? Thanks. Denis -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
newbie question - tags in JSTL vs Struts
I'm enjoying using Struts very much. :) I'm trying to figure out how to decide when to use a JSTL tag and when to use a Struts tag - more so when the tags have similar functionality (e.g. for looping and for conditional statements). How do you folks decide when to use one over the other? Are there special circumstances when you *have* to use one over the other? -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: newbie question - tags in JSTL vs Struts
I think u should use struts tags only when there is no corresponding jstl tag.. reason being jstl is THE STANDARD tag library...SO stick to it as far as possible ... -Original Message- From: agrawalanuj [mailto:[EMAIL PROTECTED]] Sent: Monday, December 09, 2002 3:29 PM To: struts-user Cc: agrawalanuj Subject: newbie question - tags in JSTL vs Struts I'm enjoying using Struts very much. :) I'm trying to figure out how to decide when to use a JSTL tag and when to use a Struts tag - more so when the tags have similar functionality (e.g. for looping and for conditional statements). How do you folks decide when to use one over the other? Are there special circumstances when you *have* to use one over the other? -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: newbie question - tags in JSTL vs Struts
I always use JSTL over Struts when possible. I only import the Struts html taglib and use the JSTL for everything else. David From: Anuj Agrawal [EMAIL PROTECTED] Reply-To: [EMAIL PROTECTED] To: Struts User Mailing List [EMAIL PROTECTED] Subject: newbie question - tags in JSTL vs Struts Date: Mon, 09 Dec 2002 09:28:49 -0500 I'm enjoying using Struts very much. :) I'm trying to figure out how to decide when to use a JSTL tag and when to use a Struts tag - more so when the tags have similar functionality (e.g. for looping and for conditional statements). How do you folks decide when to use one over the other? Are there special circumstances when you *have* to use one over the other? -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] _ Protect your PC - get McAfee.com VirusScan Online http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
query parameters
In order to understand the correct flow of Struts, i'm trying to create a simple form that has 2 fields and a Next and Previous button/link. As i click the buttons/links, i want the form fields to be filled with data from a database (1 record at a time). This appears easy enough to do - i could simply make the Next/Previous buttons/links point to a next.do or prev.do servlet which would perform some Action (which in turn would use some delegate (?) to access the database and populate the formbean) and then redirect (forward) to the particular JSP (to auto-fill the fields). (Jeez! I hope i got the above right so far). HOWEVER, what i'd *like* to be able to do is each page should be book-markable - i.e. the page should have a query string (perhaps ?id=primaryKeyinDatabase) so that the user can get to a particular record directly. It seems to me that by doing the redirect (forward) from the servlet, i would not be able to achieve this? How can i do the above? Or is this one of those cases where i *shouldn't* be using Struts? Help? :) Anuj. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Help needed for a struts beginner!
Hi, I am a Java/JSP/struts beginner. Have never used them before (I have worked strictly on the mainframe), but need to know them now in order to put together some web pages for the company where I am consulting. Is there any place that I can find a good step-by-step tutorial on the web that will help me to at least be able to put together our presentation level (which used to be a fairly simple HTML page, but now will have to be so much more complex)? I have been hunting around at the jakarta.apache.org site, but have not found anything that speaks to me at my level (a very low one..I am sorry!). Remember: Peace, Love Understanding Always David R
Re: Multiple Submit Buttons + Internationalisation
Cheers guys for all the feedback I used the LookupDispatchAction approach. Personally i don't like using JavaScript so i try to stay well clear of it as much as i can. Cheers, Pat From: Gemes Tibor [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Subject: Re: Multiple Submit Buttons + Internationalisation Date: Mon, 9 Dec 2002 14:57:10 +0100 2002. december 9. 14:55 dátummal Edgar P. Dollin ezt írtad: LookupDispatchAction is not for everyone in every situation. Understanding the mechanism can help you really solve your issues. Yes, you're right. But the details he provided us about his problem were exactly the same LookupDispathAction was created for imho. So I dared to suggest it. However if it doesn't fit the thread-starter I reckon he will provide more details. While I am writing this I try hard to come up with a case which LookupDispathAction doesn't solve and has the same charasteristics the thread-starter required. I cannot find it. Ideas? Tib -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] _ Help STOP SPAM with the new MSN 8 and get 2 months FREE* http://join.msn.com/?page=features/junkmail -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: newbie question - tags in JSTL vs Struts
Wow! Thanks Shirish and David! This mailing list is GREAT! :) I figured i would get answers like that. So the follow-up question is will Struts ever phase out some of these 'duplicated' tag functionality? :) Thanks. Anuj. -Original Message- From: David Graham [mailto:[EMAIL PROTECTED]] I always use JSTL over Struts when possible. I only import the Struts html taglib and use the JSTL for everything else. -Original Message- From: [EMAIL PROTECTED] I think u should use struts tags only when there is no corresponding jstl tag.. reason being jstl is THE STANDARD tag library...SO stick to it as far as possible ... -Original Message- From: agrawalanuj [mailto:[EMAIL PROTECTED]] I'm trying to figure out how to decide when to use a JSTL tag and when to use a Struts tag - more so when the tags have similar functionality (e.g. for looping and for conditional statements). How do you folks decide when to use one over the other? Are there special circumstances when you *have* to use one over the other? -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
begginer help
An addition to my help for a beginner question..A complete example of an index.jsp used within the struts framework would be so helpful to me and my colleagues. It seems that all that I have been able to find so far are snippets of code Remember: Peace, Love Understanding Always David R
RE: newbie question - tags in JSTL vs Struts
there are some posts in the mailing list archive on struts:el tags which discuss the same.. -Original Message- From: agrawalanuj [mailto:[EMAIL PROTECTED]] Sent: Monday, December 09, 2002 3:45 PM To: struts-user Cc: agrawalanuj Subject: RE: newbie question - tags in JSTL vs Struts Wow! Thanks Shirish and David! This mailing list is GREAT! :) I figured i would get answers like that. So the follow-up question is will Struts ever phase out some of these 'duplicated' tag functionality? :) Thanks. Anuj. -Original Message- From: David Graham [mailto:[EMAIL PROTECTED]] I always use JSTL over Struts when possible. I only import the Struts html taglib and use the JSTL for everything else. -Original Message- From: [EMAIL PROTECTED] I think u should use struts tags only when there is no corresponding jstl tag.. reason being jstl is THE STANDARD tag library...SO stick to it as far as possible ... -Original Message- From: agrawalanuj [mailto:[EMAIL PROTECTED]] I'm trying to figure out how to decide when to use a JSTL tag and when to use a Struts tag - more so when the tags have similar functionality (e.g. for looping and for conditional statements). How do you folks decide when to use one over the other? Are there special circumstances when you *have* to use one over the other? -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
related code RE: does ActionForm support inheritance field
JSP: nested:form action='/myquestion' nested:nest property='scheduleVO' nested:text property='description' size=30/ ... ActionForm: ... private ScheduleVO scheduleVO; public ScheduleVO getScheduleVO() { return this.scheduleVO; } public void setScheduleVO(ScheduleVO scheduleVO) { this.scheduleVO = scheduleVO; } ... ScheduleVO: public class ScheduleVO extends ScheduleBean { ... } ScheduleBean, which is in the same package with ScheduleVO: ... String description; // i tried both package level/private level access modifier public String getDescription() { return this.description; } public void setDescription(String description) { this.description = description; } . -Original Message- From: Denis Wang [mailto:[EMAIL PROTECTED]] Sent: Monday, December 09, 2002 9:28 AM To: struts Subject: does ActionForm support inheritance field Hello, Sorry to send the question again. But I didn't see the message appearing on the mailing list for some reasons. Besides the previous message has a wrong return email address. I have an ActionForm, which includes a field/getter/setter of subclass. The subclass inherits the description field/getter/setter method from its superclass. In my JSP page, I try to access the description. But it is complained no getter method for subclass.description in the ActionForm. Does anybody have any clue? Is it a limitation of Struts? Thanks. Denis -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: begginer help
Check out the Admin Module of Tomcat 4.1 download the src version. Its developed using Struts. I found it a good reference to work from when i started out. From: David Rothschadl [EMAIL PROTECTED] Reply-To: [EMAIL PROTECTED] To: Struts User Mailing List [EMAIL PROTECTED] Subject: begginer help Date: Mon, 9 Dec 2002 06:48:50 -0800 (PST) An addition to my help for a beginner question..A complete example of an index.jsp used within the struts framework would be so helpful to me and my colleagues. It seems that all that I have been able to find so far are snippets of code Remember: Peace, Love Understanding Always David R _ STOP MORE SPAM with the new MSN 8 and get 2 months FREE* http://join.msn.com/?page=features/junkmail -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Help needed for a struts beginner!
2002. december 9. 15:43 dátummal David Rothschadl ezt írtad: Hi, I am a Java/JSP/struts beginner. Have never used them before (I have worked strictly on the mainframe), but need to know them now in order to put together some web pages for the company where I am consulting. Is there any place that I can find a good step-by-step tutorial on the web that will help me to at least be able to put together our presentation level (which used to be a fairly simple HTML page, but now will have to be so much more complex)? What about the struts-example.war? Hth, Tib -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
validation
Dear, I am newcomer. Please answer why (java-script)validation does not work in the struts-example. //-- %@ page contentType=text/html;charset=UTF-8 language=java % %@ taglib uri=/WEB-INF/struts-bean.tld prefix=bean % %@ taglib uri=/WEB-INF/struts-html.tld prefix=html % html:html locale=true head titlebean:message key=logon.title//title html:base/ /head body bgcolor=white html:errors/ html:form action=/logon focus=username onsubmit=return validateLogonForm(this); table border=0 width=100% tr th align=right bean:message key=prompt.username/: /th td align=left html:text property=username size=16 maxlength=18/ /td /tr tr th align=right bean:message key=prompt.password bundle=alternate/: /th td align=left html:password property=password size=16 maxlength=18 redisplay=false/ /td /tr tr td align=right html:submit value=Submit/ /td td align=left html:reset/ /td /tr /table /html:form html:javascript formName=logonForm dynamicJavascript=true staticJavascript=false/ script language=Javascript1.1 src=staticJavascript.jsp/script /body /html:html //--- Best regards, Dmitry. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: query parameters
You would have an id query parameter telling the page which record to display. The previous/next links would need to point to the next id not just a general previous command. You can cache the results in the session so you can find the next id in the list. David From: Anuj Agrawal [EMAIL PROTECTED] Reply-To: [EMAIL PROTECTED] To: Struts User Mailing List [EMAIL PROTECTED] Subject: query parameters Date: Mon, 09 Dec 2002 09:39:32 -0500 In order to understand the correct flow of Struts, i'm trying to create a simple form that has 2 fields and a Next and Previous button/link. As i click the buttons/links, i want the form fields to be filled with data from a database (1 record at a time). This appears easy enough to do - i could simply make the Next/Previous buttons/links point to a next.do or prev.do servlet which would perform some Action (which in turn would use some delegate (?) to access the database and populate the formbean) and then redirect (forward) to the particular JSP (to auto-fill the fields). (Jeez! I hope i got the above right so far). HOWEVER, what i'd *like* to be able to do is each page should be book-markable - i.e. the page should have a query string (perhaps ?id=primaryKeyinDatabase) so that the user can get to a particular record directly. It seems to me that by doing the redirect (forward) from the servlet, i would not be able to achieve this? How can i do the above? Or is this one of those cases where i *shouldn't* be using Struts? Help? :) Anuj. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] _ Add photos to your e-mail with MSN 8. Get 2 months FREE*. http://join.msn.com/?page=features/featuredemail -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: begginer help
Download Struts 1.1b2 or a recent nightly build and run the stuts-example webapp. This has good examples of struts coding. David From: David Rothschadl [EMAIL PROTECTED] Reply-To: [EMAIL PROTECTED] To: Struts User Mailing List [EMAIL PROTECTED] Subject: begginer help Date: Mon, 9 Dec 2002 06:48:50 -0800 (PST) An addition to my help for a beginner question..A complete example of an index.jsp used within the struts framework would be so helpful to me and my colleagues. It seems that all that I have been able to find so far are snippets of code Remember: Peace, Love Understanding Always David R _ STOP MORE SPAM with the new MSN 8 and get 2 months FREE* http://join.msn.com/?page=features/junkmail -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Using nested:link tag
For this nested:link is no different from html:link. Please see http://jakarta.apache.org/struts/userGuide/struts-html.html#link. In particular look at the usage of the property attribute. It allows you to specify a Map of parameters. Sri -Original Message- From: A Stephen [mailto:[EMAIL PROTECTED]] Sent: Saturday, December 07, 2002 7:01 PM To: Struts Users Mailing List Subject: Using nested:link tag Greetings, I'm trying to use the nested:link tag, i need an additonal parameter/value I would like the result to be a href=/edit.do?action=editkey=%=key% Name /a Where the key value is the property 'key', * nested:iterate property=items tr td nested:link href=/edit.do?action=editkey= [nested:write property=name / /nested:link /td /tr /nested:iterate ** Thank you, -S -- To unsubscribe, e-mail: mailto:struts-user- [EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: EJB's and Collections of Objects
There's a pattern called value objects (or view objects) you may want to check out. Mike Lee - Original Message - From: Gemes Tibor [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Monday, December 09, 2002 7:13 AM Subject: Re: EJB's and Collections of Objects 2002. december 9. 12:52 dátummal Jordan Thomas ezt írtad: Is there a standard or better way to get my objects out into my struts application? I think that it is rather straightforward and clean. Is it working for you? Is it fast enough? Does it suit your needs? If yes, there is no problem. Btw this is how I do as well. Hth, Tib -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: query parameters
Well, i understand what you are suggesting. Let me re-state my question in a different way. How can i set it up so that when a user goes to http://some.domain.name.here/simpleapp/view.jsp?id=5, it would automatically load the form and display results from the database pertaining to record with ID=5 (obviously the next and prev links would have the appropriate query parameters). I know (i think) how to do this directly in the JSP (using JSTL's db-querying tags), but i thought that only the servlet should access the database and obtain the record, so how would my JSP page invoke the servlet to get the data from the database? Am i over-complicating it? :( Anuj. -Original Message- From: David Graham [mailto:[EMAIL PROTECTED]] You would have an id query parameter telling the page which record to display. The previous/next links would need to point to the next id not just a general previous command. You can cache the results in the session so you can find the next id in the list. From: Anuj Agrawal [EMAIL PROTECTED] In order to understand the correct flow of Struts, i'm trying to create a simple form that has 2 fields and a Next and Previous button/link. As i click the buttons/links, i want the form fields to be filled with data from a database (1 record at a time). This appears easy enough to do - i could simply make the Next/Previous buttons/links point to a next.do or prev.do servlet which would perform some Action (which in turn would use some delegate (?) to access the database and populate the formbean) and then redirect (forward) to the particular JSP (to auto-fill the fields). (Jeez! I hope i got the above right so far). HOWEVER, what i'd *like* to be able to do is each page should be book-markable - i.e. the page should have a query string (perhaps ?id=primaryKeyinDatabase) so that the user can get to a particular record directly. It seems to me that by doing the redirect (forward) from the servlet, i would not be able to achieve this? How can i do the above? Or is this one of those cases where i *shouldn't* be using Struts? -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Multiple Submit Buttons + Internationalisation
If you want creater control of the button or if you want to use anchors or you have subclassed other classes to get where you are going. The list is pretty large. Edgar -Original Message- From: Gemes Tibor [mailto:[EMAIL PROTECTED]] Sent: Monday, December 09, 2002 8:57 AM To: Struts Users Mailing List Subject: Re: Multiple Submit Buttons + Internationalisation 2002. december 9. 14:55 dátummal Edgar P. Dollin ezt írtad: LookupDispatchAction is not for everyone in every situation. Understanding the mechanism can help you really solve your issues. Yes, you're right. But the details he provided us about his problem were exactly the same LookupDispathAction was created for imho. So I dared to suggest it. However if it doesn't fit the thread-starter I reckon he will provide more details. While I am writing this I try hard to come up with a case which LookupDispathAction doesn't solve and has the same charasteristics the thread-starter required. I cannot find it. Ideas? Tib -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: query parameters
-Original Message- From: Anuj Agrawal [mailto:[EMAIL PROTECTED]] I know (i think) how to do this directly in the JSP (using JSTL's db-querying tags), but i thought that only the servlet should access the database and obtain the record, so how would my JSP page invoke the servlet to get the data from the database? Am i over-complicating it? :( Normally the flow in a Struts application is like this: browser --(1)-- Action --(2)-- JSP (1) is where the browser's request is handled by the ActionServlet, and where the ActionServlet figures out what Action to invoke. The Action is responsible for retrieving any data needed (or invoking model-layer components to produce the data for it). (2) is where the Action puts this data in the request or somewhere else from which the JSP (which hasn't entered the picture yet) can retrieve it. I've oversimplified the architecture above, but you should get the idea. This is much different from the other way of doing things, which, from your messages, it looks like you're familiar with, viz. where a single JSP page gets data as it is needed, printing it out as it encounters it. This way of doing things is usually not recommended by Those in the Know because it freely mixes business logic with view logic. So, to answer your question literally, your JSP never invokes your servlet to get the data from the database. And you are correct that only the servlet (or a Struts Action, or something called by a Struts Action) should access the data in the database. Hope this helps, and that I haven't inadvertently patronized you. Cheers, Laird -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: tiles-documentation causing a Digester error -plug-in mustbe declared?
Are you sure you are checking the right file ? Cedric aps olute wrote: I am getting this error in the log, and since not all the links under the menu of this http://localhost:8080/tiles-documentation/examples/index.jsp is working, I will pressume those are related to the error. 27 Dec 7, 2002 12:40:40 PM org.apache.struts.util.PropertyMessageResources init 28 INFO: Initializing, config='org.apache.struts.action.ActionResources', r eturnNull=true 29 Dec 7, 2002 12:40:41 PM org.apache.struts.util.PropertyMessageResources init 30 INFO: Initializing, config='org.apache.struts.example.tiles.dev1-1.Appli cationResources', returnNull=true 31 Dec 7, 2002 12:40:42 PM org.apache.struts.util.PropertyMessageResources init 32 INFO: Initializing, config='org.apache.struts.webapp.tiles.dev1-1.Applic ationResources', returnNull=true 33 Dec 7, 2002 12:40:43 PM org.apache.commons.digester.Digester error 34 SEVERE: Parse Error at line 90 column 61: Element type plug-in must be declared. 35 org.xml.sax.SAXParseException: Element type plug-in must be declared. 36 at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseExceptio n(ErrorHandlerWrapper.java:232) 37 at org.apache.xerces.util.ErrorHandlerWrapper.error(ErrorHandlerWrap per.java:173) 38 at org.apache.xerces.impl.XMLErrorReporter.reportError(XMLErrorRepor ter.java:362) Furthermore, how to fix that plug-in must be declared error? The error points to line 90 but line is not related to tiles. The struts-config.xml has this: 89 forward name=successpath=/test/layout.jsp/ 90 forward name=failurepath=test.struts.action.fail/ 91 /action ... 235 plug-in className=org.apache.struts.tiles.TilesPlugin 236 set-property property=definitions-config 237 value=/WEB-INF/tiles-defs.xml, 238 /WEB-INF/tiles-tests-defs.xml,/WEB-INF/tiles -tutorial-defs.xml, 239 /WEB-INF/tiles-examples-defs.xml / 240 set-property property=definitions-debug value=1 / __ Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now. http://mailplus.yahoo.com -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: query parameters
Thanks for the response Laird. That's exactly the way i understood it so your response helped validate my understanding (and yes, that's precisely why i'm trying to use Struts - to separate business logic from presentation logic). However, after (2) takes place, i would have arrived at the JSP page displaying the particular database record. So how can a user bookmark the page to come back directly to this particular record? I guess if the URL had the servlet (+ query parameters), the user could bookmark that. But since there is a forward involved, wouldn't the URL (with the servlet+query parameters) be lost? What am i missing here? :( Anuj. -Original Message- From: Nelson, Laird [mailto:[EMAIL PROTECTED]] Normally the flow in a Struts application is like this: browser --(1)-- Action --(2)-- JSP (1) is where the browser's request is handled by the ActionServlet, and where the ActionServlet figures out what Action to invoke. The Action is responsible for retrieving any data needed (or invoking model-layer components to produce the data for it). (2) is where the Action puts this data in the request or somewhere else from which the JSP (which hasn't entered the picture yet) can retrieve it. I've oversimplified the architecture above, but you should get the idea. This is much different from the other way of doing things, which, from your messages, it looks like you're familiar with, viz. where a single JSP page gets data as it is needed, printing it out as it encounters it. This way of doing things is usually not recommended by Those in the Know because it freely mixes business logic with view logic. So, to answer your question literally, your JSP never invokes your servlet to get the data from the database. And you are correct that only the servlet (or a Struts Action, or something called by a Struts Action) should access the data in the database. Hope this helps, and that I haven't inadvertently patronized you. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
SV: query parameters
Example to help clarify: You should create an action mapping that looks something like: action type=yourpack.ShowRecordAction path=/viewrecord forward name=success path=/view.jsp / forward name=fail path=/error.jsp/ /action ShowRecordAction looks something like: package yourpack.ShowRecordAction; //imports. public class ShowRecordAction extends org.apache.struts.action.Action { public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { // Use the request parameter (for example id) that you provide to // do the lookup and put the record (or whatever object that you // want to print) in some scope request.setAttribute(record, yourRecordObject); // You can also find out the next and previous record ids here and put them // in some scope to // if all is ok you return mapping.findForward(success) // if something is not ok you can return mapping.findForward(fail); return yourActionForward; } } You are then free to use the record object in your jsp according to your needs, just retrieve it from whatever scope you put it in. To invoke the action you do: http://your.url.com/do/viewrecord?id=someIdToData (or http://your.url.com/viewrecord.do?id=someIdToData depending on the mapping in web.xml) Which in turns forwards to the jsp for display. This should work but I'm just a novice in Struts so... If I'm wrong I hope somebody corrects me /Marcus -Ursprungligt meddelande- Från: Anuj Agrawal [mailto:[EMAIL PROTECTED]] Skickat: den 9 december 2002 16:26 Till: Struts Users Mailing List Ämne: RE: query parameters Thanks for the response Laird. That's exactly the way i understood it so your response helped validate my understanding (and yes, that's precisely why i'm trying to use Struts - to separate business logic from presentation logic). However, after (2) takes place, i would have arrived at the JSP page displaying the particular database record. So how can a user bookmark the page to come back directly to this particular record? I guess if the URL had the servlet (+ query parameters), the user could bookmark that. But since there is a forward involved, wouldn't the URL (with the servlet+query parameters) be lost? What am i missing here? :( Anuj. -Original Message- From: Nelson, Laird [mailto:[EMAIL PROTECTED]] Normally the flow in a Struts application is like this: browser --(1)-- Action --(2)-- JSP (1) is where the browser's request is handled by the ActionServlet, and where the ActionServlet figures out what Action to invoke. The Action is responsible for retrieving any data needed (or invoking model-layer components to produce the data for it). (2) is where the Action puts this data in the request or somewhere else from which the JSP (which hasn't entered the picture yet) can retrieve it. I've oversimplified the architecture above, but you should get the idea. This is much different from the other way of doing things, which, from your messages, it looks like you're familiar with, viz. where a single JSP page gets data as it is needed, printing it out as it encounters it. This way of doing things is usually not recommended by Those in the Know because it freely mixes business logic with view logic. So, to answer your question literally, your JSP never invokes your servlet to get the data from the database. And you are correct that only the servlet (or a Struts Action, or something called by a Struts Action) should access the data in the database. Hope this helps, and that I haven't inadvertently patronized you. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: How to extend tiles SimpleMenuItem?
Zsolt Koppany wrote: Hi Cedric, where should I insert parserValidate=false? In the plugin declaration: plug-in className=org.apache.struts.tiles.TilesPlugin set-property property=parserValidate value=false/ ... Where should I use the bean tag? In which file and which block? In tiles config file, in place of insert Check the tiles-config dtd http://jakarta.apache.org/struts/dtds/tiles-config_1_1.dtd Cedric Zsolt On Friday 06 December 2002 10:56, Cedric Dumoulin wrote: Hi, You can extends SimpleMenuItem: * Write a class extending SimpleMenuItem, or implementing SimpleMenu. Add your new attributes * Declare your items in your tiles-config, and specify the classtype attribute: item classtype=YourClassName / * Also specify your new attributes: item ... myNewItem=aValue .../ * Enable the parser to parse your new attribute.There is several possibilities: o Disable the parser validation. This can be done in the TilesPlugin configuration: parserValidate=false o Or create your own DTD declaring your new attributes: + copy the original DTD, localize the item specification, add your own attributes + Specify your new DTD in the header of the tiles-config file Now the parser should be able to validate your new attributes. Another possibility is to use the bean .../ tag: o bean classtype=YourClassName set-property property=aName value=aValue / set-property property=anotherName value=anotherValue / . /bean Hope this help, Cedric Zsolt Koppany wrote: Hi, I have written a class that extends SimpleMenuItem but when I want to assign new items (see example below) I get error logs. How can I fix it? Example: item id=summary value=Summary selectionStyle=toolbar_summary_selected link=/proj/summary.do classtype=cv.struts.TilesMenuItem / Error messages: ERROR commons.digester.Digester - Parse Error at line 28 column -1: Attribute loggedOn is not declared for element item. [main] org.xml.sax.SAXParseException: Attribute loggedOn is not declared for element item. at org.apache.crimson.parser.Parser2.error(Parser2.java:3160) -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: query parameters
-Original Message- From: Anuj Agrawal [mailto:[EMAIL PROTECTED]] Thanks for the response Laird. That's exactly the way i understood it so your response helped validate my understanding (and yes, that's precisely why i'm trying to use Struts - to separate business logic from presentation logic). However, after (2) takes place, i would have arrived at the JSP page displaying the particular database record. So how can a user bookmark the page to come back directly to this particular record? I guess if the URL had the servlet (+ query parameters), the user could bookmark that. But since there is a forward involved, wouldn't the URL (with the servlet+query parameters) be lost? What am i missing here? :( Well, forget Struts for the moment. Let's just work with JSPs and servlets for a moment. I'd imagine that you'd probably want a URL scheme as you suggest, i.e. something like http://your.host/yourServletContext/yourServlet/showRecord?recordid=5. Then you'd have a servlet set up in your web application (rooted at the yourServletContext servlet context path) to receive URLs ending, let's say, in /yourServlet/*. When that servlet received any request, it would then do something like this: final String parameterValue = request.getParameter(recordid); if (parameterValue != null) { // ...try to parse it as an integer... // ...load up the database content based off of the record id... request.setAttribute(dbContent, databaseContent); // ...get a RequestDispatcher... // Forward to the appropriate JSP page. requestDispatcher.forward(...); } Your JSP would then reach into its request, either in a scriptlet or via the standard bean mechanisms, and would show the record data using expression tags. Once you get it working (or at least once you go through the thought exercise of how this would work) without Struts components, then it's easier to see how Struts fits into the big picture. Cheers, Laird -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
html:options encoded property
Hi! I wrote a JSP page with the following lines : ... html:select property=selectedProxies size=10 multiple=true html:options collection=proxies property=url labelProperty=name/ /html:select ... where name and url are the String attributes of a bean named Proxy. This code displays a box, with a list of names. When I select a name, this returns the corresponding url. The problem is that the url is written with escaped characters, BUT displayed with unescaped characters. For example, the bean Proxy has the following url linked with the name something : http://myhome/helloamp;action=quot;doSomethingquot;;. But, the resulting html page looks like this : ... select name=selectedProxies multiple=multiple size=10 option value=http://myhome/helloaction=doSomething;something/option ... The quot; character is translated. As a result the option value becomes http://helloaction=; : it stops at the first : character and doesn't take the whole url! doSomething is forgotten... I looked for attributes like filter for the html:options tag, but I didn't succeed...Has someone an idea to help me! Thank you! Nathalie -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: newbie question - tags in JSTL vs Struts
Here is a link to something Craig McClanahan wrote up about Struts, JSF, and JSTL... http://jakarta.apache.org/struts/proposals/struts-faces.html The portion relevent to this thread would be: The Struts tag libraries have had a tremendous positive impact on the development of the standard Java APIs for user interfaces. I joked with the JSTL spec lead that Struts users would *never* accept JSTL without an expression language at least as powerful as the Struts one; and there is more than a little truth to that statement :-). The same thing is happening now for the HTML tags -- and it's time for us to start migrating to the standards, which gives us the time to focus on extending Struts in other directions in the future. HTH, Justin -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Monday, December 09, 2002 9:50 AM To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: RE: newbie question - tags in JSTL vs Struts there are some posts in the mailing list archive on struts:el tags which discuss the same.. -Original Message- From: agrawalanuj [mailto:[EMAIL PROTECTED]] Sent: Monday, December 09, 2002 3:45 PM To: struts-user Cc: agrawalanuj Subject: RE: newbie question - tags in JSTL vs Struts Wow! Thanks Shirish and David! This mailing list is GREAT! :) I figured i would get answers like that. So the follow-up question is will Struts ever phase out some of these 'duplicated' tag functionality? :) Thanks. Anuj. -Original Message- From: David Graham [mailto:[EMAIL PROTECTED]] I always use JSTL over Struts when possible. I only import the Struts html taglib and use the JSTL for everything else. -Original Message- From: [EMAIL PROTECTED] I think u should use struts tags only when there is no corresponding jstl tag.. reason being jstl is THE STANDARD tag library...SO stick to it as far as possible ... -Original Message- From: agrawalanuj [mailto:[EMAIL PROTECTED]] I'm trying to figure out how to decide when to use a JSTL tag and when to use a Struts tag - more so when the tags have similar functionality (e.g. for looping and for conditional statements). How do you folks decide when to use one over the other? Are there special circumstances when you *have* to use one over the other? -- To unsubscribe, e-mail: mailto:struts-user- [EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:struts-user- [EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: query parameters
Marcus - Well, i certainly hope you are not wrong, cos this was the path i was going down. :) The only thing is when i use http://your.url.com/do/viewrecord?id=someIdToData (or http://your.url.com/viewrecord.do?id=someIdToData), it will then forward to http://your.url.com/view.jsp with the appropriate data filled in. So when the user looks at the URL, they will cut-and-paste http://your.url.com/view.jsp which will most likely display a blank form (at a later time). So i still haven't solved the original problem. Anuj. -Original Message- From: Marcus Andersson [mailto:[EMAIL PROTECTED]] Example to help clarify: You should create an action mapping that looks something like: action type=yourpack.ShowRecordAction path=/viewrecord forward name=success path=/view.jsp / forward name=fail path=/error.jsp/ /action ShowRecordAction looks something like: package yourpack.ShowRecordAction; //imports. public class ShowRecordAction extends org.apache.struts.action.Action { public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { // Use the request parameter (for example id) that you provide to // do the lookup and put the record (or whatever object that you // want to print) in some scope request.setAttribute(record, yourRecordObject); // You can also find out the next and previous record ids here and put them // in some scope to // if all is ok you return mapping.findForward(success) // if something is not ok you can return mapping.findForward(fail); return yourActionForward; } } You are then free to use the record object in your jsp according to your needs, just retrieve it from whatever scope you put it in. To invoke the action you do: http://your.url.com/do/viewrecord?id=someIdToData (or http://your.url.com/viewrecord.do?id=someIdToData depending on the mapping in web.xml) Which in turns forwards to the jsp for display. This should work but I'm just a novice in Struts so... If I'm wrong I hope somebody corrects me -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Access/Manage client's file system
But Andrew, this would involve the client putting information on the server, then downloading it to the client. That is just a tad inefficient, wouldn't you say? At 06:36 PM 12/9/2002 +0800, you wrote: Well, if you can make do with something thats rather user unfriendly you can use the standard html stuff: For the files to be saved on the users machine you could provide a link - clicking the link will allow the user to download the file which they can save on their machine. For the server to read the file you provide a file upload field and the user browses through their filesystem for the file required. Of course its a very manual process which is a lot more messy than the interface you hope for in your example and in both cases you have no control over the file names used. It is up to the user to choose where to save it, and also up to the user to select which file to send back. -Original Message- From: Heligon Sandra [mailto:[EMAIL PROTECTED]] Sent: Monday, December 09, 2002 17:17 To: '[EMAIL PROTECTED]' Cc: '[EMAIL PROTECTED]'; '[EMAIL PROTECTED]' Subject: Access/Manage client's file system Sorry not to have answered earlier but I did not work Friday. By 'local' I mean the client's machine not the server. First, the server offers templates to the client. Example of JSP: Name = Toto; Type = Data; Value = 12; etc Save Load Apply Cancel If the user select the save button I would like to save data on the client's machine and the load button allows to load a file from the client's machine. We could store instances of the template on the server but it is specific to each client that's why we think that it is better to allow the client to access file system. For us server allows to store only common data. If you think it is better to save data on the server, thanks to explain. Do you understand my question better ? If I understand your reply, to do that I must use Client plugin technologies. Do you have an example ? Thanks a lot Sandra -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] Micael --- This electronic mail transmission and any accompanying documents contain information belonging to the sender which may be confidential and legally privileged. This information is intended only for the use of the individual or entity to whom this electronic mail transmission was sent as indicated above. If you are not the intended recipient, any disclosure, copying, distribution, or action taken in reliance on the contents of the information contained in this transmission is strictly prohibited. If you have received this transmission in error, please delete the message. Thank you -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Help with reset() method in an subclass class of DynaValidatorForm
Hi, I am using html:checkbox with a property of deleted which is defined as an array String in Struts-config.xml file form-bean name=CreateProductsForAllForm dynamic=true type=com.f.M.G.w.ProductDynaValidatorForm form-property name=deleted initial= type=java.lang.String[]/ /form-bean where com.f.M.G.w.ProductDynaValidatorForm is a subclass of org.apache.sturts.validator.DynaValidatorForm. I need to override the reset() Method in ProductDynaValidatorForm for the html:multibox to work when the checkbox is unchecked. How can I access the deleted string array property of the bean and set the length of that string array to zero, ie. how can I set the deleted array length to zero.?? TIA, srinivas _ STOP MORE SPAM with the new MSN 8 and get 2 months FREE* http://join.msn.com/?page=features/junkmail -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: query parameters
Laird - Yeap! Thanks for your patience in helping me. I understand your (pure) JSP+Servlet example. However, even in that example, when the requestDispatcher.forward(...) is executed, doesn't the browser display the URL that the requestDispatcher forwarded to (which would be the JSP page)? So when the user views the page, they don't know that they had used http://your.host/yourServletContext/yourServlet/showRecord?recordid=5 to access this page, all they see is the *final* URL which is the JSP page that the servlet (showRecord) forwarded to. For example, in any forums, you can view a particular message using http://your.host/viewthread.jsp?messageid=123124 - does this mean that that forums application is *not* using MVC? and is using only JSP (with all logic embedded)? Thanks. Anuj. -Original Message- From: Nelson, Laird [mailto:[EMAIL PROTECTED]] Sent: Monday, December 09, 2002 10:46 AM To: 'Struts Users Mailing List' Subject: RE: query parameters -Original Message- From: Anuj Agrawal [mailto:[EMAIL PROTECTED]] Thanks for the response Laird. That's exactly the way i understood it so your response helped validate my understanding (and yes, that's precisely why i'm trying to use Struts - to separate business logic from presentation logic). However, after (2) takes place, i would have arrived at the JSP page displaying the particular database record. So how can a user bookmark the page to come back directly to this particular record? I guess if the URL had the servlet (+ query parameters), the user could bookmark that. But since there is a forward involved, wouldn't the URL (with the servlet+query parameters) be lost? What am i missing here? :( Well, forget Struts for the moment. Let's just work with JSPs and servlets for a moment. I'd imagine that you'd probably want a URL scheme as you suggest, i.e. something like http://your.host/yourServletContext/yourServlet/showRecord?recordid=5. Then you'd have a servlet set up in your web application (rooted at the yourServletContext servlet context path) to receive URLs ending, let's say, in /yourServlet/*. When that servlet received any request, it would then do something like this: final String parameterValue = request.getParameter(recordid); if (parameterValue != null) { // ...try to parse it as an integer... // ...load up the database content based off of the record id... request.setAttribute(dbContent, databaseContent); // ...get a RequestDispatcher... // Forward to the appropriate JSP page. requestDispatcher.forward(...); } Your JSP would then reach into its request, either in a scriptlet or via the standard bean mechanisms, and would show the record data using expression tags. Once you get it working (or at least once you go through the thought exercise of how this would work) without Struts components, then it's easier to see how Struts fits into the big picture. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Access/Manage client's file system
If nothing else, you could have a web app that zips up the files and sends them as one. The other thing is that you could have a refresh on the response (request) that will activate when a file download finishes, starting the next one until you are done. But, zip is best, I think. Why use the web for this? Micael At 06:05 PM 12/9/2002 +0530, you wrote: a little off the topic.. but is it possible to download multiple files using a single response from the server. Something like multiple upload to the server .. just that this case .. i want the client (browser/client application) to DOWNLOAD multiple file in a SINGLE response from the server.. am i clear.. enough?? subhro. - Original Message - From: Andrew Hill [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Monday, December 09, 2002 4:06 PM Subject: RE: Access/Manage client's file system Well, if you can make do with something thats rather user unfriendly you can use the standard html stuff: For the files to be saved on the users machine you could provide a link - clicking the link will allow the user to download the file which they can save on their machine. For the server to read the file you provide a file upload field and the user browses through their filesystem for the file required. Of course its a very manual process which is a lot more messy than the interface you hope for in your example and in both cases you have no control over the file names used. It is up to the user to choose where to save it, and also up to the user to select which file to send back. -Original Message- From: Heligon Sandra [mailto:[EMAIL PROTECTED]] Sent: Monday, December 09, 2002 17:17 To: '[EMAIL PROTECTED]' Cc: '[EMAIL PROTECTED]'; '[EMAIL PROTECTED]' Subject: Access/Manage client's file system Sorry not to have answered earlier but I did not work Friday. By 'local' I mean the client's machine not the server. First, the server offers templates to the client. Example of JSP: Name = Toto; Type = Data; Value = 12; etc Save Load Apply Cancel If the user select the save button I would like to save data on the client's machine and the load button allows to load a file from the client's machine. We could store instances of the template on the server but it is specific to each client that's why we think that it is better to allow the client to access file system. For us server allows to store only common data. If you think it is better to save data on the server, thanks to explain. Do you understand my question better ? If I understand your reply, to do that I must use Client plugin technologies. Do you have an example ? Thanks a lot Sandra -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] Micael --- This electronic mail transmission and any accompanying documents contain information belonging to the sender which may be confidential and legally privileged. This information is intended only for the use of the individual or entity to whom this electronic mail transmission was sent as indicated above. If you are not the intended recipient, any disclosure, copying, distribution, or action taken in reliance on the contents of the information contained in this transmission is strictly prohibited. If you have received this transmission in error, please delete the message. Thank you -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: newbie question - tags in JSTL vs Struts
Thanks Justin! That helps! Anuj. -Original Message- From: Justin Ashworth [mailto:[EMAIL PROTECTED]] Here is a link to something Craig McClanahan wrote up about Struts, JSF, and JSTL... http://jakarta.apache.org/struts/proposals/struts-faces.html The portion relevent to this thread would be: The Struts tag libraries have had a tremendous positive impact on the development of the standard Java APIs for user interfaces. I joked with the JSTL spec lead that Struts users would *never* accept JSTL without an expression language at least as powerful as the Struts one; and there is more than a little truth to that statement :-). The same thing is happening now for the HTML tags -- and it's time for us to start migrating to the standards, which gives us the time to focus on extending Struts in other directions in the future. HTH, -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: query parameters
-Original Message- From: Anuj Agrawal [mailto:[EMAIL PROTECTED]] However, even in that example, when the requestDispatcher.forward(...) is executed, doesn't the browser display the URL that the requestDispatcher forwarded to (which would be the JSP page)? Nope. So when the user views the page, they don't know that they had used http://your.host/yourServletContext/yourServlet/showRecord?rec ordid=5 to access this page, all they see is the *final* URL which is the JSP page that the servlet (showRecord) forwarded to. Nope. Forwarding is a servlet-specification thing, not an HTTP thing. So the URL that the user had in his location at time (1) (see my previous post) is the one that stays there. The process of forwarding is designed to be opaque to the end user--the servlet container actually could forward to 47 places and the user would never know the difference. (Now, an HTTP 302 *redirect* on the other hand *would* change his URL, and that's definitely not what you want.) Cheers, Laird -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Help needed for a struts beginner!
The point of struts in great part is to allow you to make the HTML page (response I assume you mean) simpler, not more complex. If it is going to become more complex, don't use Struts. Struts is an application FRAMEWORK that takes functionality off the page. But, if you are using fairly simple HTML you must mean fairly static pages. The pages you use are not particularly significant in the bottom line reason for Struts, even if Struts does have taglibs that are available. You might stop and think about what Struts is and what you want to do. The JSP thing is completely separate from Struts, although certainly consistent with it. You could use Struts and Velocity. 'Hope this bit of an overview is helpful. If I were you, I would get a copy of Struts in Action immediately. -Micael At 03:56 PM 12/9/2002 +0100, you wrote: 2002. december 9. 15:43 dátummal David Rothschadl ezt írtad: Hi, I am a Java/JSP/struts beginner. Have never used them before (I have worked strictly on the mainframe), but need to know them now in order to put together some web pages for the company where I am consulting. Is there any place that I can find a good step-by-step tutorial on the web that will help me to at least be able to put together our presentation level (which used to be a fairly simple HTML page, but now will have to be so much more complex)? What about the struts-example.war? Hth, Tib -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] Micael --- This electronic mail transmission and any accompanying documents contain information belonging to the sender which may be confidential and legally privileged. This information is intended only for the use of the individual or entity to whom this electronic mail transmission was sent as indicated above. If you are not the intended recipient, any disclosure, copying, distribution, or action taken in reliance on the contents of the information contained in this transmission is strictly prohibited. If you have received this transmission in error, please delete the message. Thank you -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: query parameters
Aha! Thanks Laird! That's where i was mistaken (somehow i recall, mistakenly, having a web app that used requestDispatcher.forward(...) and the URL was changed, must have done something differently i guess). In any case, i can move forward now. :) Thanks So Much! :) Anuj. -Original Message- From: Nelson, Laird [mailto:[EMAIL PROTECTED]] -Original Message- From: Anuj Agrawal [mailto:[EMAIL PROTECTED]] However, even in that example, when the requestDispatcher.forward(...) is executed, doesn't the browser display the URL that the requestDispatcher forwarded to (which would be the JSP page)? Nope. So when the user views the page, they don't know that they had used http://your.host/yourServletContext/yourServlet/showRecord?rec ordid=5 to access this page, all they see is the *final* URL which is the JSP page that the servlet (showRecord) forwarded to. Nope. Forwarding is a servlet-specification thing, not an HTTP thing. So the URL that the user had in his location at time (1) (see my previous post) is the one that stays there. The process of forwarding is designed to be opaque to the end user--the servlet container actually could forward to 47 places and the user would never know the difference. (Now, an HTTP 302 *redirect* on the other hand *would* change his URL, and that's definitely not what you want.) -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: query parameters
-Original Message- From: Anuj Agrawal [mailto:[EMAIL PROTECTED]] Aha! Thanks Laird! That's where i was mistaken (somehow i recall, mistakenly, having a web app that used requestDispatcher.forward(...) and the URL was changed, must have done something differently i guess). In any case, i can move forward now. :) Thanks So Much! :) No problem. Note as well that it follows from all this that if you ever wanted to forward to different JSPs (your requirements so far don't indicate this), the URL logged by your webserver will be the *incoming* URL and never the URL fragment to which you are forwarding. (I mention this because I've run into situations where the folks reading the webserver logs to divine what's going on in the application wanted to see the URLs of the JSPs to which we were forwarding.) Cheers, Laird -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: query parameters
Thanks for the additional note Laird. This could be solved by using appropriate logging in the servlet though, right? Anuj. -Original Message- From: Nelson, Laird [mailto:[EMAIL PROTECTED]] No problem. Note as well that it follows from all this that if you ever wanted to forward to different JSPs (your requirements so far don't indicate this), the URL logged by your webserver will be the *incoming* URL and never the URL fragment to which you are forwarding. (I mention this because I've run into situations where the folks reading the webserver logs to divine what's going on in the application wanted to see the URLs of the JSPs to which we were forwarding.) -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
SSL with Struts/Tomcat
Hi, Sorry, I think this question is more related to Tomcat and F5 load balancer instead of Struts related topic. But, I'm hoping that some one on this group has done/configured a similar environment like we have and point me to a direction on how to solve our problem with HTTPS. We are using Big IP 2000 application switches controller running config 4.2 PTF7. Basically, the problem is when HTTPS session is initiated (by requesting /abc/login.do servlet and it works fine), but the links or redirects within the page is sending the session back to an HTTP none secure session. SSL redirection and rewrite are configured on the F5 and seem to be working on pages without frames. However, for this particular site using frame pages, it does not appear to be working properly. Thanks, Tuan winmail.dat-- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: query parameters
-Original Message- From: Anuj Agrawal [mailto:[EMAIL PROTECTED]] Thanks for the additional note Laird. This could be solved by using appropriate logging in the servlet though, right? Yes, and that's the proper way to do it. Unless, of course, purely hypothetically speaking :-), you have reporting folks who insist on reading the same logs they've been reading from day one. Cheers, Laird -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Query on modular applications
Hello, We are looking for some help building a modular application. We are using Struts 1.1B2. We have had issues with not finding our message resources. Here is snippets of our struts-config and web.xml files. web.xml - init-param param-nameconfig/param-name param-value/WEB-INF/struts-config.xml/param-value /init-param init-param param-nameconfig/moduleA/param-name param-valueWEB-INF/struts-config-moduleA.xml/param-value /init-param - Our default struts-config.xml is: Default struts-config.xml -- ?xml version=1.0 encoding=ISO-8859-1 ? !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 /struts-config - Our struts-config-moduleA.xml file is: struts-config-moduleA.xml -- ?xml version=1.0 encoding=ISO-8859-1 ? !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 Bean Definitions === -- form-beans form-bean name=loginForm type=com.ui.moduleA.LoginForm/ /form-beans !-- == Global Forward Definitions == -- global-forwards forward name=moduleA/login path=login.jsp/ forward name=critical path=critical.jsp/ /global-forwards !-- == Action Mapping Definitions == -- action-mappings action path=login type=com.ui.moduleA.LoginAction name=loginForm scope=request input=/moduleA/login.jsp forward name=success path=/moduleA/loggedin.jsp/ /action /action-mappings controller processorClass=com.ui.moduleA.ModuleARequestProcessor/ message-resources parameter=resource.moduleA / /struts-config - Anyone who has built a modular application, can you please give us any pointers as to how to build a modular application. We are continuously getting problems not being able to find any of the action classes, resource files in any of the struts-config module files. Thanks, -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
query on modular applications
Hello, We are looking for some help building a modular application. We are using Struts 1.1B2. We have had issues with not finding our message resources. Here is snippets of our struts-config and web.xml files. web.xml - init-param param-nameconfig/param-name param-value/WEB-INF/struts-config.xml/param-value /init-param init-param param-nameconfig/moduleA/param-name param-valueWEB-INF/struts-config-moduleA.xml/param-value /init-param - Our default struts-config.xml is: Default struts-config.xml -- ?xml version=1.0 encoding=ISO-8859-1 ? !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 /struts-config - Our struts-config-moduleA.xml file is: struts-config-moduleA.xml -- ?xml version=1.0 encoding=ISO-8859-1 ? !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 Bean Definitions === -- form-beans form-bean name=loginForm type=com.ui.moduleA.LoginForm/ /form-beans !-- == Global Forward Definitions == -- global-forwards forward name=moduleA/login path=login.jsp/ forward name=critical path=critical.jsp/ /global-forwards !-- == Action Mapping Definitions == -- action-mappings action path=login type=com.ui.moduleA.LoginAction name=loginForm scope=request input=/moduleA/login.jsp forward name=success path=/moduleA/loggedin.jsp/ /action /action-mappings controller processorClass=com.ui.moduleA.ModuleARequestProcessor/ message-resources parameter=resource.moduleA / /struts-config - Anyone who has built a modular application, can you please give us any pointers as to how to build a modular application. We are continuously getting problems not being able to find any of the action classes, resource files in any of the struts-config module files. Thanks, -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Query on modular applications
You should first try using the latest nightly build because there have been several important bug fixes related to modules since beta 2. David From: Michael Cunningham [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: Query on modular applications Date: Mon, 09 Dec 2002 17:42:08 + Hello, We are looking for some help building a modular application. We are using Struts 1.1B2. We have had issues with not finding our message resources. Here is snippets of our struts-config and web.xml files. web.xml - init-param param-nameconfig/param-name param-value/WEB-INF/struts-config.xml/param-value /init-param init-param param-nameconfig/moduleA/param-name param-valueWEB-INF/struts-config-moduleA.xml/param-value /init-param - Our default struts-config.xml is: Default struts-config.xml -- ?xml version=1.0 encoding=ISO-8859-1 ? !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 /struts-config - Our struts-config-moduleA.xml file is: struts-config-moduleA.xml -- ?xml version=1.0 encoding=ISO-8859-1 ? !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 Bean Definitions === -- form-beans form-bean name=loginForm type=com.ui.moduleA.LoginForm/ /form-beans !-- == Global Forward Definitions == -- global-forwards forward name=moduleA/login path=login.jsp/ forward name=critical path=critical.jsp/ /global-forwards !-- == Action Mapping Definitions == -- action-mappings action path=login type=com.ui.moduleA.LoginAction name=loginForm scope=request input=/moduleA/login.jsp forward name=success path=/moduleA/loggedin.jsp/ /action /action-mappings controller processorClass=com.ui.moduleA.ModuleARequestProcessor/ message-resources parameter=resource.moduleA / /struts-config - Anyone who has built a modular application, can you please give us any pointers as to how to build a modular application. We are continuously getting problems not being able to find any of the action classes, resource files in any of the struts-config module files. Thanks, -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] _ STOP MORE SPAM with the new MSN 8 and get 2 months FREE* http://join.msn.com/?page=features/junkmail -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Pluggable Validation Not Being called, any ideas?
I'm using Struts 1.1B2, and have tried to create a pluggable validator similar to the example on Davids site. In my validation-rules.xml I have - validator name=twofields classname=us.ut.state.dced.filmrg.StrutsValidator method=validateTwoFieldsEqual msg=errors.twofieldsequal/ Then in my validation.xml, I have - field property=password depends=required,twofields arg0 key=candidateForm.password.displayname/ var var-namesecondProperty/var-name var-valueconfirmPassword/var-value /var /field When I run the application, the validation function is never called! (I put system.out.println in it, and they are not executed.) The function is - public static boolean validateTwoFieldsEqual(java.lang.Object bean, org.apache.commons.validator.ValidatorAction va, org.apache.commons.validator.Field field, ActionErrors errors, javax.servlet.http.HttpServletRequest request) { System.out.println(In Here!); String value = ValidatorUtil.getValueAsString(bean, field.getProperty()); String sProperty2 = field.getVarValue(secondProperty); String value2 = ValidatorUtil.getValueAsString(bean, sProperty2); if (!GenericValidator.isBlankOrNull(value)) { try { if (!value.equals(value2)) { errors.add(field.getKey(), StrutsValidatorUtil.getActionError(request, va, field)); return false; } } catch (Exception e) { errors.add(field.getKey(), StrutsValidatorUtil.getActionError(request, va, field)); return false; } } return true; } Any ideas how to get the validation function called? Do I need to register it somewhere to get it to work? Thanks, Ryan -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
bean:include
If this is not the correct forum for tag-lib questions someone let me know. Does anyone know of issues when using the bean:include tag with https The call: bean:include id = myInclude page = /includeTest.jsp / the error: Cannot create include URL: java.net.MalformedURLException: unknown protocol: https The standard jsp tag jsp:include page=/includeTest.jsp flush = true / works fine. thanks We come from the land of the ice and snow With the midnight sun, where the hot springs glow The hammer of the gods, will drive our ships to new lands Fight the horde, Sing and cry Valhalla I am coming
RE: bean:include
There's probably a more appropriate list for JSTL. However, the error message you are getting is probably cos you don't have jsse.jar, jcert.jar etc. in your classpath. HTH. Anuj. -Original Message- From: LUCERO,DENNIS (HP-Boise,ex1) [mailto:[EMAIL PROTECTED]] If this is not the correct forum for tag-lib questions someone let me know. Does anyone know of issues when using the bean:include tag with https The call: bean:include id = myInclude page = /includeTest.jsp / the error: Cannot create include URL: java.net.MalformedURLException: unknown protocol: https The standard jsp tag jsp:include page=/includeTest.jsp flush = true / works fine. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Design Question regarding navigation menu
Design question regarding navigation menu. (I am using tiles) Suppose I have a navigation menu with several choices/sections, I would like to highlight the choice/section the user is currently in. Example: choice A, choice B, choice C Which is the proper approach? Create a separate menu with each choice highlighted and then have each of my tile-definitions override to the correct one. OR Create one menu header and have it make the decision as to which menu choice to highlight based on some value (value would be set/altered by an Action) OR Create one menu header that makes a decision as to which menu choice to highlight based on the URL. I am leaning towards choice two. but I am not sure what the proper way is. Any suggestions/Examples would be great. Thank you Mark
RE: bean:include
Additionally see: http://www.javaworld.com/javaworld/javatips/jw-javatip96.html and http://forum.java.sun.com/thread.jsp?forum=45thread=225211 -Original Message- From: LUCERO,DENNIS (HP-Boise,ex1) [mailto:[EMAIL PROTECTED]] If this is not the correct forum for tag-lib questions someone let me know. Does anyone know of issues when using the bean:include tag with https The call: bean:include id = myInclude page = /includeTest.jsp / the error: Cannot create include URL: java.net.MalformedURLException: unknown protocol: https The standard jsp tag jsp:include page=/includeTest.jsp flush = true / works fine. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Help! Need Struts-El Library Compatible With Struts 1.1 B2
I guess I need a CVS lesson. Does anyone know how to do what Craig has suggested below? I surfed around the CVS site, but couldn't figure out how to issue the following command: cvs -d :pserver:[EMAIL PROTECTED]:/home/cvspublic update \ -D 11/07/2002 jakarta-struts Thanks, JOHN -Original Message- From: Craig R. McClanahan [mailto:[EMAIL PROTECTED]] Sent: Friday, December 06, 2002 8:35 PM To: Struts Users Mailing List Cc: '[EMAIL PROTECTED]' Subject: Re: Help! Need Struts-El Library Compatible With Struts 1.1 B2 On Fri, 6 Dec 2002, Hohlen, John wrote: Date: Fri, 6 Dec 2002 07:58:14 -0600 From: Hohlen, John [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] To: Struts-User (E-mail) [EMAIL PROTECTED] Cc: '[EMAIL PROTECTED]' [EMAIL PROTECTED] Subject: Help! Need Struts-El Library Compatible With Struts 1.1 B2 My team is attempting to use the Struts-El tag library with Struts 1.1 B2. Since the Struts-EL subproject was created after the beta 2 release, it's not included as part of the distribution. I'm looking for a version of the Struts-EL library that plays well with Struts 1.1 B2. The 11/7 version was suggested. Unfortunately, you can only get the last the nightly releases for the last two weeks (at least from what I can tell). Since there are so many teams using the Struts beta 2 release, is there anyway we put a version of the Struts-EL library that is believed to be beta 2 compatible on the website? Kind of like a beta release for the Struts beta 2 release. This will help people like myself and get more teams using Struts-EL. Thanks, JOHN. P.S. If anyone has the 11/7 release of Struts-EL, I'd love it if they could send it to me. It's a little bit of work, but you can actually rebuild the 11/07 nightly build of Struts by checking the sources out from anonymous CVS with a date restriction: cvs -d :pserver:[EMAIL PROTECTED]:/home/cvspublic update \ -D 11/07/2002 jakarta-struts and building it. For absolute matching of the actual nightly build, you'd want to do the same thing for all the commons packages that Struts depends on. Craig -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
[ANNOUNCE] Easy Struts 0.6.2 for Eclipse is out
Easy Strut 0.6.2 for Eclipse just released, changes : Check project nature before launching wizards (only javanature) Detect web project on WSAD (root is '/Web Content') Generate XDoclet comment for action and form bean classes (work on progress) Fix bue in form creation under Struts 1.0.2 Possibility to set a tiles definition in forward path. Remove Web Descriptor and Document root items in struts view (for the moment). Work with Eclipse 2.0 M3 release ! Fix NullPointerException when open struts-config.xml with modules.. KNOWS PROBLEMS : Modules in Easy Struts view not reconized with Eclipse M3 / WSAD 5 http://easystruts.sourceforge.net http://easystruts.sourceforge.net/update.html (recommended) Thanx, -emmanuel - Soyez solidaire soutenez laction du Téléthon avec Yahoo! France. Cliquez ici pour faire un don !
Re: Design Question regarding navigation menu
I could not follow your question. A good practices that I use is to have centralized navigation in XML, using Struts menu from sf.net. .V Mark Conlin wrote: Design question regarding navigation menu. (I am using tiles) Suppose I have a navigation menu with several choices/sections, I would like to highlight the choice/section the user is currently in. Example: choice A, choice B, choice C Which is the proper approach? Create a separate menu with each choice highlighted and then have each of my tile-definitions override to the correct one. OR Create one menu header and have it make the decision as to which menu choice to highlight based on some value (value would be set/altered by an Action) OR Create one menu header that makes a decision as to which menu choice to highlight based on the URL. I am leaning towards choice two. but I am not sure what the proper way is. Any suggestions/Examples would be great. Thank you Mark -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Help! Need Struts-El Library Compatible With Struts 1.1 B2
I guess I need a CVS lesson. Does anyone know how to do what Craig has suggested below? I surfed around the CVS site, but couldn't figure out how to issue the following command: cvs -d :pserver:[EMAIL PROTECTED]:/home/cvspublic update \ -D 11/07/2002 jakarta-struts Thanks, JOHN -Original Message- From: Craig R. McClanahan [mailto:[EMAIL PROTECTED]] Sent: Friday, December 06, 2002 8:35 PM To: Struts Users Mailing List Cc: '[EMAIL PROTECTED]' Subject: Re: Help! Need Struts-El Library Compatible With Struts 1.1 B2 On Fri, 6 Dec 2002, Hohlen, John wrote: Date: Fri, 6 Dec 2002 07:58:14 -0600 From: Hohlen, John [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] To: Struts-User (E-mail) [EMAIL PROTECTED] Cc: '[EMAIL PROTECTED]' [EMAIL PROTECTED] Subject: Help! Need Struts-El Library Compatible With Struts 1.1 B2 My team is attempting to use the Struts-El tag library with Struts 1.1 B2. Since the Struts-EL subproject was created after the beta 2 release, it's not included as part of the distribution. I'm looking for a version of the Struts-EL library that plays well with Struts 1.1 B2. The 11/7 version was suggested. Unfortunately, you can only get the last the nightly releases for the last two weeks (at least from what I can tell). Since there are so many teams using the Struts beta 2 release, is there anyway we put a version of the Struts-EL library that is believed to be beta 2 compatible on the website? Kind of like a beta release for the Struts beta 2 release. This will help people like myself and get more teams using Struts-EL. Thanks, JOHN. P.S. If anyone has the 11/7 release of Struts-EL, I'd love it if they could send it to me. It's a little bit of work, but you can actually rebuild the 11/07 nightly build of Struts by checking the sources out from anonymous CVS with a date restriction: cvs -d :pserver:[EMAIL PROTECTED]:/home/cvspublic update \ -D 11/07/2002 jakarta-struts and building it. For absolute matching of the actual nightly build, you'd want to do the same thing for all the commons packages that Struts depends on. Craig -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Help! Need Struts-El Library Compatible With Struts 1.1 B2
Do you have cvs installed on your local box? Go to a shell prompt and type cvs --version. If it reports the version of the Concurrent Versions System, then you should be able to type that entire command line at your prompt. If you don't get that output, then you should install a version of cvs appropriate for your platform. -Original Message- From: Hohlen, John [mailto:[EMAIL PROTECTED]] Sent: Monday, December 09, 2002 9:49 AM To: 'Struts Users Mailing List' Subject: RE: Help! Need Struts-El Library Compatible With Struts 1.1 B2 I guess I need a CVS lesson. Does anyone know how to do what Craig has suggested below? I surfed around the CVS site, but couldn't figure out how to issue the following command: cvs -d :pserver:[EMAIL PROTECTED]:/home/cvspublic update \ -D 11/07/2002 jakarta-struts Thanks, JOHN -Original Message- From: Craig R. McClanahan [mailto:[EMAIL PROTECTED]] Sent: Friday, December 06, 2002 8:35 PM To: Struts Users Mailing List Cc: '[EMAIL PROTECTED]' Subject: Re: Help! Need Struts-El Library Compatible With Struts 1.1 B2 On Fri, 6 Dec 2002, Hohlen, John wrote: Date: Fri, 6 Dec 2002 07:58:14 -0600 From: Hohlen, John [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] To: Struts-User (E-mail) [EMAIL PROTECTED] Cc: '[EMAIL PROTECTED]' [EMAIL PROTECTED] Subject: Help! Need Struts-El Library Compatible With Struts 1.1 B2 My team is attempting to use the Struts-El tag library with Struts 1.1 B2. Since the Struts-EL subproject was created after the beta 2 release, it's not included as part of the distribution. I'm looking for a version of the Struts-EL library that plays well with Struts 1.1 B2. The 11/7 version was suggested. Unfortunately, you can only get the last the nightly releases for the last two weeks (at least from what I can tell). Since there are so many teams using the Struts beta 2 release, is there anyway we put a version of the Struts-EL library that is believed to be beta 2 compatible on the website? Kind of like a beta release for the Struts beta 2 release. This will help people like myself and get more teams using Struts-EL. Thanks, JOHN. P.S. If anyone has the 11/7 release of Struts-EL, I'd love it if they could send it to me. It's a little bit of work, but you can actually rebuild the 11/07 nightly build of Struts by checking the sources out from anonymous CVS with a date restriction: cvs -d :pserver:[EMAIL PROTECTED]:/home/cvspublic update \ -D 11/07/2002 jakarta-struts and building it. For absolute matching of the actual nightly build, you'd want to do the same thing for all the commons packages that Struts depends on. Craig -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Re: Best Practices for Logging?
At 10:49 AM 12/9/2002 +0100, you wrote: Just some addition to this logging discussion. If u are using log4j , then in any case,there wil be 1 instance per class and not per object.BEcause logger instances are named entities and they are cached.So if u ask for the same logger again(same class name I mean), u will retrieve same instance.New instance will not be created.I dont know how other logger implementations used in commons logging work.So u dont add any performance advantage by making them static. Hi Shirish and all, Actually, I have to disagree here. Yes it is true that the Log4j Log manager only holds one instance of the logger class, but I've done some profiling and found that Logger.getLogger(String) can take significantly more CPU cycles than just referring to your static instance. In particular, under a Tag library for Tomcat 4.0.X [where tags are not reused], this was resulting in significant overhead. [IIRC about 10-15% of the CPU time.] Of course, using static variables can cause class reloading problems.. so it is kind of a six of one, half-dozen of the other situation. What you end up doing in the long run is your choice... but people do need to know that constructing logs DOES take CPU time. -Mike -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
set-property on forward
Hi, I would like to parameterize some forwards I have defined in struts-config.xml. The DTD specifies I can nest set-property elements inside forward elements. That would be fine, the values are static. But then, how do I access these properties from inside my Action class? Are they just appended to the ActionForward path? Etienne
Re: Modules and Tiles: Problem
Hi, Is there any errors regarding Tiles in the Tomcat console (you may need to enable logging for Tiles) ? Cedric Andrew Kuzmin wrote: I have two modules: A) struts-config.xml: plug-in className=org.apache.struts.tiles.TilesPlugin set-property property=definitions-config value=/WEB-INF/conf/tiles-defs.xml, /WEB-INF/conf/tiles-defs-personalize.xml/ set-property property=moduleAware value=true / /plug-in B) struts-config-personalize.xml: action-mappings action path=/Courses type=XXX.actions.CoursesActions forward name=success path=personalize.courses.default / /action /action-mappings plug-in className=org.apache.struts.tiles.TilesPlugin set-property property=definitions-config value=/WEB-INF/conf/tiles-defs.xml, /WEB-INF/conf/tiles-defs-personalize.xml / set-property property=moduleAware value=true / /plug-in When i attempt to invoke http://XXX/personalize/Courses.do i have Error 404 and on Tomcat console i see : DEBUG [Thread-14] (RequestUtils.java:1446) - Get module name for path /personali ze/Courses.do DEBUG [Thread-14] (RequestUtils.java:1468) - Module name found: /personalize INFO [Thread-14] (RequestProcessor.java:225) - Processing a 'GET' for path '/Co urses' DEBUG [Thread-14] (RequestProcessor.java:305) - Looking for Action instance for class XXX.actions.CoursesActions DEBUG [Thread-14] (RequestProcessor.java:314) - Returning existing Action inst ance DEBUG [Thread-14] (RequestProcessor.java:428) - processForwardConfig(ForwardConf ig[name=success,path=personalize.courses.default,redirect=false,contextRelat ive= false]) But i am expecting TilesRequestProcessor. -- Andrew Kuzmin -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Lists, actions and links
Can i just check my understanding... I'd get my result set as one would expect do i feed it to an action and have a listmystuff action or use a bean and instansiate the bean in the jsp, no action just a normal link? The more I think about it the first option appears the puppy, no useBean in the jsp (i'm the only dev here with jsp experience) and can be managed from the config.xml. The data connectivity stuff appears a separate issue , this list could come from anywhere. Cheers mark On 9-12-2002 11:41, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: The way I would do this would be to have a Data Access Object (DAO) class that does your database access. The method would return a collection of Value Object. This collection can be passed back to your page, then you can use the iterator tag to work through the list. from:Mark [EMAIL PROTECTED] date:Mon, 09 Dec 2002 10:23:55 to: [EMAIL PROTECTED] subject: Re: Lists, actions and links Hello I've having trouble working out which is the best way of iterating though a result set , I can and have done this is several ways. 1. Imagine i have a class that querys a db and returns a result set. I pass the result set as a datastructure to my action class and all is well .. But I have to call the action to produce the list on my page. E.g. MyModelClassThatAsksTheDBForResults ListJismAction have an action listjism.do and link to this 2. or I have a bean that gets the resultset, via another class or in the bean, I instantiate the bean using the useBean jsp syntax and then iterate through using the gets defined in my bean. I don't have to have a list action, but there's something that smells about this (i'm not sure what). E.g. ListJismBean and have a normal link to listjism.jsp that uses a mix of standard jsp and struts. I know that the later is probably faster, but I'm not worried about that. I'll worry about that once my app all works (albeit slowly). An additional question is should i be only calling actions for every page or not, i read different views on this which has confused me. It seems that centralising all the links in action that can be adminstered from config.xml would only be more maintainable if and only if everything is in there. Many thanks in advance mark -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] http://www.amazon.co.uk/exec/obidos/redirect-home?tag=velloscouk-21placement= home_multi.gifsite=amazon -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Access/Manage client's file system
Micael who responded to this message says he's working on something similar. To be honest I don't know any nice, cross browser way of doing this. I'd have thought the money you save on disk space would swallowed up by extra development time. However if I had to do this i'd be reading stuff about soap and/or similar stuff. The filesystem couild be controled by and application that you distribute to recienve soap envelopes and run various file system operations. I believe flash is capable of this (i'd be interested to know). Server sends soap envelope to flash movie flash unwraps envelope and runs commands based on contents. The big quest for me remains can you do file system stuff from a flash movie? My concern would be how many work arounds you'd have to do for flash because those crazy macromedia kids may have been on the crack again. A java applet could also be used, but i believe these days more people have flash than java plugins. Also do the directories remain on the local machine after the operations? Or are they created and removed each time the user wants to do his/her stuff? T Things i'd do in your shoes.. Make or find a flash movie that reads and writes soap, make or find a flash movie that performs file system operations. Get my hands on the jakarta soap tags that should help you work out what you want you java classes to do. Cheers mark On 9-12-2002 10:16, Heligon Sandra [EMAIL PROTECTED] wrote: Sorry not to have answered earlier but I did not work Friday. By 'local' I mean the client's machine not the server. First, the server offers templates to the client. Example of JSP: Name = Toto; Type = Data; Value = 12; etc Save Load Apply Cancel If the user select the save button I would like to save data on the client's machine and the load button allows to load a file from the client's machine. We could store instances of the template on the server but it is specific to each client that's why we think that it is better to allow the client to access file system. For us server allows to store only common data. If you think it is better to save data on the server, thanks to explain. Do you understand my question better ? If I understand your reply, to do that I must use Client plugin technologies. Do you have an example ? Thanks a lot Sandra -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: beginner help
I've been working on a Struts tutorial for my office for a couple of months now. I assume programming knowledge, but no Struts knowledge. Basic idea is to move a JSP based web site to a Struts based web site, and then give step by step instructions on how to get there. Use the following link to get to the tutorial. http://j2eestudygroup.classactweb.com/archive/10-14-2002/ Scroll to the bottom of the page and you should see the link to the pdf. All supporting war files are listed there also. Other tutorial can be found at the following address and come at all levels of understanding: http://jakarta.apache.org/struts/resources/tutorials.html Good luck, jb -Original Message- From: David Rothschadl [mailto:[EMAIL PROTECTED]] Sent: Monday, December 09, 2002 9:49 AM To: Struts User Mailing List Subject: begginer help An addition to my help for a beginner question..A complete example of an index.jsp used within the struts framework would be so helpful to me and my colleagues. It seems that all that I have been able to find so far are snippets of code Remember: Peace, Love Understanding Always David R -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Validator javascript and various browsers
I've posted this before but no one replyed, hopefully more luck this time... I have this tag on my jsp: html:javascript formName=searchUserAccountsForm staticJavascript=false/ that should generate the javascript for the form validation. The js only shows in the source for IE, not Opera or Netscape. I wrote my own http client to test this and it returns the js properly. Why is this not working in the other browsers? I'm using a recent nightly build and I didn't have this problem with beta 2. Thanks, David _ The new MSN 8: smart spam protection and 2 months FREE* http://join.msn.com/?page=features/junkmail -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
How to switch debug off?
After I start tomcat with struts, I see a lot of log messages. How can I switch that off? I mean messages such as: 2002-12-09 21:41:55,536 DEBUG digester.Digester.sax - startElement(,display-name,display-name) [main] 2002-12-09 21:41:55,537 DEBUG commons.digester.Digester - Pushing body text '' [main] 2002-12-09 21:41:55,538 DEBUG commons.digester.Digester - New match='web-app/display-name' [main] 2002-12-09 21:41:55,539 DEBUG commons.digester.Digester - No rules found matching 'web-app/display-name'. [main] 2002-12-09 21:41:55,539 DEBUG digester.Digester.sax - characters(CodeBeamer) [main] 2002-12-09 21:41:55,541 DEBUG digester.Digester.sax - endElement(,display-name,display-name) [main] 2002-12-09 21:41:55,542 DEBUG commons.digester.Digester - match='web-app/display-name' [main] 2002-12-09 21:41:55,543 DEBUG commons.digester.Digester - bodyText='CodeBeamer' [main] 2002-12-09 21:41:55,568 DEBUG commons.digester.Digester - No rules found matching 'web-app/display-name'. [main] -- Zsolt -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
getDataSource() compile problem
Hi. I am trying to connect to an Oracle database for a simple prove-out. I have copied the sample code in the Strut's user guide but am getting compile time errors. Any Ideas? Is there a better resource for Struts example code or DBCP commons examples? I think the list archive search is broken, not returning any results for 'datasource'. Thanks - Patrick Compile error: [javac] /export/home/patrick/dev/myapp/src/play/test/ShowUsersAction.java:26: cannot resolve symbol [javac] symbol : method getDataSource (javax.servlet.http.HttpServletRequest) [javac] location: class play.test.ShowUsersAction [javac]dataSource = getDataSource(request); [javac] ^ [javac] 1 error Code: public final class ShowUsersAction extends Action { public ActionForward perform(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) { // database access javax.sql.DataSource dataSource; java.sql.Connection myConnection; try { dataSource = getDataSource(request); myConnection = dataSource.getConnection(); getServlet().log(Acquired Connection.); } catch (SQLException se) { getServlet().log(Connection.process, se); } finally { try { myConnection.close(); getServlet().log(Closed Connection.); } catch (SQLException e) { getServlet().log(Connection.close, e); } } return (mapping.findForward(success)); } } struts-config.xml: data-source type=org.apache.commons.dbcp.BasicDataSource set-property property=driverClassName value=oracle.jdbc.driver.OracleDriver / set-property property=url value=sql:oracle:thin:@mach:1521:db1 / set-property property=maxActive value=10 / set-property property=maxWait value=5000 / set-property property=defaultAutoCommit value=false / set-property property=defaultReadOnly value=false / /data-source -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: How to switch debug off?
Look in web.xml under the init-params for struts. There is a debug level. It is described in the manual. Edgar -Original Message- From: Zsolt Koppany [mailto:[EMAIL PROTECTED]] Sent: Monday, December 09, 2002 3:45 PM To: 'Struts Users Mailing List' Subject: How to switch debug off? After I start tomcat with struts, I see a lot of log messages. How can I switch that off? I mean messages such as: 2002-12-09 21:41:55,536 DEBUG digester.Digester.sax - startElement(,display-name,display-name) [main] 2002-12-09 21:41:55,537 DEBUG commons.digester.Digester - Pushing body text '' [main] 2002-12-09 21:41:55,538 DEBUG commons.digester.Digester - New match='web-app/display-name' [main] 2002-12-09 21:41:55,539 DEBUG commons.digester.Digester - No rules found matching 'web-app/display-name'. [main] 2002-12-09 21:41:55,539 DEBUG digester.Digester.sax - characters(CodeBeamer) [main] 2002-12-09 21:41:55,541 DEBUG digester.Digester.sax - endElement(,display-name,display-name) [main] 2002-12-09 21:41:55,542 DEBUG commons.digester.Digester - match='web-app/display-name' [main] 2002-12-09 21:41:55,543 DEBUG commons.digester.Digester - bodyText='CodeBeamer' [main] 2002-12-09 21:41:55,568 DEBUG commons.digester.Digester - No rules found matching 'web-app/display-name'. [main] -- Zsolt -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Problem with plug-in tag for tiles in struts-config.xml. Wrong version of struts-config_1_X.dtd ??
Hello, When i query a page for the first time since the server started, i got two errors : 9-Dec-2002 1:44:29 PM org.apache.commons.digester.Digester error SEVERE: Parse Error at line 60 column 60: Element type plug-in must be declared. ... and ... 9-Dec-2002 1:44:29 PM org.apache.commons.digester.Digester error SEVERE: Parse Error at line 66 column 17: The content of element type struts-config must match (data-sources?,form- beans?,global-forwards?,action-mappings?). It seems that the struts-config is not linking to the appropriate struts-config_1_X.dtd file. I looked in the struts-config_1_1.dtd file (which i specified in the struts-config.xml header) and it tells i can set a plug-in tag for the struts-config tag of the struts-config.xml, so the file should be ok. There is the header of my struts-config.xml file : !DOCTYPE struts-config PUBLIC -//Apache Software Foundation//DTD Struts Configuration 1.0//EN http://jakarta.apache.org/struts/dtds/struts-config_1_1.dtd; The plug-in tag : plug-in className=org.apache.struts.tiles.TilesPlugin set-property property=definitions-config value=/WEB-INF/tiles-defs.xml / set-property property=definitions-parser-validate value=true / set-property property=moduleAware value=true / /plug-in Do you have any clue ? Can you see anything wrong ?? Is there an order for specifying the plug-in tag in struts-config.xml ?? Thanks for your help ! Rémy -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]