Re: Exception trying to read tiles definition file in JSF..
Yes, that did the trick... :) But isn't there another way setting this up so it's not dependent on having an internet connection and that the site is actually up?? BTJ Greg Reddin wrote: Does this one work? http://struts.apache.org/dtds/tiles-config_1_1.dtd I still don't understand why the registration feature of Digester wouldn't get around this issue. Greg On Sep 6, 2005, at 3:35 PM, Bjørn T Johansen wrote: Or it might What is the correct uri for the dtd? The one I am using, is not working.. (http://apache.org/dtds/tiles-config_1_2.dtd) BTJ Bjørn T Johansen wrote: Nope, I access the internet without any problems, so that is not the case here... BTJ Greg Reddin wrote: If you are behind a firewall or access the Internet via a proxy server the problem may be due to Tiles trying to load the DTDs. I've found on at least one occasion that setting the registrations for Digester does not seem to prevent Tiles from trying to go to the Internet to resolve the DTDs. I'm not sure why that is. The problem surfaced for me when trying to run the unit tests. If I was logged in to the office VPN I got the IO exception while Digester was trying to resolve DTDs. If I was not logged in to the VPN the tests ran just fine. Could that be your problem? Greg On Sep 6, 2005, at 1:59 PM, Bjørn T Johansen wrote: Yes, I have the following in my web.xml..: servlet servlet-nameTiles Servlet/servlet-name servlet-classorg.apache.tiles.servlets.TilesServlet/servlet- class init-param param-namedefinitions-config/param-name param-value/WEB-INF/tiles.xml/param-value /init-param load-on-startup2/load-on-startup /servlet and /WEB-INF/tiles.xml exists and contains valid tiles definitions (copied from a working Struts project...) BTJ Greg Reddin wrote: On Sep 6, 2005, at 1:40 PM, David G. Friedman wrote: web-app servlet servlet-nameTiles Servlet/servlet-name servlet-classorg.apache.struts.tiles.TilesServlet/servlet- class init-param param-namedefinitions-config/param-name param-value/WEB-INF/tiles.xml/param-value /init-param load-on-startup2/load-on-startup /servlet The above is correct except that it appeared from your original post that you are using Standalone Tiles. So remove struts from the package name. Greg - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Problem with a Frameset and Struts (replacing frameset with tiles?)
Hi! thank you very much for your answer. Do you think it would generally be better to use Tiles instead of frameset? We would like to use the validador-framework but when we have to use javascript in any case do you think it would be better not to do this? Ciao -- Initial Header --- From : Frank W. Zammetti [EMAIL PROTECTED] To : Struts Users Mailing List user@struts.apache.org Cc : user user@struts.apache.org Date : Tue, 6 Sep 2005 10:21:08 -0400 (EDT) Subject : Re: Problem with a Frameset and Struts Hi, This isn't really a Struts issue per se, it's a frames issue. When you set the target of the form to display, the response from the server is going to go into the bottom frame, regardless of what the outcome is (i.e., whether there are errors or not). This is just how frames work. You can do what you want, but it will require client-side coding. I would suggest having a third frame with a size of 0 (making it hidden) and direct your response to it. Add some Javascript to the page that is returned that fires in response to the onLoad event. If errors came back, copy them over to the search frame, otherwise copy the whole page to display. Let's assume you call the hidden frame hiddenFrame, and let's assume there is a div with an ID of errorDiv in both the returned page and what's in the search frame... Here's what I would do: html head script function loadHandler() { if (errorDiv.innerHTML != '') { window.top.search.errorDiv.innerHTML = window.top.hiddenFrame.errorDiv.innerTML; } else { window.top.display.document.open(); window.top.display.document.write( window.top.hiddenFrame.document.documentElement.outerHTML); window.top.display.document.close(); } /script /head body onLoad=loadHandler(); ... /body/html So, if errors are present in the div on the returned page, they will be copied over to the div in the search frame. If the div is empty on the returned page, meaning no errors occurred, the entire page is copied over to the display frame. I'm not sure this is 100% cross-browser, you probably need to use getElementById() to make it so, but the basic theory works (I know because I do this in a prod app I have). -- Frank W. Zammetti Founder and Chief Software Architect Omnytex Technologies http://www.omnytex.com On Tue, September 6, 2005 8:32 am, gollinger said: I have a frameset with two included jsp's. frameset rows=15%,85% html:frame frameName=search page=/jsp/awp/search.jsp / html:frame frameName=display page=/jsp/awp/empty.jsp / /frameset /head /html this is the first jsp inside the frameset with validation and errors should be displayed there: html:form action=/show target=display tr td width=100 html:link page=/jsp/index.jspHome/html:link /td td colspan=3 align=centerbshow group/b/td /tr tr tdhtml:text property=abt_id size=3 value=32/ /td tdhtml:submit//td /tr html:errors/ /html:form the large problem that I have is that I want the errors to be displayed in the first jsp (in the part of the frameset above), where the submit button original is! But the effect is that the original page gets duplicated on the screen und the errors were displayed there! Who can give me an advice? Thanks Antonio 6X velocizzare la tua navigazione a 56k? 6X Web Accelerator di Libero! Scaricalo su INTERNET GRATIS 6X http://www.libero.it - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] Libero Flat, sempre a 4 Mega a 19,95 euro al mese! Abbonati subito su http://www.libero.it - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
How do I write a navigation rule for Tiles using JSF?
I am used to just using .tiledefname in Struts but this doesn's seem to work when using tiles with jsf... i.e. how do I navigate to a tiles def. in jsf? How do I set up the navigation rule, especially the to-view-id? Regards, BTJ -- --- Bjørn T Johansen [EMAIL PROTECTED] --- Someone wrote: I understand that if you play a Windows CD backwards you hear strange Satanic messages To which someone replied: It's even worse than that; play it forwards and it installs Windows --- - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
paging tables?
Hello I use logic:iterate tag to show table with all of data from database. Could you help me to paging this table in the easiest way ?. thank you Rockowa Trasa Koncertowa na rzecz nieuleczalnie chorych dzieci - TAT, ORANGE PARK, BRACIA - 22.09-02.10. - 8 koncertów w Polsce. http://klik.wp.pl/?adr=http%3A%2F%2Fadv.reklama.wp.pl%2Fas%2Fdaw.htmlsid=491 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
AW: paging tables?
Try Displaytag (www.displaytag.org). It is a taglib which handles everything (paging, sorting). The only problem I encountered was with multiple row selections spanning several pages. Martin -Ursprüngliche Nachricht- Von: S³awek Tuleja [mailto:[EMAIL PROTECTED] Gesendet: Mittwoch, 7. September 2005 10:02 An: user Betreff: paging tables? Hello I use logic:iterate tag to show table with all of data from database. Could you help me to paging this table in the easiest way ?. thank you Rockowa Trasa Koncertowa na rzecz nieuleczalnie chorych dzieci - TAT, ORANGE PARK, BRACIA - 22.09-02.10. - 8 koncertów w Polsce. http://klik.wp.pl/?adr=http%3A%2F%2Fadv.reklama.wp.pl%2Fas%2Fd aw.htmlsid=491 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Problem with characters
Hi, I have a problem with some characters. My application reads some forms and writes them in a db. On my test and developing environment everything works well. The problem comes out when I deploy the application on the production server. When I fill in the form non English characters (for example the typical characters of the Italian language) they are read as ?. The strange thing is that in the same tomcat context there is an old no-struts application that works well. On this server Apache and Tomcat work together and this is the only difference from my test server. In both struts-config.xml and web.xml I put this encoding ?xml version=1.0 encoding=ISO-8859-1 ? Furthermore I use a tiles layout and in it I put: meta http-equiv=Content-Type content=text/html; charset=iso-8859-1 What could be the problem? LuKe -- Email.it, the professional e-mail, gratis per te: http://www.email.it/f Sponsor: Vuoi risparmiare sino al 70% sugli acquisti? Oliviero non teme confronti! Clicca qui: http://adv.email.it/cgi-bin/foclick.cgi?mid=3849d=7-9 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Antwort: Problem with characters [ Virenprüfung durchgeführt]
lk [EMAIL PROTECTED] am 07.09.2005 10:23:04 Bitte antworten an Struts Users Mailing List user@struts.apache.org An: user@struts.apache.org Kopie: Thema: Problem with characters [Virenprüfung durchgeführt] Hi, I have a problem with some characters. My application reads some forms and writes them in a db. On my test and developing environment everything works well. The problem comes out when I deploy the application on the production server. When I fill in the form non English characters (for example the typical characters of the Italian language) they are read as ?. The strange thing is that in the same tomcat context there is an old no-struts application that works well. On this server Apache and Tomcat work together and this is the only difference from my test server. In both struts-config.xml and web.xml I put this encoding ?xml version=1.0 encoding=ISO-8859-1 ? Furthermore I use a tiles layout and in it I put: meta http-equiv=Content-Type content=text/html; charset=iso-8859-1 What could be the problem? Perhaps the settings of your browser. LuKe -- Email.it, the professional e-mail, gratis per te: http://www.email.it/f Sponsor: Vuoi risparmiare sino al 70% sugli acquisti? Oliviero non teme confronti! Clicca qui: http://adv.email.it/cgi-bin/foclick.cgi?mid=3849d=7-9 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Problem with characters
Change you encoding to UTF-8. What database are you using? Dave. -Original Message- From: lk [mailto:[EMAIL PROTECTED] Sent: 07 September 2005 09:23 To: user@struts.apache.org Subject: Problem with characters Hi, I have a problem with some characters. My application reads some forms and writes them in a db. On my test and developing environment everything works well. The problem comes out when I deploy the application on the production server. When I fill in the form non English characters (for example the typical characters of the Italian language) they are read as ?. The strange thing is that in the same tomcat context there is an old no-struts application that works well. On this server Apache and Tomcat work together and this is the only difference from my test server. In both struts-config.xml and web.xml I put this encoding ?xml version=1.0 encoding=ISO-8859-1 ? Furthermore I use a tiles layout and in it I put: meta http-equiv=Content-Type content=text/html; charset=iso-8859-1 What could be the problem? LuKe -- Email.it, the professional e-mail, gratis per te: http://www.email.it/f Sponsor: Vuoi risparmiare sino al 70% sugli acquisti? Oliviero non teme confronti! Clicca qui: http://adv.email.it/cgi-bin/foclick.cgi?mid=3849d=7-9 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] This e mail is from DLA Piper Rudnick Gray Cary UK LLP. The contents of this email and any attachments are confidential to the intended recipient. They may not be disclosed to or used by or copied in any way by anyone other than the intended recipient. If this email is received in error, please contact DLA Piper Rudnick Gray Cary UK LLP on +44 (0) 8700 11 quoting the name of the sender and the email address to which it has been sent and then delete it. Please note that neither DLA Piper Rudnick Gray Cary UK LLP nor the sender accept any responsibility for viruses and it is your responsibility to scan or otherwise check this email and any attachments. DLA Piper Rudnick Gray Cary UK LLP is a limited liability partnership registered in England and Wales (registered number OC307847) which provides services from offices in England, Belgium, Germany and the People's Republic of China. A list of members is open for inspection at its registered office and principal place of business 3 Noble Street, London EC2V 7EE. Partner denotes member of a limited liability partnership. DLA Piper Rudnick Gray Cary UK LLP is regulated by the Law Society and is a member of DLA Piper Rudnick Gray Cary, a global legal services organisation, the members of which are separate and distinct legal entities. For further information, please refer to www.dlapiper.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Problem with characters
Check your production default table charset. It must be latin1 or similar. lk escribió: Hi, I have a problem with some characters. My application reads some forms and writes them in a db. On my test and developing environment everything works well. The problem comes out when I deploy the application on the production server. When I fill in the form non English characters (for example the typical characters of the Italian language) they are read as ?. The strange thing is that in the same tomcat context there is an old no-struts application that works well. On this server Apache and Tomcat work together and this is the only difference from my test server. In both struts-config.xml and web.xml I put this encoding ?xml version=1.0 encoding=ISO-8859-1 ? Furthermore I use a tiles layout and in it I put: meta http-equiv=Content-Type content=text/html; charset=iso-8859-1 What could be the problem? LuKe -- Email.it, the professional e-mail, gratis per te: http://www.email.it/f Sponsor: Vuoi risparmiare sino al 70% sugli acquisti? Oliviero non teme confronti! Clicca qui: http://adv.email.it/cgi-bin/foclick.cgi?mid=3849d=7-9 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Problem with characters
Harland, David wrote: Change you encoding to UTF-8. What database are you using? Dave. mysql 4.0.16 LuKe -- Email.it, the professional e-mail, gratis per te: http://www.email.it/f Sponsor: Logos Finanziaria SPA. Società di credito ad erogazione diretta. Fino a 30.000 euro in 24 ore! Clicca e scopri come * Clicca qui: http://adv.email.it/cgi-bin/foclick.cgi?mid=2909d=7-9 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Antwort: Problem with characters [ Virenprüfung durchgeführt]
[EMAIL PROTECTED] wrote: lk [EMAIL PROTECTED] am 07.09.2005 10:23:04 Bitte antworten an Struts Users Mailing List user@struts.apache.org An: user@struts.apache.org Kopie: Thema: Problem with characters [Virenprüfung durchgeführt] Hi, I have a problem with some characters. My application reads some forms and writes them in a db. On my test and developing environment everything works well. The problem comes out when I deploy the application on the production server. When I fill in the form non English characters (for example the typical characters of the Italian language) they are read as ?. The strange thing is that in the same tomcat context there is an old no-struts application that works well. On this server Apache and Tomcat work together and this is the only difference from my test server. In both struts-config.xml and web.xml I put this encoding ?xml version=1.0 encoding=ISO-8859-1 ? Furthermore I use a tiles layout and in it I put: meta http-equiv=Content-Type content=text/html; charset=iso-8859-1 What could be the problem? Perhaps the settings of your browser. I use the same browser: on my local server the form is read perfectly, on the production server the problem comes out. LukE -- Email.it, the professional e-mail, gratis per te: http://www.email.it/f Sponsor: America, Africa, Australia, Asia...con Email Phone Card chiami ovunque spendendo meno di una telefonata interurbana Clicca qui: http://adv.email.it/cgi-bin/foclick.cgi?mid88d=7-9 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Problem with characters
Ivan Rodriguez wrote: Check your production default table charset. It must be latin1 or similar. It should be the same I'm using (at least it works well with no-struts contexts). LuKe -- Email.it, the professional e-mail, gratis per te: http://www.email.it/f Sponsor: Scarica Sweety sul tuo cellulare. Come visto in televisione. * La prima suoneria è GRATIS! * Clicca qui: http://adv.email.it/cgi-bin/foclick.cgi?mid=3543d=7-9 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Prepopulating DynaValidatorForm and validating
Hi all! Googling and seraching the archive did not solve my problem, so I will have a try. In my struts-config.xml, I have defined a DynaValidatorForm and an action: form-bean name=editForm type=org.apache.struts.validator.DynaValidatorForm form-property name=projectList type=java.util.Collection/ form-property name=version type=java.lang.String initial=/ /form-bean action path=/processEdit type=com.materna.buc.buildmanager.actions.ProcessEditAction scope=request name=editForm validate=true input=/WEB-INF/jsp/edit.jsp ... /action As you can see, this form holds a list of projects in a collection, which has to be populated before the corresponding jsp-page is shown. So I have an Action which gets the (dynamic, not static) list of projects from a database and puts it into the editForm like this: public ActionForward execute( ... ) { DynaValidatorForm dynaForm = (DynaValidatorForm) form; // get list of projects from database Collection projectList = getDatabaseHandler().getProjectList(); // put project list into DynaValidatorForm dynaForm.set( projectList, projectList ); Everything works fine after showing my jsp-page with a combobox populated with the data from my projectList - the user can choose one project. But on the same page there is a html:text field: html:text name=editForm property=version value=1.0 size=7 / which corresponds to my editForms version-property. When the user submits the form to processEdit, the version property has to be validated to see if it is not empty. So in my validation.xml I do the following: form name=editForm field property=version depends=required arg0 key=edit.version / /field /form If the user submits an empty version and validation fails, he will be send back to the jsp-page, but it will not show because the project list is not present any more. That seems clear because the DynaValidatorForm is reset when the user submits. I tried following workarounds: 1. I replaced the DynaValidatorForm with my own version overwriting the reset - method to do nothing. Additionaly set the scope to session. But my project list gets still lost (wondering why?) 2. Trying to pass my project list from one form to the other like this html:hidden name=editForm property=projectList value=projectList in all variations always had to fail because the project list will be send as a string and therefore can not be converted back to a collection. I considered to put my project list into application scope, but as it is dynamic, large and not the only (dynamic and large) list to be shown on my jsp-page (I only used it as an example in order not to complicate my question), I am not sure if it is the right way. And writing an ActionForm with own validation and reset methods is a lot of work and would not use the benefits of a DynaValidatorForm... So if you know a trick, solution or workaround, please help! Thanks Peter - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
AW: Problem with characters
David, could you please be a bit more specific? Just now I have a very similar problem as LuKe. I am using MySQl 4.1.10 and all tables are UTF-8. Struts is configured to use UTF 8 (i. e. the controller element in struts-config.xml says contentType=text/html;charset=UTF-8). This seems to work. My browsers (Firefox and IE6) decode the pages as UTF-8. BUT: when I enter text using a form (this is configured using the charSet-attribute to html:form to accept ISO-8859-1) IE6 garbles it while Firefox seems to work OK. Any hints? Martin -Ursprüngliche Nachricht- Von: Harland, David [mailto:[EMAIL PROTECTED] Gesendet: Mittwoch, 7. September 2005 10:35 An: Struts Users Mailing List Betreff: RE: Problem with characters Change you encoding to UTF-8. What database are you using? Dave. -Original Message- From: lk [mailto:[EMAIL PROTECTED] Sent: 07 September 2005 09:23 To: user@struts.apache.org Subject: Problem with characters Hi, I have a problem with some characters. My application reads some forms and writes them in a db. On my test and developing environment everything works well. The problem comes out when I deploy the application on the production server. When I fill in the form non English characters (for example the typical characters of the Italian language) they are read as ?. The strange thing is that in the same tomcat context there is an old no-struts application that works well. On this server Apache and Tomcat work together and this is the only difference from my test server. In both struts-config.xml and web.xml I put this encoding ?xml version=1.0 encoding=ISO-8859-1 ? Furthermore I use a tiles layout and in it I put: meta http-equiv=Content-Type content=text/html; charset=iso-8859-1 What could be the problem? LuKe -- Email.it, the professional e-mail, gratis per te: http://www.email.it/f Sponsor: Vuoi risparmiare sino al 70% sugli acquisti? Oliviero non teme confronti! Clicca qui: http://adv.email.it/cgi-bin/foclick.cgi?mid=3849d=7-9 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] This e mail is from DLA Piper Rudnick Gray Cary UK LLP. The contents of this email and any attachments are confidential to the intended recipient. They may not be disclosed to or used by or copied in any way by anyone other than the intended recipient. If this email is received in error, please contact DLA Piper Rudnick Gray Cary UK LLP on +44 (0) 8700 11 quoting the name of the sender and the email address to which it has been sent and then delete it. Please note that neither DLA Piper Rudnick Gray Cary UK LLP nor the sender accept any responsibility for viruses and it is your responsibility to scan or otherwise check this email and any attachments. DLA Piper Rudnick Gray Cary UK LLP is a limited liability partnership registered in England and Wales (registered number OC307847) which provides services from offices in England, Belgium, Germany and the People's Republic of China. A list of members is open for inspection at its registered office and principal place of business 3 Noble Street, London EC2V 7EE. Partner denotes member of a limited liability partnership. DLA Piper Rudnick Gray Cary UK LLP is regulated by the Law Society and is a member of DLA Piper Rudnick Gray Cary, a global legal services organisation, the members of which are separate and distinct legal entities. For further information, please refer to www.dlapiper.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: JSTL and taglibs
Well, no answers so I solved it myself ;-) I had to add the line: jsp:directive.page contentType=text/html;charset=windows-1252 / That solved the problem! Regards Line -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: 6. september 2005 12:25 To: user@struts.apache.org Subject: JSTL and taglibs Hi! In our application we wanted to change the taglib-definisjon from ?xml version = '1.0' encoding = 'windows-1252'? jsp:root xmlns:jsp=http://java.sun.com/JSP/Page; version=1.2 xmlns:bean=http://jakarta.apache.org/struts/tags-bean; xmlns:html=http://jakarta.apache.org/struts/tags-html; xmlns:logic=http://jakarta.apache.org/struts/tags-logic; xmlns:tiles=http://jakarta.apache.org/struts/tags-tiles; to %@ taglib uri=http://java.sun.com/jstl/core; prefix=c % etc... This change causes a c:foreach to repeat itself three times. Changing back to jsp:root removes this error. Anyone who knows anything about this. Why c:foreach suddenly repeats? Kind regards Line A. Sele - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Problem with characters
Make sure the jsp doing the posting has %@ page language=java contentType=text/html; charset=UTF-8 % Dave. -Original Message- From: Martin Kindler [mailto:[EMAIL PROTECTED] Sent: 07 September 2005 10:47 To: 'Struts Users Mailing List' Subject: AW: Problem with characters David, could you please be a bit more specific? Just now I have a very similar problem as LuKe. I am using MySQl 4.1.10 and all tables are UTF-8. Struts is configured to use UTF 8 (i. e. the controller element in struts-config.xml says contentType=text/html;charset=UTF-8). This seems to work. My browsers (Firefox and IE6) decode the pages as UTF-8. BUT: when I enter text using a form (this is configured using the charSet-attribute to html:form to accept ISO-8859-1) IE6 garbles it while Firefox seems to work OK. Any hints? Martin -Ursprüngliche Nachricht- Von: Harland, David [mailto:[EMAIL PROTECTED] Gesendet: Mittwoch, 7. September 2005 10:35 An: Struts Users Mailing List Betreff: RE: Problem with characters Change you encoding to UTF-8. What database are you using? Dave. -Original Message- From: lk [mailto:[EMAIL PROTECTED] Sent: 07 September 2005 09:23 To: user@struts.apache.org Subject: Problem with characters Hi, I have a problem with some characters. My application reads some forms and writes them in a db. On my test and developing environment everything works well. The problem comes out when I deploy the application on the production server. When I fill in the form non English characters (for example the typical characters of the Italian language) they are read as ?. The strange thing is that in the same tomcat context there is an old no-struts application that works well. On this server Apache and Tomcat work together and this is the only difference from my test server. In both struts-config.xml and web.xml I put this encoding ?xml version=1.0 encoding=ISO-8859-1 ? Furthermore I use a tiles layout and in it I put: meta http-equiv=Content-Type content=text/html; charset=iso-8859-1 What could be the problem? LuKe -- Email.it, the professional e-mail, gratis per te: http://www.email.it/f Sponsor: Vuoi risparmiare sino al 70% sugli acquisti? Oliviero non teme confronti! Clicca qui: http://adv.email.it/cgi-bin/foclick.cgi?mid=3849d=7-9 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] This e mail is from DLA Piper Rudnick Gray Cary UK LLP. The contents of this email and any attachments are confidential to the intended recipient. They may not be disclosed to or used by or copied in any way by anyone other than the intended recipient. If this email is received in error, please contact DLA Piper Rudnick Gray Cary UK LLP on +44 (0) 8700 11 quoting the name of the sender and the email address to which it has been sent and then delete it. Please note that neither DLA Piper Rudnick Gray Cary UK LLP nor the sender accept any responsibility for viruses and it is your responsibility to scan or otherwise check this email and any attachments. DLA Piper Rudnick Gray Cary UK LLP is a limited liability partnership registered in England and Wales (registered number OC307847) which provides services from offices in England, Belgium, Germany and the People's Republic of China. A list of members is open for inspection at its registered office and principal place of business 3 Noble Street, London EC2V 7EE. Partner denotes member of a limited liability partnership. DLA Piper Rudnick Gray Cary UK LLP is regulated by the Law Society and is a member of DLA Piper Rudnick Gray Cary, a global legal services organisation, the members of which are separate and distinct legal entities. For further information, please refer to www.dlapiper.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] This e mail is from DLA Piper Rudnick Gray Cary UK LLP. The contents of this email and any attachments are confidential to the intended recipient. They may not be disclosed to or used by or copied in any way by anyone other than the intended recipient. If this email is received in error, please contact DLA Piper Rudnick Gray Cary UK LLP on +44 (0) 8700 11 quoting the name of the sender and the email address to which it has been sent and then delete it. Please note that neither DLA Piper Rudnick Gray Cary UK LLP nor the sender accept any responsibility for viruses and it is your responsibility to scan or otherwise check this email and any attachments.
bean:include starting new session depending on forwardPattern
I am using struts 1.2.7 with multiple modules on Tomcat 4. My JSP files are shared between the modules hence there is a pagePattern set on the controller - it is currently set to '$P'. I have left forwardPattern as default because I only forward to tiles or other actions, not directly to pages. I am using bean:include page=/view/head.jsp to include a JSP file inside another. This finds the JSP ok but when that JSP is rendered it gets a new session, separate from the session the calling page is in. Specifying 'transaction=true' appears to have no effect. If I set the forwardPattern on the controller to the same as the pagePattern - '$P' - the included JSP picks up the same session as the calling page. OK, but it breaks my forwarding to actions as the forwards are now not module-relative. So, Why does forwardPattern have any impact on whether a JSP included by bean:include shares the session with the calling page? What can I do about it, whilst leaving forwardpattern as default? Cheers Neil All telephone calls are recorded and may be monitored. E-mail communication is not secure and may be intercepted by a third party. This message is confidential to the intended addressee. If you are not the intended addressee, please inform us immediately and then delete this message. The One account Ltd does not accept responsibility for changes made to this message after it was sent. Although The One account Ltd believes this e-mail is free of any virus or other defect which may affect a computer, it is the responsibility of the recipient to ensure that it is virus free and The One account Ltd does not accept any responsibility for any loss or damage arising from its use. The One account is a secured personal bank account with The Royal Bank of Scotland plc and is administered by The One account Ltd. The One account Ltd is an appointed representative of The Royal Bank of Scotland plc which is authorised and regulated by the Financial Services Authority. 'The One account', 'One account', 'Make one day today' and the associated logos are trademarks of The One account Ltd. Registered office: Waterhouse Square, 138-142 Holborn, London EC1N 2TH,UK. Registered in England no 3414708. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Prepopulating DynaValidatorForm and validating
I have handled this in two different ways. 1. Previously I had a preprocess action which populated the collection and that was all it did. In the struts-config, I set the preprocessAction.do as the input page. That way if the validation failed, struts will execute the preprocessAction which will repopulate the list and redisplay the form in tact. 2. Resently, I have been using DWR (Ajax) project to load the select list when the page is rendered. I do this because my list is dynamic and can change based on selections that the user enters on the page. [EMAIL PROTECTED] [EMAIL PROTECTED] 09/07/2005 05:20 AM Please respond to Struts Users Mailing List user@struts.apache.org To user@struts.apache.org cc Subject Prepopulating DynaValidatorForm and validating Hi all! Googling and seraching the archive did not solve my problem, so I will have a try. In my struts-config.xml, I have defined a DynaValidatorForm and an action: form-bean name=editForm type=org.apache.struts.validator.DynaValidatorForm form-property name=projectList type=java.util.Collection/ form-property name=version type=java.lang.String initial=/ /form-bean action path=/processEdit type=com.materna.buc.buildmanager.actions.ProcessEditAction scope=request name=editForm validate=true input=/WEB-INF/jsp/edit.jsp ... /action As you can see, this form holds a list of projects in a collection, which has to be populated before the corresponding jsp-page is shown. So I have an Action which gets the (dynamic, not static) list of projects from a database and puts it into the editForm like this: public ActionForward execute( ... ) { DynaValidatorForm dynaForm = (DynaValidatorForm) form; // get list of projects from database Collection projectList = getDatabaseHandler().getProjectList(); // put project list into DynaValidatorForm dynaForm.set( projectList, projectList ); Everything works fine after showing my jsp-page with a combobox populated with the data from my projectList - the user can choose one project. But on the same page there is a html:text field: html:text name=editForm property=version value=1.0 size=7 / which corresponds to my editForms version-property. When the user submits the form to processEdit, the version property has to be validated to see if it is not empty. So in my validation.xml I do the following: form name=editForm field property=version depends=required arg0 key=edit.version / /field /form If the user submits an empty version and validation fails, he will be send back to the jsp-page, but it will not show because the project list is not present any more. That seems clear because the DynaValidatorForm is reset when the user submits. I tried following workarounds: 1. I replaced the DynaValidatorForm with my own version overwriting the reset - method to do nothing. Additionaly set the scope to session. But my project list gets still lost (wondering why?) 2. Trying to pass my project list from one form to the other like this html:hidden name=editForm property=projectList value=projectList in all variations always had to fail because the project list will be send as a string and therefore can not be converted back to a collection. I considered to put my project list into application scope, but as it is dynamic, large and not the only (dynamic and large) list to be shown on my jsp-page (I only used it as an example in order not to complicate my question), I am not sure if it is the right way. And writing an ActionForm with own validation and reset methods is a lot of work and would not use the benefits of a DynaValidatorForm... So if you know a trick, solution or workaround, please help! Thanks Peter - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Upload: strange characters in german filename
Hello, after uploading a file, getFileName() returns me always a wrong filename, if the filename contains one of the german umlaute (like ü, ä or ö). The filename looks like: Angebot_Tipps fï¿œr Kids.doc (i display it BEFORE i save the name in the database). This error appears _only_ in the input-file tag, if i enter some characters in a normal input-field, everything goes fine. Is this a known error? I found nothing in the web. Is here anyone running Struts / upload running succesful with german filenames? TIA, Bart Versions: Tomcat 5, Struts 1.2.4, java version 1.5.0_04 on Linux Code: package de.om.crm.struts; ..a lot of imports ... import org.apache.struts.upload.FormFile; /** * @author bart * * TODO To change the template for this generated type comment go to * Window - Preferences - Java - Code Style - Code Templates */ public class MarketingMailingAction extends Action { /* (non-Javadoc) * @see */ private String tmpUploadFile = null; public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { // load form MarketingMailingForm mmf = (MarketingMailingForm) form; HttpSession session = request.getSession(true); ArrayList uploadFiles = (ArrayList) session.getAttribute(uploadFiles); if (uploadFiles == null) uploadFiles = new ArrayList(); FormFile file = mmf.getMarketingFile(); if (mmf.getAction().equals(mmf.ACTION_SENDEN)) { // .. sends mail } else if (mmf.getAction().equals(mmf.ACTION_UPLOAD)) { // first we clean up the temp directory cleanUpTempDir(); if (file != null file.getFileSize() 0) { try { // save content // save everything in session HashMap h = new HashMap(); h.put(contentType, file.getContentType()); h.put(fileSize, new Integer(file.getFileSize())); h.put(fileName, file.getFileName()); h.put(tempFileName, getTmpFileFromUpload(file.getInputStream())); uploadFiles.add(h); // also add the file to the form list mmf.getFilesInSession().put(new Integer(uploadFiles.indexOf(h)).toString() , h.get(fileName)); } catch (Exception e) { e.printStackTrace(); } // ok, everything goes fine, put again the files into session } } return mapping.findForward(marketingMailing); } private void cleanUpTempDir() { // System.out.println(cleanup + System.getProperty(java.io.tmpdir)); } private String getTmpFileFromUpload(InputStream is) { if (this.tmpUploadFile == null) { // output try { java.io.File tmp = java.io.File.createTempFile(mma_, .tmp); BufferedOutputStream os = new BufferedOutputStream(new FileOutputStream(tmp.getAbsoluteFile())); // input InputStream in = is; int b; while ((b = in.read()) != -1) { os.write(b); } in.close(); os.close(); return tmp.getAbsolutePath(); } catch (Exception e) { e.printStackTrace(); return null; } } else { return this.tmpUploadFile; } } } - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Forwarding to the previous page
Hi, I have a menu on my application, which is tiled in all the pages. I have an action of the menu which is common to all the page in which I am, so the execute() method of the action class associated to it must return a forward to the page which called it. I know how to map the forward of an action to a specific, struts-config hard-coded page. How can I deal with this kind of dynamic forwarding? Id est forwarding the action to the page which called it? Thanks -- TREMALNAIK - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
AW: Upload: strange characters in german filename
Bart, looks like a character encoding problem. The mangled character in the filename (ï¿œ) is meant to be a german u-umlaut. I can't offer any more advice to resolve the problem as I am working on this type of problem myself :-( Martin -Ursprüngliche Nachricht- Von: Bart Frackiewicz [mailto:[EMAIL PROTECTED] Gesendet: Mittwoch, 7. September 2005 14:22 An: Struts Users Mailing List Betreff: Upload: strange characters in german filename Hello, after uploading a file, getFileName() returns me always a wrong filename, if the filename contains one of the german umlaute (like ü, ä or ö). The filename looks like: Angebot_Tipps fï¿œr Kids.doc (i display it BEFORE i save the name in the database). This error appears _only_ in the input-file tag, if i enter some characters in a normal input-field, everything goes fine. Is this a known error? I found nothing in the web. Is here anyone running Struts / upload running succesful with german filenames? TIA, Bart Versions: Tomcat 5, Struts 1.2.4, java version 1.5.0_04 on Linux Code: package de.om.crm.struts; ..a lot of imports ... import org.apache.struts.upload.FormFile; /** * @author bart * * TODO To change the template for this generated type comment go to * Window - Preferences - Java - Code Style - Code Templates */ public class MarketingMailingAction extends Action { /* (non-Javadoc) * @see */ private String tmpUploadFile = null; public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { // load form MarketingMailingForm mmf = (MarketingMailingForm) form; HttpSession session = request.getSession(true); ArrayList uploadFiles = (ArrayList) session.getAttribute(uploadFiles); if (uploadFiles == null) uploadFiles = new ArrayList(); FormFile file = mmf.getMarketingFile(); if (mmf.getAction().equals(mmf.ACTION_SENDEN)) { // .. sends mail } else if (mmf.getAction().equals(mmf.ACTION_UPLOAD)) { // first we clean up the temp directory cleanUpTempDir(); if (file != null file.getFileSize() 0) { try { // save content // save everything in session HashMap h = new HashMap(); h.put(contentType, file.getContentType()); h.put(fileSize, new Integer(file.getFileSize())); h.put(fileName, file.getFileName()); h.put(tempFileName, getTmpFileFromUpload(file.getInputStream())); uploadFiles.add(h); // also add the file to the form list mmf.getFilesInSession().put(new Integer(uploadFiles.indexOf(h)).toString() , h.get(fileName)); } catch (Exception e) { e.printStackTrace(); } // ok, everything goes fine, put again the files into session } } return mapping.findForward(marketingMailing); } private void cleanUpTempDir() { // System.out.println(cleanup + System.getProperty(java.io.tmpdir)); } private String getTmpFileFromUpload(InputStream is) { if (this.tmpUploadFile == null) { // output try { java.io.File tmp = java.io.File.createTempFile(mma_, .tmp); BufferedOutputStream os = new BufferedOutputStream(new FileOutputStream(tmp.getAbsoluteFile())); // input InputStream in = is; int b; while ((b = in.read()) != -1) { os.write(b); } in.close(); os.close(); return tmp.getAbsolutePath(); } catch (Exception e) { e.printStackTrace(); return null; } } else { return this.tmpUploadFile; } } } - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Security constraint not working
perhaps you need at least one auth-constraint with a given role - or you leave it empty (look into the example, there is a auth-constraint/ before /security-constraint). Neil Aggarwal schrieb: Hello: !-- Do not allow users to load jsps directly -- security-constraint web-resource-collection web-resource-nameno_access/web-resource-name url-pattern*.jsp/url-pattern /web-resource-collection /security-constraint my example: security-constraint !-- normal area -- web-resource-collection web-resource-nameBOS Airliquide Deutschland/web-resource-name url-pattern*.do/url-pattern !-- url-pattern*.do/url-pattern -- /web-resource-collection auth-constraint role-nameBO/role-name /auth-constraint /security-constraint security-role role-nameBO/role-name /security-role Bart - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Problem with a Frameset and Struts (replacing frameset with tiles?)
Tiles and frames are not at all equivalent, so it's not a simple either-or answer. It really depends on what your application needs are. I have done a lot of work with frames and am completely comfortable developing with them. This is not so for everyone, and there are some good reasons for it. Given my affection (well, acceptance anyway!) of frames, I would *still* say that if you don't truly need what they give you then you probably *don't* want to use them. There are indeed added complexities with frames, and sometimes some very subtle problems come up that will give you fits if you don't have a lot of experience with frames, so if you don't truly need them, Tiles will probably be the better choice. Of course, you probably should ask whether you need Tiles or not too... Tiles does have some benefits, but it also adds complexity. I don't want to overstate it, Tiles is *not* difficult, but you may not even ned that added complexity, however little it may be. -- Frank W. Zammetti Founder and Chief Software Architect Omnytex Technologies http://www.omnytex.com On Wed, September 7, 2005 2:13 am, gollinger said: Hi! thank you very much for your answer. Do you think it would generally be better to use Tiles instead of frameset? We would like to use the validador-framework but when we have to use javascript in any case do you think it would be better not to do this? Ciao -- Initial Header --- From : Frank W. Zammetti [EMAIL PROTECTED] To : Struts Users Mailing List user@struts.apache.org Cc : user user@struts.apache.org Date : Tue, 6 Sep 2005 10:21:08 -0400 (EDT) Subject : Re: Problem with a Frameset and Struts Hi, This isn't really a Struts issue per se, it's a frames issue. When you set the target of the form to display, the response from the server is going to go into the bottom frame, regardless of what the outcome is (i.e., whether there are errors or not). This is just how frames work. You can do what you want, but it will require client-side coding. I would suggest having a third frame with a size of 0 (making it hidden) and direct your response to it. Add some Javascript to the page that is returned that fires in response to the onLoad event. If errors came back, copy them over to the search frame, otherwise copy the whole page to display. Let's assume you call the hidden frame hiddenFrame, and let's assume there is a div with an ID of errorDiv in both the returned page and what's in the search frame... Here's what I would do: html head script function loadHandler() { if (errorDiv.innerHTML != '') { window.top.search.errorDiv.innerHTML window.top.hiddenFrame.errorDiv.innerTML; } else { window.top.display.document.open(); window.top.display.document.write( window.top.hiddenFrame.document.documentElement.outerHTML); window.top.display.document.close(); } /script /head body onLoad=loadHandler(); ... /body/html So, if errors are present in the div on the returned page, they will be copied over to the div in the search frame. If the div is empty on the returned page, meaning no errors occurred, the entire page is copied over to the display frame. I'm not sure this is 100% cross-browser, you probably need to use getElementById() to make it so, but the basic theory works (I know because I do this in a prod app I have). -- Frank W. Zammetti Founder and Chief Software Architect Omnytex Technologies http://www.omnytex.com On Tue, September 6, 2005 8:32 am, gollinger said: I have a frameset with two included jsp's. frameset rows=15%,85% html:frame frameName=search page=/jsp/awp/search.jsp / html:frame frameName=display page=/jsp/awp/empty.jsp / /frameset /head /html this is the first jsp inside the frameset with validation and errors should be displayed there: html:form action=/show target=display tr td width=100 html:link page=/jsp/index.jspHome/html:link /td td colspan=3 align=centerbshow group/b/td /tr tr tdhtml:text property=abt_id size=3 value=32/ /td tdhtml:submit//td /tr html:errors/ /html:form the large problem that I have is that I want the errors to be displayed in the first jsp (in the part of the frameset above), where the submit button original is! But the effect is that the original page gets duplicated on the screen und the errors were displayed there! Who can give me an advice? Thanks Antonio 6X velocizzare la tua navigazione a 56k? 6X Web Accelerator di Libero! Scaricalo su INTERNET GRATIS 6X http://www.libero.it - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Exception trying to read tiles definition file in JSF..
On Sep 7, 2005, at 1:03 AM, Bjørn T Johansen wrote: Yes, that did the trick... :) But isn't there another way setting this up so it's not dependent on having an internet connection and that the site is actually up?? In the DigesterDefinitionsReader we have the following code: protected String registrations[] = { -//Apache Software Foundation//DTD Tiles Configuration 1.1// EN, /org/apache/tiles/resources/tiles-config_1_1.dtd, -//Apache Software Foundation//DTD Tiles Configuration 1.2// EN, /org/apache/tiles/resources/tiles-config_1_2.dtd, }; and later we have this: // Register our local copy of the DTDs that we can find for (int i = 0; i registrations.length; i += 2) { URL url = this.getClass().getClassLoader().getResource( registrations[i+1]); if (url != null) { digester.register(registrations[i], url.toString()); } } So this basically tells Digester that if we get the DTD reference -// Apache Software Foundation//DTD Tiles Configuration 1.1//EN to look for it in or/apache/tiles/resources/tiles-config_1_1.dtd, which is packaged with the tiles jar file. So in these cases it should be looking in the local jar file instead of going to the URL. In fact, it seems to be working for me. If I run the tests with my network disconnected it all still runs fine. At one point I was getting test failures without connectivity but I think that was before Wendy fixed the Tiles build to include the resources in the jar file. If you are using -//Apache Software Foundation//DTD Tiles Configuration 1.1//EN or -//Apache Software Foundation//DTD Tiles Configuration 1.2//EN in your DOCTYPE definition and are using the latest cut of Standalone Tiles, I can't figure out why you had to change the URL to get it to work. Anybody else have any idea? Greg - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Overlaying a propery definition with 1 ApplicationResources.properties file
Hi Adam, You can do this by extending the default MessageResourceFactory to load these files. I use this approach in my application to load the messages in from a database. Use the following in your struts-config message-resources parameter=ApplicationResources null=true factory=com.your.MessageResourceFactory / Regards, Gareth Adam Lipscombe wrote: Folks, We have a standard ApplicationResources.properties file. If customers want customised labels I want to be able to include a 2nd ApplicationResources.properties file that contains only those labels that have been customised. The 2nd label definition should override the 1st (i.e. standard) definition. If no customisations have been specified the 2nd file would be empty. E.g. ApplicationResources.properties global.greeting=Hello World global.message=how are you? CustomApplicationResources.properties global.greeting=Hi There! In the above case using global.greeting would result in Hi There! and global.message how are you? Looking at the Struts documentation it seems that if 1 properties files are used one must give them a key in the struts-config file. This key must then be used by the bean:message tags. This wont work in this context 'cos the bean:message tags will not be aware of which file the definition resides. Is it possible to overlay properties definitions in a second file like this without changing the bean:message tags? TIA -Adam - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Gareth Evans MSoft eSolutions Limited Technology Centre Inward Way Rossmore Business Park Ellesmere Port Cheshire CH65 3EN -- Tel:+44 (0)870 0100 704 Fax:+44 (0)870 9010 705 E-Mail: [EMAIL PROTECTED] Web:www.msoft.co.uk -- Terms: Please note that any prices quoted within this e-mail are subject to VAT. All program details and code described in this e-mail are subject to copyright © of MSoft eSolutions Limited and remain the intellectual property of MSoft eSolutions Limited. Any proposal or pricing information contained within this e-mail are subject to MSoft eSolutions' Terms and Conditions -- Disclaimer: This message is intended only for use of the addressee. If this message was sent to you in error, please notify the sender and delete this message. MSoft eSolutions Limited cannot accept responsibility for viruses, so please scan attachments. Views expressed in this message do not necessarily reflect those of MSoft eSolutions Limited who will not necessarily be bound by its contents. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [Shale/JSF] Method of backing bean not being called..?
[EMAIL PROTECTED] wrote the following on 9/6/2005 4:36 PM: Here's more on the problem from the myfaces user list - and these are dated just last month (:( http://www.mail-archive.com/users@myfaces.apache.org/msg07151.html Briefly, here's what is the solution: If I have a commandLink inside of a dataTable tag then the only way I can make the link work is if I set my managed bean scope to be session instead of request. I really hope this is not the case. I will need plenty of commandLinks (and/or buttons) in my dataTables and I don't want to have to give the managed beans session scope. Hopefully Craig will respond to this. I'd post this question on the MyFaces list as well. -- Rick - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [Shale/JSF] Method of backing bean not being called..?
Rick Reumann [EMAIL PROTECTED] wrote on 09/07/2005 10:10:44 AM: [EMAIL PROTECTED] wrote the following on 9/6/2005 4:36 PM: Here's more on the problem from the myfaces user list - and these are dated just last month (:( http://www.mail-archive.com/users@myfaces.apache.org/msg07151.html Briefly, here's what is the solution: If I have a commandLink inside of a dataTable tag then the only way I can make the link work is if I set my managed bean scope to be session instead of request. I really hope this is not the case. I will need plenty of commandLinks (and/or buttons) in my dataTables and I don't want to have to give the managed beans session scope. Hopefully Craig will respond to this. Well, here's another link you may like to look at: http://www.groundside.com/blog/content/DuncanMills/?month=6day=7year=2005 I'd post this question on the MyFaces list as well. If you get any insights and/or find any workarounds, please do post them here (or, if you think it's OT, to me at [EMAIL PROTECTED]). Thanks! -- Rick Geeta
Re: AW: Struts in loadbalanced enviroment
Hi there, this approach I presume restricts you to SSL only on all your redirects - or do you have logic in there to determine whether any particular URL has to be SSL encoded or not? Am I correct in thinking that the use of the load-balancer to do the SSL-encoding prevents the use of container-managed security in a distributed environment? Adam Eickvonder Bjoern on 06/09/05 12:04, wrote: Hello, we solved this problem by using a redirect-filter over the whole application that wraps the HttpServletResponse. This HttpServletResponseWrapper overwrites the sendRedirect method such that it replaces http by https. As every redirect-request goes through this method you got what you want. Bjoern Eickvonder -Ursprüngliche Nachricht- Von: Fritsch, Andre [mailto:[EMAIL PROTECTED] Gesendet: Dienstag, 6. September 2005 08:55 An: user@struts.apache.org Betreff: Struts in loadbalanced enviroment Hello to everyone in the struts user-group! In our productive environment we have a problem concerning struts redirects behind our load balanced servers. Queries to the running struts applications are sent by https protocol towards the load balancer which receives the query, terminates ssl and forwards plain http to a Jboss application server in which the struts application is running. Our problem is that struts receives the query in http and uses this protocol for the redirect but we would need https to recontact the load balancer correctly with ssl. We have a 4 step development process from the developer pc to our test system and then via our integration system to the productive environment. The developer pc, our test system and our integration system does not use ssl and the test and integration system is not load balanced. To support high availability our productive system is load balanced to 4 servers and uses ssl connection. We know that it is possible to solve it hard coded either by defining absolute links or define a forward in the struts config xml. But our release workflow through the 4 steps is mostly automated so that this would cause extensive administrative input for every application that passes a development phase. Therefore we are looking for a possibility to specify a global parameter so that struts redirects are sent by pre defined protocol. Http: on the developer pc, the test and integration system. Https: on our productive system. Is it possible to specify such a parameter or is there another possibility to override the protocol not restricting the use of relative links? Kind Regards, André Fritsch - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Struts and XHTML
It's valid XHTML 1.0 transitional. What are you using? [EMAIL PROTECTED] on 07/09/05 00:01, wrote: Dne středa 07 září 2005 00:46 [EMAIL PROTECTED] napsal(a): Hello all, I have problem with struts. Is struts XHTML compliant ? I mean that html lang=en is not allowed in XHTML and in example this snippet of struts code html:radio property=answer value=answerbean:write name=question_item property=question //html:radiobr/ is translated to the html as input type=radio name=answer value=answersbr/ but the input tag is not closed. Is there any solutions to struts generate valid XHTML code ? Thanks Mila When I use the html:html xhtml=true the all seem to be ok, but this snippet is wrong: html xmlns=http://www.w3.org/1999/xhtml; lang=en xml:lang=en There is not allowed lang=en attribute. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
DynaForms Radio Buttons
Hey, I am running into a problem with trying to create radio buttons with a dynamic amount of entries on the page. It is meant to be a very simple page where there are options and you just select Yes or No. The only thing is the number of options that are presented to the user is dynamic which means there needs to be a dynamic number of radio buttons present on the page. I started to use DynaForms but I don't think im configuring it correctly. The form that holds the Radio Buttons will just take need to take in the Yes or No answers as the other data is already stored in the session. What would be the best way to take those values in from the page? Thanks, Enda
a simpler way?
Hi all! Lets say I have a form with two text fields on a jsp page: html:text property=project value=${beanFromSessionScope.project} / html:text property=version value=${beanFromSessionScope.version} / Both text fields are validated (I use a DynaValidatorForm) and a text is required for both. If the user changes both text fields (lets say deletes project and changes version), validation fails and the user is send back to the text fields. But now the text in the field version shows again the ${beanFromSessionScope.version} value, and not the one previously changed by the user. A workaround: logic:empty name=org.apache.struts.action.ERROR html:text property=project value=${beanFromSessionScope.project} / /logic:empty logic:notEmpty name=org.apache.struts.action.ERROR html:text property=project / /logic:notEmpty logic:empty name=org.apache.struts.action.ERROR html:text property=version value=${beanFromSessionScope.version} / /logic:empty logic:notEmpty name=org.apache.struts.action.ERROR html:text property=version / /logic:notEmpty Is there a simpler way to achieve this? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[OT] howto replicate Application context
Hello all, I've a requirement to replicate application context data in a 2 server cluster (load-balanced). I know tomcat option to use in-memory session replication. Is there anything similar for application context ? Thanks for any suggestion. Nico. This message contains information that may be privileged or confidential and is the property of the Capgemini Group. It is intended only for the person to whom it is addressed. If you are not the intended recipient, you are not authorized to read, print, retain, copy, disseminate, distribute, or use this message or any part thereof. If you receive this message in error, please notify the sender immediately and delete all copies of this message. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How do I write a navigation rule for Tiles using JSF?
From: Bjørn T Johansen [EMAIL PROTECTED] I am used to just using .tiledefname in Struts but this doesn's seem to work when using tiles with jsf... i.e. how do I navigate to a tiles def. in jsf? How do I set up the navigation rule, especially the to-view-id? From your other posts, it's not clear whether you're using Struts Tiles, or Standalone Tiles, or whether you're using Shale. For Shale + Standalone Tiles, try http://jroller.com/page/dgeary?entry=shale_adds_tiles_integration -- Wendy Smoak - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Exception trying to read tiles definition file in JSF..
Yes, I am using one of those in my DOCTYPE definition BTJ Greg Reddin wrote: If you are using -//Apache Software Foundation//DTD Tiles Configuration 1.1//EN or -//Apache Software Foundation//DTD Tiles Configuration 1.2//EN in your DOCTYPE definition and are using the latest cut of Standalone Tiles, I can't figure out why you had to change the URL to get it to work. Anybody else have any idea? Greg - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: AW: Problem with characters
I think you are right. I use too a filter from springframework to force UTF-8 encoding: filter filter-nameencodingFilter/filter-name filter-classorg.springframework.web.filter.CharacterEncodingFilter/filter-class init-param param-nameencoding/param-name param-valueUTF-8/param-value /init-param init-param param-nameforceEncoding/param-name param-valuetrue/param-value /init-param /filter And the %page% stuff and others. Martin Kindler escribió: Thank you Dave! My problem is now solved. But I had to do a bit more than just say that the pages are UTF-8. I think it does not matter whether I use the configuration of the Struts controller to do this or write it explicitly into each jsp. As several people today had similar problems today here my solution (built on advice from many people): first I configured Struts to use UTF-8 (struts-config.xml: controller contentType=text/html;charset=UTF-8 .../ then I told my forms to accept UTF-8 (html:form with acceptCharset=utf-8) (this is probably not necessary as the browser will send form data with the same encoding as the page, but is good for documentation) at last I installed a little filter on my container (Tomcat 5.0.x) which explicitly sets the encoding for each request and response to UTF-8. This proved to be the real solution. The filter was taken from Mike Gavaghan's very helpful article on End-to-end internationalization of Web applications (http://www.javaworld.com/javaworld/jw-05-2004/jw-0524-i18n.html) Martin -Ursprüngliche Nachricht- Von: Harland, David [mailto:[EMAIL PROTECTED] Gesendet: Mittwoch, 7. September 2005 12:15 An: Struts Users Mailing List; [EMAIL PROTECTED] Betreff: RE: Problem with characters Make sure the jsp doing the posting has %@ page language=java contentType=text/html; charset=UTF-8 % Dave. -Original Message- From: Martin Kindler [mailto:[EMAIL PROTECTED] Sent: 07 September 2005 10:47 To: 'Struts Users Mailing List' Subject: AW: Problem with characters David, could you please be a bit more specific? Just now I have a very similar problem as LuKe. I am using MySQl 4.1.10 and all tables are UTF-8. Struts is configured to use UTF 8 (i. e. the controller element in struts-config.xml says contentType=text/html;charset=UTF-8). This seems to work. My browsers (Firefox and IE6) decode the pages as UTF-8. BUT: when I enter text using a form (this is configured using the charSet-attribute to html:form to accept ISO-8859-1) IE6 garbles it while Firefox seems to work OK. Any hints? Martin -Ursprüngliche Nachricht- Von: Harland, David [mailto:[EMAIL PROTECTED] Gesendet: Mittwoch, 7. September 2005 10:35 An: Struts Users Mailing List Betreff: RE: Problem with characters Change you encoding to UTF-8. What database are you using? Dave. -Original Message- From: lk [mailto:[EMAIL PROTECTED] Sent: 07 September 2005 09:23 To: user@struts.apache.org Subject: Problem with characters Hi, I have a problem with some characters. My application reads some forms and writes them in a db. On my test and developing environment everything works well. The problem comes out when I deploy the application on the production server. When I fill in the form non English characters (for example the typical characters of the Italian language) they are read as ?. The strange thing is that in the same tomcat context there is an old no-struts application that works well. On this server Apache and Tomcat work together and this is the only difference from my test server. In both struts-config.xml and web.xml I put this encoding ?xml version=1.0 encoding=ISO-8859-1 ? Furthermore I use a tiles layout and in it I put: meta http-equiv=Content-Type content=text/html; charset=iso-8859-1 What could be the problem? LuKe -- Email.it, the professional e-mail, gratis per te: http://www.email.it/f Sponsor: Vuoi risparmiare sino al 70% sugli acquisti? Oliviero non teme confronti! Clicca qui: http://adv.email.it/cgi-bin/foclick.cgi?mid=3849d=7-9 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] This e mail is from DLA Piper Rudnick Gray Cary UK LLP. The contents of this email and any attachments are confidential to the intended recipient. They may not be disclosed to or used by or copied in any way by anyone other than the intended recipient. If this email is received in error, please contact DLA Piper Rudnick Gray Cary UK LLP on +44 (0) 8700 11 quoting the name of the sender and the email address to which it has been sent and then delete it. Please note that neither DLA Piper Rudnick Gray Cary UK LLP nor the sender accept any responsibility for viruses and it is your responsibility to scan or otherwise check this email and any
Re: How do I write a navigation rule for Tiles using JSF?
Well, I am trying around to get anything to work, but no configurations seem to work But I see a clear description in your url, so I will try that... Thx... :) BTJ Wendy Smoak wrote: From: Bjørn T Johansen [EMAIL PROTECTED] I am used to just using .tiledefname in Struts but this doesn's seem to work when using tiles with jsf... i.e. how do I navigate to a tiles def. in jsf? How do I set up the navigation rule, especially the to-view-id? From your other posts, it's not clear whether you're using Struts Tiles, or Standalone Tiles, or whether you're using Shale. For Shale + Standalone Tiles, try http://jroller.com/page/dgeary?entry=shale_adds_tiles_integration - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: AW: Problem with characters
Martin Kindler wrote: ... at last I installed a little filter on my container (Tomcat 5.0.x) which explicitly sets the encoding for each request and response to UTF-8. This proved to be the real solution. Hi Martin, Could you post the way you used? Thanks LuKe -- Email.it, the professional e-mail, gratis per te: http://www.email.it/f Sponsor: Con Tele2 risparmi al telefono e su Internet. Sempre. Clicca qui per conoscere le promozioni Clicca qui: http://adv.email.it/cgi-bin/foclick.cgi?mid=3757d=7-9 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How do I write a navigation rule for Tiles using JSF?
And looking at that url, gave the solution on how to name my tiles def and view id, so now it's working... Thx for all you suggestions :) BTJ Wendy Smoak wrote: From: Bjørn T Johansen [EMAIL PROTECTED] I am used to just using .tiledefname in Struts but this doesn's seem to work when using tiles with jsf... i.e. how do I navigate to a tiles def. in jsf? How do I set up the navigation rule, especially the to-view-id? From your other posts, it's not clear whether you're using Struts Tiles, or Standalone Tiles, or whether you're using Shale. For Shale + Standalone Tiles, try http://jroller.com/page/dgeary?entry=shale_adds_tiles_integration - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: a simpler way?
I understand what you mean, but my example has been very simple and only a little part of my page. I have much more text fields on my page, and everything I need is stored in a Bean in session scope. So using a PreAction to copy my whole Bean to an ActionForm with a lot of properties would be a lot of work and code. DynaValidatorFroms and Beans are there to avoid this extra Action, and all this extra properties, or is it wrong? As you can see, I still have to learn a lot... Regards, Peter By overriding the value in each text field you will never get the user enter value after validation fails. You should (at least how i understand), populate the action form with values in a PreAction i.e. PreAction - display to user - PostAction The preaction takes in the action form and populates its default values. Then you can using the struts html tag as they are intended Regards, Gareth - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
AW: AW: Problem with characters
As I took the code directly from Mike Gavaghan's article and it is available online http://www.javaworld.com/javaworld/jw-05-2004/jw-0524-i18n.html, i'ld ask you to look there. Martin -Ursprüngliche Nachricht- Von: lk [mailto:[EMAIL PROTECTED] Gesendet: Mittwoch, 7. September 2005 17:34 An: Struts Users Mailing List Betreff: Re: AW: Problem with characters Martin Kindler wrote: ... at last I installed a little filter on my container (Tomcat 5.0.x) which explicitly sets the encoding for each request and response to UTF-8. This proved to be the real solution. Hi Martin, Could you post the way you used? Thanks LuKe -- Email.it, the professional e-mail, gratis per te: http://www.email.it/f Sponsor: Con Tele2 risparmi al telefono e su Internet. Sempre. Clicca qui per conoscere le promozioni Clicca qui: http://adv.email.it/cgi-bin/foclick.cgi?mid=3757d=7-9 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: a simpler way?
The preaction is usually pretty simple, if your bean's properties and actionform's properties are in the same format, which going by your example it does. You can use PropertyUtils to prepopulate the ActionForm i.e. // in your preaction method PropertyUtils.copyProperties( form , beanFromSessionScope ); Regards, Gareth [EMAIL PROTECTED] wrote: I understand what you mean, but my example has been very simple and only a little part of my page. I have much more text fields on my page, and everything I need is stored in a Bean in session scope. So using a PreAction to copy my whole Bean to an ActionForm with a lot of properties would be a lot of work and code. DynaValidatorFroms and Beans are there to avoid this extra Action, and all this extra properties, or is it wrong? As you can see, I still have to learn a lot... Regards, Peter By overriding the value in each text field you will never get the user enter value after validation fails. You should (at least how i understand), populate the action form with values in a PreAction i.e. PreAction - display to user - PostAction The preaction takes in the action form and populates its default values. Then you can using the struts html tag as they are intended Regards, Gareth - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Gareth Evans MSoft eSolutions Limited Technology Centre Inward Way Rossmore Business Park Ellesmere Port Cheshire CH65 3EN -- Tel:+44 (0)870 0100 704 Fax:+44 (0)870 9010 705 E-Mail: [EMAIL PROTECTED] Web:www.msoft.co.uk -- Terms: Please note that any prices quoted within this e-mail are subject to VAT. All program details and code described in this e-mail are subject to copyright © of MSoft eSolutions Limited and remain the intellectual property of MSoft eSolutions Limited. Any proposal or pricing information contained within this e-mail are subject to MSoft eSolutions' Terms and Conditions -- Disclaimer: This message is intended only for use of the addressee. If this message was sent to you in error, please notify the sender and delete this message. MSoft eSolutions Limited cannot accept responsibility for viruses, so please scan attachments. Views expressed in this message do not necessarily reflect those of MSoft eSolutions Limited who will not necessarily be bound by its contents. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
DynaForms Radio Buttons
use the Id (userId,accountId)or concatination of Id|someOtherVariable as the value of the Radio button property. Then in your action you would use the value of the radio to perform further processing. In most cases, the rows are simple views of an object. The selection of the row would require you to build a more complex view of the object(built from it's ID) and send you to an edit screen. If you already have the complex model built, you need a rowId as the value, which you would use as the index of the list. Easiest way: String[] rowsSelected = form.get(propertyName); //in the action class String[] rowsSelected = get(propertyName); //in the form Going to an edit Screen? Perhaps you should use javascript to ensure only one is selected. Or use rowsSelected.size here Duane -Original Message- From: Enda Dowling [mailto:[EMAIL PROTECTED] Sent: Wednesday, September 07, 2005 10:07 AM To: user@struts.apache.org Subject: DynaForms Radio Buttons Hey, I am running into a problem with trying to create radio buttons with a dynamic amount of entries on the page. It is meant to be a very simple page where there are options and you just select Yes or No. The only thing is the number of options that are presented to the user is dynamic which means there needs to be a dynamic number of radio buttons present on the page. I started to use DynaForms but I don't think im configuring it correctly. The form that holds the Radio Buttons will just take need to take in the Yes or No answers as the other data is already stored in the session. What would be the best way to take those values in from the page? Thanks, Enda - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Forwarding to the previous page
This works very well for me. a class=button href=javascript:history.back()Back/a -Original Message- From: Tremal Naik [mailto:[EMAIL PROTECTED] Sent: Wednesday, September 07, 2005 7:24 AM To: Struts Users Mailing List Subject: Forwarding to the previous page Hi, I have a menu on my application, which is tiled in all the pages. I have an action of the menu which is common to all the page in which I am, so the execute() method of the action class associated to it must return a forward to the page which called it. I know how to map the forward of an action to a specific, struts-config hard-coded page. How can I deal with this kind of dynamic forwarding? Id est forwarding the action to the page which called it? Thanks -- TREMALNAIK - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Forwarding to the previous page
2005/9/7, Duane Rosengartner [EMAIL PROTECTED]: This works very well for me. a class=button href=javascript:history.back()Back/a aehm,probabily I didn't explain well my problem: I don't have to get back to the previous page from the actual. Look at this code: public class DisplayAboutAction extends Action { public ActionForward execute(ActionMapping actionMapping, ActionForm actionForm, HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse) { // do stuff. ActionForward af = new ActionForward(); af.setPath(previousPagePath); return af; } } I need to get a value for 'previousPagePath'. I'm trying something like : bean:page id=reqq property=request / html:link action=next.do paramId=old_page paramName=reqq paramProperty=servletPath but I'm using Tiles, so what I have as 'old_page' parameter is not the action 'previous.do' but '/jsplayout.jsp' instead thanks, TREMALNAIK - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: a simpler way?
You have two basic choices: (1) Display and submit ActionForm fields; you need to initialize these fields with your bean data before display, and to copy ActionForm fields' data back to bean after successful submission. If your ActionForm has session scope, you will need to initialize its fields only once. (2) Make your bean nested within ActionForm and use session scope for the latter. Throw out value attribute and use property only, like this: html:text name=myActionForm property=beanFromSessionScope.project / In this case your beanFromSessionScope should be able to accept invalid values. It should have String setters to be able to store whatever junk a user types in. beanFromSessionScope should be a detached object, having no effect on your persistent data. This is the approach I use. Michael. On 9/7/05, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: I understand what you mean, but my example has been very simple and only a little part of my page. I have much more text fields on my page, and everything I need is stored in a Bean in session scope. So using a PreAction to copy my whole Bean to an ActionForm with a lot of properties would be a lot of work and code. DynaValidatorFroms and Beans are there to avoid this extra Action, and all this extra properties, or is it wrong? As you can see, I still have to learn a lot... Regards, Peter By overriding the value in each text field you will never get the user enter value after validation fails. You should (at least how i understand), populate the action form with values in a PreAction i.e. PreAction - display to user - PostAction The preaction takes in the action form and populates its default values. Then you can using the struts html tag as they are intended Regards, Gareth - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Forwarding to the previous page
You can always get from where the request is coming from by getting the Referer from the Request. String referer = request.getHeader(REFERER); I'm not sure that this is want you want. You must beware that the referrer can be blank when typing in the URL in the browser, plus the consequences of the ActionForm.validate() and errors. HTH, Glenn Tremal Naik [EMAIL PROTECTED] 07/09/2005 12:22 PM Please respond to Struts Users Mailing List user@struts.apache.org To Struts Users Mailing List user@struts.apache.org cc Subject Re: Forwarding to the previous page 2005/9/7, Duane Rosengartner [EMAIL PROTECTED]: This works very well for me. a class=button href=javascript:history.back()Back/a aehm,probabily I didn't explain well my problem: I don't have to get back to the previous page from the actual. Look at this code: public class DisplayAboutAction extends Action { public ActionForward execute(ActionMapping actionMapping, ActionForm actionForm, HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse) { // do stuff. ActionForward af = new ActionForward(); af.setPath(previousPagePath); return af; } } I need to get a value for 'previousPagePath'. I'm trying something like : bean:page id=reqq property=request / html:link action=next.do paramId=old_page paramName=reqq paramProperty=servletPath but I'm using Tiles, so what I have as 'old_page' parameter is not the action 'previous.do' but '/jsplayout.jsp' instead thanks, TREMALNAIK - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Forwarding to the previous page
I don't think there's anything inherently in Struts to do that, however, it shouldn't be too hard to do on your own... how about this right before you return your ActionForward from ANY Action: session.setAttribute(previousPage, mapping.getPath()); That way, assuming everything in your app does go through an Action, which it generally should, than in any other Action you can get that attribute and it represents the last Action that executed... you can then return an appropriate ActionForward to get back to it. It would probably be a bit nicer to do this in a base Action, but that's up to you, the theory is the same. -- Frank W. Zammetti Founder and Chief Software Architect Omnytex Technologies http://www.omnytex.com On Wed, September 7, 2005 12:22 pm, Tremal Naik said: 2005/9/7, Duane Rosengartner [EMAIL PROTECTED]: This works very well for me. a class=button href=javascript:history.back()Back/a aehm,probabily I didn't explain well my problem: I don't have to get back to the previous page from the actual. Look at this code: public class DisplayAboutAction extends Action { public ActionForward execute(ActionMapping actionMapping, ActionForm actionForm, HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse) { // do stuff. ActionForward af = new ActionForward(); af.setPath(previousPagePath); return af; } } I need to get a value for 'previousPagePath'. I'm trying something like : bean:page id=reqq property=request / html:link action=next.do paramId=old_page paramName=reqq paramProperty=servletPath but I'm using Tiles, so what I have as 'old_page' parameter is not the action 'previous.do' but '/jsplayout.jsp' instead thanks, TREMALNAIK - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Forwarding to the previous page
Consider standard for Struts pre/post actions. You have showForm.do - JSP - submitForm.do - smthElse.do. The preceding action for smthElse.do is submitForm.do, so calling it does not make sense, since it would try to submit a non-existent form. By the way, your advice would work great with Struts Dialogs, where each dialog, that is, a web resource, is controlled by one action only. Apparently, in standard approach with pre/post actions it makes sense only to store pre-actions, that is, the rendering actions. In the case above it would be showForm.do. Michael. On 9/7/05, Frank W. Zammetti [EMAIL PROTECTED] wrote: I don't think there's anything inherently in Struts to do that, however, it shouldn't be too hard to do on your own... how about this right before you return your ActionForward from ANY Action: session.setAttribute(previousPage, mapping.getPath()); That way, assuming everything in your app does go through an Action, which it generally should, than in any other Action you can get that attribute and it represents the last Action that executed... you can then return an appropriate ActionForward to get back to it. It would probably be a bit nicer to do this in a base Action, but that's up to you, the theory is the same. -- Frank W. Zammetti Founder and Chief Software Architect Omnytex Technologies http://www.omnytex.com On Wed, September 7, 2005 12:22 pm, Tremal Naik said: 2005/9/7, Duane Rosengartner [EMAIL PROTECTED]: This works very well for me. a class=button href=javascript:history.back()Back/a aehm,probabily I didn't explain well my problem: I don't have to get back to the previous page from the actual. Look at this code: public class DisplayAboutAction extends Action { public ActionForward execute(ActionMapping actionMapping, ActionForm actionForm, HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse) { // do stuff. ActionForward af = new ActionForward(); af.setPath(previousPagePath); return af; } } I need to get a value for 'previousPagePath'. I'm trying something like : bean:page id=reqq property=request / html:link action=next.do paramId=old_page paramName=reqq paramProperty=servletPath but I'm using Tiles, so what I have as 'old_page' parameter is not the action 'previous.do' but '/jsplayout.jsp' instead thanks, TREMALNAIK - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Forwarding to the previous page
2005/9/7, Frank W. Zammetti [EMAIL PROTECTED]: I don't think there's anything inherently in Struts to do that, however, it shouldn't be too hard to do on your own... how about this right before you return your ActionForward from ANY Action: session.setAttribute(previousPage, mapping.getPath()); I was thinking of a navigation bean to store in the user session, but is that 'modifying ANY action' that I was trying to get rid of. thanks -- TREMALNAIK - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Tile usage
I have a main layout : definition name=Main path=/layout.jsp put name=navbar value=navigation.jsp/ put name=login value=login.jsp/ put name=locale value=locale.jsp/ put name=body type=string/ /definition I extend the main definition : definition name=.register extends=Main put name=body value=ResultBased type=definition/ /definition And finally here is the body definition name=ResultBased put name=formaction value=login.jsp/ put name=display value=sample.jsp/ /definition With that configuration I receive an exception : java.lang.NullPointerException at org.apache.jasper.runtime.JspRuntimeLibrary.getContextRelativePath(JspRuntimeLibrary.java:908) at org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimeLibrary.java:963) at org.apache.jasper.runtime.PageContextImpl.include(PageContextImpl.java:604) at org.apache.struts.tiles.TilesUtilImpl.doInclude(TilesUtilImpl.java:99) at org.apache.struts.tiles.TilesUtil.doInclude(TilesUtil.java:135) at org.apache.struts.taglib.tiles.InsertTag.doInclude(InsertTag.java:760) at org.apache.struts.taglib.tiles.InsertTag$InsertHandler.doEndTag(InsertTag.java:892) at org.apache.struts.taglib.tiles.InsertTag.doEndTag(InsertTag.java:462) at org.apache.jsp.layout_jsp._jspx_meth_tiles_insert_2(org.apache.jsp.layout_jsp:205) at org.apache.jsp.layout_jsp._jspx_meth_html_html_0(org.apache.jsp.layout_jsp:125) at org.apache.jsp.layout_jsp._jspService(org.apache.jsp.layout_jsp:72) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97) at javax.servlet.http.HttpServlet.service(HttpServlet.java:802) at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:322) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:291) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241) at javax.servlet.http.HttpServlet.service(HttpServlet.java:802) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173) at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:672) at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:463) at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:398) at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:301) at org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1063) at org.apache.struts.tiles.TilesRequestProcessor.doForward(TilesRequestProcessor.java:263) at org.apache.struts.tiles.TilesRequestProcessor.processTilesDefinition(TilesRequestProcessor.java:239) at org.apache.struts.tiles.TilesRequestProcessor.internalModuleRelativeForward(TilesRequestProcessor.java:341) at org.apache.struts.action.RequestProcessor.processForward(RequestProcessor.java:560) at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:209) at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1194) at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:414) at javax.servlet.http.HttpServlet.service(HttpServlet.java:689) at javax.servlet.http.HttpServlet.service(HttpServlet.java:802) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Forwarding to the previous page
On Wed, September 7, 2005 12:44 pm, Michael Jouravlev said: Consider standard for Struts pre/post actions. You have showForm.do - JSP - submitForm.do - smthElse.do. The preceding action for smthElse.do is submitForm.do, so calling it does not make sense, since it would try to submit a non-existent form. By the way, your advice would work great with Struts Dialogs, where each dialog, that is, a web resource, is controlled by one action only. Yep, your right, fair point. Maybe the answer, since my other reply was talking about doing it from a base Action, is to only extend from that base Action those Actions that should be return to-able ;) In other words, have your showForm.do extend BaseAction, and smthElse.do extend BaseAction, but NOT submitForm.do. That way you only ever store Actions that can legitimately be returned to, and in this case if you wound up in smthElse.do and wanted to return to the previous page, meaning showForm.do, that's precisely what was last stored in session, NOT submitForm.do, as you point out would be incorrect. Apparently, in standard approach with pre/post actions it makes sense only to store pre-actions, that is, the rendering actions. In the case above it would be showForm.do. Exactly, hence my suggestion. :) Michael. Frank - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
What JSF is missing
For shale and/or the next version of JSF. http://thielen.typepad.com/programming/2005/08/what_jsf_is_mis.html thanks - dave David Thielen 303-499-2544 www.windwardreports.com http://www.windwardreports.com/
Re: AW: Problem with characters
Martin and Luke, are you using different databases on the two environments? You might want to be sure you have MySQL configured to use unicode, and add the useUnicode and characterEncoding options to your database connect URL. You may also find that you need to set the character encoding property in the ContentType header in your Actions with response.setContentType(text/html;charset=UTF-8). I found on some browsers that the meta tag in the HTML won't override the value in the HTTP header. Just suggestions. I haven't actually dealt with this problem for quite a while. Mojo Martin Kindler wrote: David, could you please be a bit more specific? Just now I have a very similar problem as LuKe. I am using MySQl 4.1.10 and all tables are UTF-8. Struts is configured to use UTF 8 (i. e. the controller element in struts-config.xml says contentType=text/html;charset=UTF-8). This seems to work. My browsers (Firefox and IE6) decode the pages as UTF-8. BUT: when I enter text using a form (this is configured using the charSet-attribute to html:form to accept ISO-8859-1) IE6 garbles it while Firefox seems to work OK. Any hints? Martin -Ursprüngliche Nachricht- Von: Harland, David [mailto:[EMAIL PROTECTED] Gesendet: Mittwoch, 7. September 2005 10:35 An: Struts Users Mailing List Betreff: RE: Problem with characters Change you encoding to UTF-8. What database are you using? Dave. -Original Message- From: lk [mailto:[EMAIL PROTECTED] Sent: 07 September 2005 09:23 To: user@struts.apache.org Subject: Problem with characters Hi, I have a problem with some characters. My application reads some forms and writes them in a db. On my test and developing environment everything works well. The problem comes out when I deploy the application on the production server. When I fill in the form non English characters (for example the typical characters of the Italian language) they are read as ?. The strange thing is that in the same tomcat context there is an old no-struts application that works well. On this server Apache and Tomcat work together and this is the only difference from my test server. In both struts-config.xml and web.xml I put this encoding ?xml version=1.0 encoding=ISO-8859-1 ? Furthermore I use a tiles layout and in it I put: meta http-equiv=Content-Type content=text/html; charset=iso-8859-1 What could be the problem? LuKe -- Email.it, the professional e-mail, gratis per te: http://www.email.it/f Sponsor: Vuoi risparmiare sino al 70% sugli acquisti? Oliviero non teme confronti! Clicca qui: http://adv.email.it/cgi-bin/foclick.cgi?mid=3849d=7-9 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] This e mail is from DLA Piper Rudnick Gray Cary UK LLP. The contents of this email and any attachments are confidential to the intended recipient. They may not be disclosed to or used by or copied in any way by anyone other than the intended recipient. If this email is received in error, please contact DLA Piper Rudnick Gray Cary UK LLP on +44 (0) 8700 11 quoting the name of the sender and the email address to which it has been sent and then delete it. Please note that neither DLA Piper Rudnick Gray Cary UK LLP nor the sender accept any responsibility for viruses and it is your responsibility to scan or otherwise check this email and any attachments. DLA Piper Rudnick Gray Cary UK LLP is a limited liability partnership registered in England and Wales (registered number OC307847) which provides services from offices in England, Belgium, Germany and the People's Republic of China. A list of members is open for inspection at its registered office and principal place of business 3 Noble Street, London EC2V 7EE. Partner denotes member of a limited liability partnership. DLA Piper Rudnick Gray Cary UK LLP is regulated by the Law Society and is a member of DLA Piper Rudnick Gray Cary, a global legal services organisation, the members of which are separate and distinct legal entities. For further information, please refer to www.dlapiper.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Morris Jones Monrovia, CA http://www.whiteoaks.com Old Town Astronomers: http://www.otastro.org - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Tile usage
Hi Xavier, looking at the error, it seems instead of looking at formaction attribute as String, it's attempting to interpret it as a Page, and it's not able to find the login.jsp in the 'document root' area. If you need to pass in just a String value you may use type=String or, direct=true as part of the insert tag. i.e. put type=String name=formaction value=login.jsp/ or, put name=formaction value=login.jsp direct=true / Alternatively in the JSP template/layout page you can use tiles:getAsString name=formaction / instead of tiles:insert page=formaction / HTH, Dharmendra ps: have a good day! -Original Message- From: Xavier Vanderstukken [mailto:[EMAIL PROTECTED] Sent: Wednesday, September 07, 2005 1:07 PM To: user@struts.apache.org Subject: Tile usage I have a main layout : definition name=Main path=/layout.jsp put name=navbar value=navigation.jsp/ put name=login value=login.jsp/ put name=locale value=locale.jsp/ put name=body type=string/ /definition I extend the main definition : definition name=.register extends=Main put name=body value=ResultBased type=definition/ /definition And finally here is the body definition name=ResultBased put name=formaction value=login.jsp/ put name=display value=sample.jsp/ /definition With that configuration I receive an exception : java.lang.NullPointerException at org.apache.jasper.runtime.JspRuntimeLibrary.getContextRelativePath(JspRuntimeLibrary.java:908) at org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimeLibrary.java:963) at org.apache.jasper.runtime.PageContextImpl.include(PageContextImpl.java:604) at org.apache.struts.tiles.TilesUtilImpl.doInclude(TilesUtilImpl.java:99) at org.apache.struts.tiles.TilesUtil.doInclude(TilesUtil.java:135) at org.apache.struts.taglib.tiles.InsertTag.doInclude(InsertTag.java:760) at org.apache.struts.taglib.tiles.InsertTag$InsertHandler.doEndTag(InsertTag.java:892) at org.apache.struts.taglib.tiles.InsertTag.doEndTag(InsertTag.java:462) at org.apache.jsp.layout_jsp._jspx_meth_tiles_insert_2(org.apache.jsp.layout_jsp:205) at org.apache.jsp.layout_jsp._jspx_meth_html_html_0(org.apache.jsp.layout_jsp:125) at org.apache.jsp.layout_jsp._jspService(org.apache.jsp.layout_jsp:72) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97) at javax.servlet.http.HttpServlet.service(HttpServlet.java:802) at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:322) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:291) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241) at javax.servlet.http.HttpServlet.service(HttpServlet.java:802) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173) at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:672) at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:463) at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:398) at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:301) at org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1063) at org.apache.struts.tiles.TilesRequestProcessor.doForward(TilesRequestProcessor.java:263) at org.apache.struts.tiles.TilesRequestProcessor.processTilesDefinition(TilesRequestProcessor.java:239) at org.apache.struts.tiles.TilesRequestProcessor.internalModuleRelativeForward(TilesRequestProcessor.java:341) at org.apache.struts.action.RequestProcessor.processForward(RequestProcessor.java:560) at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:209) at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1194) at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:414) at javax.servlet.http.HttpServlet.service(HttpServlet.java:689) at javax.servlet.http.HttpServlet.service(HttpServlet.java:802) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] Visit our website at http://www.ubs.com This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately by e-mail if you have received this e-mail by mistake and delete this e-mail from your system. E-mail transmission cannot be guaranteed to be secure or error-free as information could be intercepted, corrupted, lost, destroyed, arrive late or
Re: Tile usage
On Sep 7, 2005, at 12:06 PM, Xavier Vanderstukken wrote: definition name=Main path=/layout.jsp put name=navbar value=navigation.jsp/ put name=login value=login.jsp/ put name=locale value=locale.jsp/ put name=body type=string/ /definition java.lang.NullPointerException at org.apache.jasper.runtime.JspRuntimeLibrary.getContextRelativePath (JspRuntimeLibrary.java:908) Are your pages at the root level of your webapp? Maybe you should define them as /navigation.jsp, /login.jsp, etc. Greg - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Is there a way to access Struts message resources from fmt:message / tag?
Hi Is there a way to access the message resources configured in the struts-config file from a JSP using fmt:message / tag? Regards, Néstor Boscán - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Is there a way to access Struts message resources from fmt:message / tag?
From: Néstor Boscán [EMAIL PROTECTED] Is there a way to access the message resources configured in the struts-config file from a JSP using fmt:message / tag? I have this in (Servlet 2.3) web.xml: !-- this is necessary for the JSTL fmt:message tags to work -- context-param param-namejavax.servlet.jsp.jstl.fmt.localizationContext/param-name param-valueApplicationResources/param-value /context-param Adjust the param value if your ApplicationResources.properties file isn't directly in WEB-INF/classes. -- Wendy Smoak - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Tile usage
Page path are ok, tile mechanism works well for my web application when I do that : definition name=Main path=/layout.jsp put name=navbar value=navigation.jsp/ put name=login value=login.jsp/ put name=locale value=locale.jsp/ put name=body type=string/ /definition definition name=.search extends=Main put name=body value=searchtile.jsp/ /definition but for some page I want to replace the body by two differents tiles. So I try doing the tile config in my first post : definition name=.display extends=Main put name=body value=displaytile.jsp/ /definition definition name=ResultBased put name=formaction value=login.jsp/ put name=display value=displaytile.jsp/ /definition Greg Reddin wrote: On Sep 7, 2005, at 12:06 PM, Xavier Vanderstukken wrote: definition name=Main path=/layout.jsp put name=navbar value=navigation.jsp/ put name=login value=login.jsp/ put name=locale value=locale.jsp/ put name=body type=string/ /definition java.lang.NullPointerException at org.apache.jasper.runtime.JspRuntimeLibrary.getContextRelativePath (JspRuntimeLibrary.java:908) Are your pages at the root level of your webapp? Maybe you should define them as /navigation.jsp, /login.jsp, etc. Greg - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
JSTL TLD confusion
hihi all, in the Struts (1.2.7) distribution it includes what i thought was everything you would need to use JSTL. namely, the standard.jar and jstl.jar (found under the struts/contrib/struts-el/lib folder). however, these jars are missing functions.tld file. then i discovered that the Jakarta Standard 1.1 Taglib distribution also comes with it's own versions of standard.jar and jstl.jar, and it has a fn.tld which contains the JSTL functions i want to use. also, i noticed the Struts JSTL tlds have URIs like this: urihttp://java.sun.com/jstl/core/uri while the Jakarta Standard 1.1 Taglib JSTL have slightly different URIs like this: urihttp://java.sun.com/jsp/jstl/core/uri which is the 'official' version we should be using? why are there such differences between these versions? woodchuck __ Click here to donate to the Hurricane Katrina relief effort. http://store.yahoo.com/redcross-donate3/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
AW: AW: Problem with characters
Thanks Mojo, yeah, setting the MySQL connection to use UTF-8 is also important :-). The response header should be dealt with by the Struts configuration. If I am right, this means exactly setting the response header to text/html; charset=UTF-8 as default. Martin -Ursprüngliche Nachricht- Von: Morris Jones [mailto:[EMAIL PROTECTED] Gesendet: Mittwoch, 7. September 2005 19:28 An: Struts Users Mailing List Betreff: Re: AW: Problem with characters Martin and Luke, are you using different databases on the two environments? You might want to be sure you have MySQL configured to use unicode, and add the useUnicode and characterEncoding options to your database connect URL. You may also find that you need to set the character encoding property in the ContentType header in your Actions with response.setContentType(text/html;charset=UTF-8). I found on some browsers that the meta tag in the HTML won't override the value in the HTTP header. Just suggestions. I haven't actually dealt with this problem for quite a while. Mojo Martin Kindler wrote: David, could you please be a bit more specific? Just now I have a very similar problem as LuKe. I am using MySQl 4.1.10 and all tables are UTF-8. Struts is configured to use UTF 8 (i. e. the controller element in struts-config.xml says contentType=text/html;charset=UTF-8). This seems to work. My browsers (Firefox and IE6) decode the pages as UTF-8. BUT: when I enter text using a form (this is configured using the charSet-attribute to html:form to accept ISO-8859-1) IE6 garbles it while Firefox seems to work OK. Any hints? Martin -Ursprüngliche Nachricht- Von: Harland, David [mailto:[EMAIL PROTECTED] Gesendet: Mittwoch, 7. September 2005 10:35 An: Struts Users Mailing List Betreff: RE: Problem with characters Change you encoding to UTF-8. What database are you using? Dave. -Original Message- From: lk [mailto:[EMAIL PROTECTED] Sent: 07 September 2005 09:23 To: user@struts.apache.org Subject: Problem with characters Hi, I have a problem with some characters. My application reads some forms and writes them in a db. On my test and developing environment everything works well. The problem comes out when I deploy the application on the production server. When I fill in the form non English characters (for example the typical characters of the Italian language) they are read as ?. The strange thing is that in the same tomcat context there is an old no-struts application that works well. On this server Apache and Tomcat work together and this is the only difference from my test server. In both struts-config.xml and web.xml I put this encoding ?xml version=1.0 encoding=ISO-8859-1 ? Furthermore I use a tiles layout and in it I put: meta http-equiv=Content-Type content=text/html; charset=iso-8859-1 What could be the problem? LuKe -- Email.it, the professional e-mail, gratis per te: http://www.email.it/f Sponsor: Vuoi risparmiare sino al 70% sugli acquisti? Oliviero non teme confronti! Clicca qui: http://adv.email.it/cgi-bin/foclick.cgi?mid=3849d=7-9 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] This e mail is from DLA Piper Rudnick Gray Cary UK LLP. The contents of this email and any attachments are confidential to the intended recipient. They may not be disclosed to or used by or copied in any way by anyone other than the intended recipient. If this email is received in error, please contact DLA Piper Rudnick Gray Cary UK LLP on +44 (0) 8700 11 quoting the name of the sender and the email address to which it has been sent and then delete it. Please note that neither DLA Piper Rudnick Gray Cary UK LLP nor the sender accept any responsibility for viruses and it is your responsibility to scan or otherwise check this email and any attachments. DLA Piper Rudnick Gray Cary UK LLP is a limited liability partnership registered in England and Wales (registered number OC307847) which provides services from offices in England, Belgium, Germany and the People's Republic of China. A list of members is open for inspection at its registered office and principal place of business 3 Noble Street, London EC2V 7EE. Partner denotes member of a limited liability partnership. DLA Piper Rudnick Gray Cary UK LLP is regulated by the Law Society and is a member of DLA Piper Rudnick Gray Cary, a global legal services organisation, the members of which are separate and distinct legal entities. For further information, please refer to www.dlapiper.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands,
Re: Struts in loadbalanced enviroment
Fritsch, Andre wrote: Hello Björn, That sounds good. But how do I realise it? i solved this problem with tomcat simply by setting a couple of attributes on the http connector in server.xml. dunno if you're using tomcat within jboss, or even if jboss uses tomcat anymore (it's been a few years since i worked with bjoss), but this might lead you in the right direction or help somebody else with a problem more similar to mine. in detail, here's what i did to get my tomcat 5.5 webapp working behind a reverse proxy (snipped from https://bugzilla.osafoundation.org/show_bug.cgi?id=3862#c6): in server.xml, you can set the proxyName and proxyPort attributes on a Connector. this will cause tomcat to use these values rather than the server name and port that tomcat understands. if your reverse proxy is negotiating ssl and passing plaintext http requests back to tomcat, then you'll need to add the secure and scheme attributes to the connector as well, so that tomcat knows to generate urls with the https scheme rather than http, and so that other container and webapp code knows that the request is considered to be secure. if you need to assign a specific namespace to cosmo in the reverse proxy, then you'll need to change the default context path for the cosmo webapp - this is the path attribute of the Context element. it's by default, signifying the root namespace. putting it all together: Connector port=8080 enableLookups=false proxyName=cosmo-demo.osafoundation.org proxyPort=80 secure=true scheme=https/ and Context path=/internal docBase=cosmo reloadable=false will cause tomcat to generate https://cosmo-demo.osafoundation.org/internal/account instead of http://hostname:8442/account see the following url for details on tomcat 5.5's proxy support: http://jakarta.apache.org/tomcat/tomcat-5.5-doc/config/http.html#Proxy%20Support fwiw, i also considered using a response wrapper, but i prefer to solve these sorts of problem in configuration when possible :) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
class file mapping
All, I am a newbie still testing things out to understand struts better. I have the following structure : java files in folder /classes. class files in folder /classes/test. This is al normal. I have create a simple index.jsp %@ taglib uri=/WEB-INF/struts-bean.tld prefix=bean % %@ taglib uri=/WEB-INF/struts-html.tld prefix=html % html head /head body html:form action=/index.do focus=name table tr td Name:/td tdhtml:text property=name//td /tr /table html:submitok/html:submit /html:form /body /html The url is http://localhost:8080/tests/index.jsp. This loads perfect. When I hit the submit button he changes the url to http://localhost:8080/tests/index.do. Up till here I can follow. But then... Can someone explain me why I need to place my class files also in the classes folder. Otherwise he complains about a 500 error (didn't produce a class file). When I found that out, I get another 500 No action instance for path /index could be created. Apparently this means that my action file does not extend the action class but it does. package test; import org.apache.struts.action.Action; import org.apache.struts.action.ActionForward; import org.apache.struts.action.ActionMapping; import org.apache.struts.action.ActionForm; import org.apache.commons.beanutils.BeanUtils; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; public final class insertTestAction extends Action { public insertTestAction() {} public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { testService service = new testService(); testForm testForm = (testForm) form; testDTO testDTO = new testDTO(); BeanUtils.copyProperties( testDTO, testForm ); service.insertTest( testDTO ); request.setAttribute(tests,testDTO); return (mapping.findForward(success)); } } Can someone tell me a bit more about those two things ( like why these happen, what I can do to avoid the errors). The weirdest thing in fact is the fact that I need to copy my class files into the classes too, normally he should look into the test folder... Greetz, -- No virus found in this outgoing message. Checked by AVG Anti-Virus. Version: 7.0.344 / Virus Database: 267.10.18/91 - Release Date: 6/09/2005 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: JSTL TLD confusion
From: Woodchuck [EMAIL PROTECTED] which is the 'official' version we should be using? It depends on what version of the Servlet spec you're using. Struts-EL goes with JSTL 1.0 on Servlet 2.3. That's what you see in the Struts 1.2.7 distribution in the 'contrib' directory. When you move to JSTL 1.1 (and Servlet 2.4) then you go back to the original (non-EL) Struts tags, because you gain the ability to use expressions anywhere in the page. If you still need help, tell us what version of what Servlet container you're using. -- Wendy Smoak - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: JSTL TLD confusion
Just to add to what Wendy said - whats distributed with struts-el are the Jakarta Standard 1.0 taglib implementation and the differences between that and the Jakarta Standard 1.1 taglib (dtd and URIs) are down to changes in the JSTL specification. http://jakarta.apache.org/taglibs/doc/standard-doc/intro.html Niall - Original Message - From: Wendy Smoak [EMAIL PROTECTED] Sent: Wednesday, September 07, 2005 9:09 PM From: Woodchuck [EMAIL PROTECTED] which is the 'official' version we should be using? It depends on what version of the Servlet spec you're using. Struts-EL goes with JSTL 1.0 on Servlet 2.3. That's what you see in the Struts 1.2.7 distribution in the 'contrib' directory. When you move to JSTL 1.1 (and Servlet 2.4) then you go back to the original (non-EL) Struts tags, because you gain the ability to use expressions anywhere in the page. If you still need help, tell us what version of what Servlet container you're using. -- Wendy Smoak - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: class file mapping
Do you refer to insertTestAction or to test.insertTestAction in your action mapping? Can you post your action mapping? Michael. On 9/7/05, Simons Kevin [EMAIL PROTECTED] wrote: This loads perfect. When I hit the submit button he changes the url to http://localhost:8080/tests/index.do. Up till here I can follow. But then... Can someone explain me why I need to place my class files also in the classes folder. Otherwise he complains about a 500 error (didn't produce a class file). When I found that out, I get another 500 No action instance for path /index could be created. Apparently this means that my action file does not extend the action class but it does. package test; ... public final class insertTestAction extends Action { ... } - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[OT-ish] Re: JSTL TLD confusion
i see. i'm using Tomcat 5.5.9 with servlet spec 2.4 right now. i will update to the JSTL found in the Jakarta Standard 1.1 Taglib distribution. thanks, Wendy! :) the way JSTL exists right now does not help alleviate the confusion imho. please correct me if i'm wrong but for example, if you go to Sun's official page about JSTL (http://java.sun.com/products/jsp/jstl), you can find tutorials that dive right into JSTL, and also download API docs for JSTL. but nowhere can you find the actual TLD files (nor the standard.jar or jstl.jar) for download. yet, the Jakarta project seems to be the 'keeper' of JSTL, since the files required to use JSTL are found in the Struts and Standard Taglib distributions. there is no mention of this 'link' to Jakarta on Sun's website. even googling takes a while to finally find someone mentioning about where to get the files. does Sun not want to acknowledge Jakarta? why does JSTL seem to be a tucked away goody hidden away for those lucky enough to find it? is it just me? lol :p woodchuck --- Wendy Smoak [EMAIL PROTECTED] wrote: From: Woodchuck [EMAIL PROTECTED] which is the 'official' version we should be using? It depends on what version of the Servlet spec you're using. Struts-EL goes with JSTL 1.0 on Servlet 2.3. That's what you see in the Struts 1.2.7 distribution in the 'contrib' directory. When you move to JSTL 1.1 (and Servlet 2.4) then you go back to the original (non-EL) Struts tags, because you gain the ability to use expressions anywhere in the page. If you still need help, tell us what version of what Servlet container you're using. -- Wendy Smoak - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Click here to donate to the Hurricane Katrina relief effort. http://store.yahoo.com/redcross-donate3/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
NoClassDefFoundError: org/apache/taglibs/standard/lang/support/ExpressionEvaluatorManager
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hey Guys, I am trying to migrate a small app from 1.1 to 1.2.7 and I experiencing this exception on JSP that previously worked just fine. I have the standard.jar in the lib directory and in the classpath. [2005-09-07 13:59:50]java.lang.NoClassDefFoundError: org/apache/taglibs/standard/lang/support/ExpressionEvaluatorManager [2005-09-07 13:59:50] at com.caucho.jsp.QPageContext.handlePageException(QPageContext.java:665) [2005-09-07 13:59:50] at _web_22dinf._jsp._downloadgames._edit_0game__jsp._jspService(_edit_0game __jsp.java:609) [2005-09-07 13:59:50] at com.caucho.jsp.JavaPage.service(JavaPage.java:75) [2005-09-07 13:59:50] at com.caucho.jsp.Page.subservice(Page.java:506) Any guesses? - -Randy -BEGIN PGP SIGNATURE- Version: GnuPG v1.2.4 (Darwin) iD8DBQFDH1aAvmgyD0mfSYQRAjVXAJ940v3KAU2Nn6fCHMMQMc6pv/N21QCfdG9p sGBKdXymllIbiIcAB50ROI8= =UM+l -END PGP SIGNATURE- - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [OT-ish] Re: JSTL TLD confusion
From: Woodchuck [EMAIL PROTECTED] the way JSTL exists right now does not help alleviate the confusion imho. please correct me if i'm wrong but for example, if you go to Sun's official page about JSTL (http://java.sun.com/products/jsp/jstl), you can find tutorials that dive right into JSTL, and also download API docs for JSTL. but nowhere can you find the actual TLD files (nor the standard.jar or jstl.jar) for download. This is what Niall was trying to clarify about my post. :) What we call JSTL is really the JavaServer Pages Standard Tag Library Specification. There is a Reference Implementation available from Sun at the bottom of http://jcp.org/aboutJava/communityprocess/final/jsr052/ (linked to from the URL you posted above). yet, the Jakarta project seems to be the 'keeper' of JSTL, since the files required to use JSTL are found in the Struts and Standard Taglib distributions. Jakarta has another implementation of the spec, called Jakarta Standard Taglib. (One implementation for each version of the JSTL spec.) And that (the 1.0 verson) is what Struts distributes with Struts-EL. If I got all my acronyms straight, hopefully that clears things up somewhat. :) -- Wendy Smoak - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: class file mapping
You don't mention your Struts config file. Do you have one? I would suggest you move your java files to a src folder but not under the /WEB-INF, put them under the project folder, eg /project/src alongside /project/test The class files should then be compiled into WEB-INF/classes. The directory structure of WEB-INF/classes for your class files is not an option, it is a requirement of Struts. There are a number of documented directory structures in a Struts application and you must adhere to these. This is how Struts knows to go looking in certain places for certain files. A key one of course is the Struts config file, however the location of this is specified in the web.xml, however the location of the web.xml is fixed. Another suggestion, name all of your classes with capital letters and then name instances of these with lowercase, it really helps when you get into the coding. eg TestService testservice = new TestService(); Kind regards mc On 7 Sep 2005 at 21:29, Simons Kevin wrote: All, I am a newbie still testing things out to understand struts better. I have the following structure : java files in folder /classes. class files in folder /classes/test. This is al normal. I have create a simple index.jsp %@ taglib uri=/WEB-INF/struts-bean.tld prefix=bean % %@ taglib uri=/WEB-INF/struts-html.tld prefix=html % html head /head body html:form action=/index.do focus=name table tr td Name:/td tdhtml:text property=name//td /tr /table html:submitok/html:submit /html:form /body /html The url is http://localhost:8080/tests/index.jsp. This loads perfect. When I hit the submit button he changes the url to http://localhost:8080/tests/index.do. Up till here I can follow. But then... Can someone explain me why I need to place my class files also in the classes folder. Otherwise he complains about a 500 error (didn't produce a class file). When I found that out, I get another 500 No action instance for path /index could be created. Apparently this means that my action file does not extend the action class but it does. package test; import org.apache.struts.action.Action; import org.apache.struts.action.ActionForward; import org.apache.struts.action.ActionMapping; import org.apache.struts.action.ActionForm; import org.apache.commons.beanutils.BeanUtils; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; public final class insertTestAction extends Action { public insertTestAction() {} public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { testService service = new testService(); testForm testForm = (testForm) form; testDTO testDTO = new testDTO(); BeanUtils.copyProperties( testDTO, testForm ); service.insertTest( testDTO ); request.setAttribute(tests,testDTO); return (mapping.findForward(success)); } } Can someone tell me a bit more about those two things ( like why these happen, what I can do to avoid the errors). The weirdest thing in fact is the fact that I need to copy my class files into the classes too, normally he should look into the test folder... Greetz, -- No virus found in this outgoing message. Checked by AVG Anti-Virus. Version: 7.0.344 / Virus Database: 267.10.18/91 - Release Date: 6/09/2005 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- No virus found in this incoming message. Checked by AVG Anti-Virus. Version: 7.0.344 / Virus Database: 267.10.18/91 - Release Date: 6/09/2005 FOCUS Computing Mob: 0415 24 26 24 [EMAIL PROTECTED] http://www.focus-computing.com.au -- No virus found in this outgoing message. Checked by AVG Anti-Virus. Version: 7.0.344 / Virus Database: 267.10.18/91 - Release Date: 6/09/2005 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: NoClassDefFoundError: org/apache/taglibs/standard/lang/support/ExpressionEvaluatorManager
Randy Shepherd [EMAIL PROTECTED] wrote on 09/07/2005 05:07:12 PM: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hey Guys, I am trying to migrate a small app from 1.1 to 1.2.7 and I experiencing this exception on JSP that previously worked just fine. I have the standard.jar in the lib directory and in the classpath. Can you check and see that standard.jar is just in one place: WEB-INF/lib? If so, do a clean rebuild and see if your error goes away. Regards, Geeta
Re: [OT-ish] Re: JSTL TLD confusion
--- Wendy Smoak [EMAIL PROTECTED] wrote: There is a Reference Implementation available from Sun at the bottom of http://jcp.org/aboutJava/communityprocess/final/jsr052/ (linked to from the URL you posted above). actually i visited that page before but only found docs for download. no actual implementation... Jakarta has another implementation of the spec, called Jakarta Standard Taglib. (One implementation for each version of the JSTL spec.) And that (the 1.0 verson) is what Struts distributes with Struts-EL. If I got all my acronyms straight, hopefully that clears things up somewhat. :) yea, i went there just now and saw the 1.1 and the 1.0 implementations, and also the note about which implementation works under with which servlet and jsp specs. i think my confusion relates to 'spec' vs 'implementation'. Sun seems to be the keeper of the specs, while Jakarta implements them. i keep expecting everything to be in one place, because they have tutorials and all sorts of documentation on it. but in reality, it's like we have lots of info about it here, but we don't actually know where to get it, sorry... are there even other implementations of JSTL (ie. by other vendors)? ...don't answer that. it only took one implementation to confuse me, lol. and i'm happy with it, and in fact the perfect world would only have one implementation of every spec known to mankind. wouldn't that be great! :D woodchuck __ Click here to donate to the Hurricane Katrina relief effort. http://store.yahoo.com/redcross-donate3/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[IMPORTANT] tomcat 5.0.19+ is broken / not useable with struts / your voice needed
to whom it may concern There is a serious bug in tomcat 5. To make it short, if you write to or read from session (taglibs included) and have a chance that there is more than one request from same user currently proceeded on the server (and it can be just a web-page refresh, our beloved F5 key) you are f**ked. What happens is that the HashMap where the session attributes are stored got corrupted, and the entry.next in the HashMap points to itself (or start of the list). Next request to the session.getAttribute results in an endless loop, and your server has 100% cpu load. You can read full bug description at: http://issues.apache.org/bugzilla/show_bug.cgi?id=36541 What does it mean for us, struts-users? If we use the session scope: 1. Struts-taglibs aren't thread-safe. 2. Application that are working under tomcat 4.1 or resin, or probably any other servlet container will not work under tomcat 5 (or are not reliable). 3. We must forbid users to have multiple browsers open. 4. We can't handle multiple frames or concurrent requests from same user / session. 5. ... many other examples available. affected versions: 5.0.19+ 5.5.x If you ever had actions hanging around in session.getAttribute()/HashMap.get() for hours and don't know why - it's your bug. What can you do: Please, click the bug link (http://issues.apache.org/bugzilla/show_bug.cgi?id=36541) and read it ALL carefully. Decide whether you may or may not be affected by this issue. If you are affected by this issue, and most of us are affected, log in and vote for the bug. If you don't have a bugzilla account, but are affected by this bug: setup a bugzilla account and vote. Similar request has been started by Wade Chandler at tomcat-users list. regards Leon P.S. One more thing, could struts-developers team supply a patch for tomcat 5.0.x and 5.5.x for download on the struts homepage? surrounding calls to attributes hashmap with synchronized(attributes){} as it was done in 4.1.x is sufficent.
Re: Upload: strange characters in german filename
Looks like the filename is being sent as utf-8, but being read as Latin1 (can't remember the iso number). Struts uses Commons FileUpload to handle the file uploads. By default it uses org.apache.struts.upload.CommonsMultipartRequestHandler Now Commons FileUpload has a method called setHeaderEncoding (- http://jakarta.apache.org/commons/fileupload/apidocs/org/apache/commons/fileupload/FileUploadBase.html#setHeaderEncoding(java.lang.String) If you can call FileUpload.setHeaderEncoding(utf-8) before the headers are read that should fix the problem. One way to do that is override the default handler with your own one in struts-config.xml eg controller multipartClass=my.own.MultiPartClassHandler / Then to modify org.apache.struts.upload.CommonsMultipartRequestHandler by creating our my.own.MultiPartClassHandler class. We need to modify the handleRequest() method like so: // Create and configure a DIskFileUpload instance. DiskFileUpload upload = new DiskFileUpload(); upload.setHeaderEncoding(UTF-8); // Set the maximum size before a FileUploadException will be thrown. upload.setSizeMax((int) getSizeMax(ac)); ... ... Bart Frackiewicz wrote: Hello, after uploading a file, getFileName() returns me always a wrong filename, if the filename contains one of the german umlaute (like ü, ä or ö). The filename looks like: Angebot_Tipps fï¿œr Kids.doc (i display it BEFORE i save the name in the database). This error appears _only_ in the input-file tag, if i enter some characters in a normal input-field, everything goes fine. Is this a known error? I found nothing in the web. Is here anyone running Struts / upload running succesful with german filenames? TIA, Bart -- Jason Lea - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [IMPORTANT] tomcat 5.0.19+ is broken / not useable with struts / your voice needed
:( I wonder if the new java.util.concurrent classes could be used instead of simple HashMap? http://java.sun.com/j2se/1.5.0/docs/api/java/util/concurrent/ConcurrentHashMap.html but that would mean total dependence on j2se 1.5 and that would be a problem for supporting j2se 1.4, though a backport is being worked on here http://www.mathcs.emory.edu/dcl/util/backport-util-concurrent/ other reading here: http://gee.cs.oswego.edu/dl/classes/EDU/oswego/cs/dl/util/concurrent/intro.html I think that sort of thing would provide a nice solution for speed + reliability. Leon Rosenberg wrote: to whom it may concern There is a serious bug in tomcat 5. To make it short, if you write to or read from session (taglibs included) and have a chance that there is more than one request from same user currently proceeded on the server (and it can be just a web-page refresh, our beloved F5 key) you are f**ked. What happens is that the HashMap where the session attributes are stored got corrupted, and the entry.next in the HashMap points to itself (or start of the list). Next request to the session.getAttribute results in an endless loop, and your server has 100% cpu load. You can read full bug description at: http://issues.apache.org/bugzilla/show_bug.cgi?id=36541 What does it mean for us, struts-users? If we use the session scope: 1. Struts-taglibs aren't thread-safe. 2. Application that are working under tomcat 4.1 or resin, or probably any other servlet container will not work under tomcat 5 (or are not reliable). 3. We must forbid users to have multiple browsers open. 4. We can't handle multiple frames or concurrent requests from same user / session. 5. ... many other examples available. affected versions: 5.0.19+ 5.5.x If you ever had actions hanging around in session.getAttribute()/HashMap.get() for hours and don't know why - it's your bug. What can you do: Please, click the bug link (http://issues.apache.org/bugzilla/show_bug.cgi?id=36541) and read it ALL carefully. Decide whether you may or may not be affected by this issue. If you are affected by this issue, and most of us are affected, log in and vote for the bug. If you don't have a bugzilla account, but are affected by this bug: setup a bugzilla account and vote. Similar request has been started by Wade Chandler at tomcat-users list. regards Leon P.S. One more thing, could struts-developers team supply a patch for tomcat 5.0.x and 5.5.x for download on the struts homepage? surrounding calls to attributes hashmap with synchronized(attributes){} as it was done in 4.1.x is sufficent. -- Jason Lea - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
connecting to server
Hi, I am new to struts and I want to create a web interface to my application. Once I login, I need to connect to my server and it should be available to all my action classes. Where should I create connection to my server? and How? Thank you very much, Nirmala - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [IMPORTANT] tomcat 5.0.19+ is broken / not useable with struts / your voice needed
On 9/7/05, Jason Lea [EMAIL PROTECTED] wrote: :( I wonder if the new java.util.concurrent classes could be used instead of simple HashMap? http://java.sun.com/j2se/1.5.0/docs/api/java/util/concurrent/ConcurrentHashMap.html This would definitely be feasible for Tomcat 5.5 (which already has a dependency on Java SE 5). but that would mean total dependence on j2se 1.5 and that would be a problem for supporting j2se 1.4, though a backport is being worked on here http://www.mathcs.emory.edu/dcl/util/backport-util-concurrent/ Makes sense to consider this for Tomcat 5.0 (although it may well be that the performance hit is low enough to make this extra work unnecessary). other reading here: http://gee.cs.oswego.edu/dl/classes/EDU/oswego/cs/dl/util/concurrent/intro.html I think that sort of thing would provide a nice solution for speed + reliability. Craig Leon Rosenberg wrote: to whom it may concern There is a serious bug in tomcat 5. To make it short, if you write to or read from session (taglibs included) and have a chance that there is more than one request from same user currently proceeded on the server (and it can be just a web-page refresh, our beloved F5 key) you are f**ked. What happens is that the HashMap where the session attributes are stored got corrupted, and the entry.next in the HashMap points to itself (or start of the list). Next request to the session.getAttribute results in an endless loop, and your server has 100% cpu load. You can read full bug description at: http://issues.apache.org/bugzilla/show_bug.cgi?id=36541 What does it mean for us, struts-users? If we use the session scope: 1. Struts-taglibs aren't thread-safe. 2. Application that are working under tomcat 4.1 or resin, or probably any other servlet container will not work under tomcat 5 (or are not reliable). 3. We must forbid users to have multiple browsers open. 4. We can't handle multiple frames or concurrent requests from same user / session. 5. ... many other examples available. affected versions: 5.0.19+ 5.5.x If you ever had actions hanging around in session.getAttribute()/HashMap.get() for hours and don't know why - it's your bug. What can you do: Please, click the bug link (http://issues.apache.org/bugzilla/show_bug.cgi?id=36541) and read it ALL carefully. Decide whether you may or may not be affected by this issue. If you are affected by this issue, and most of us are affected, log in and vote for the bug. If you don't have a bugzilla account, but are affected by this bug: setup a bugzilla account and vote. Similar request has been started by Wade Chandler at tomcat-users list. regards Leon P.S. One more thing, could struts-developers team supply a patch for tomcat 5.0.x and 5.5.x for download on the struts homepage? surrounding calls to attributes hashmap with synchronized(attributes){} as it was done in 4.1.x is sufficent. -- Jason Lea - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: about create myself ActionForward
nobody do like this? who have a good idea? On 9/7/05, fenris [EMAIL PROTECTED] wrote: oh , yes ,I know where I am wrong . I don't set the parameter's value for the new ActionForm which is reference to the new URL.(the new action). So I must to find the new form with the URL. Now I find that , I must use the RequestProcessor.java 's function to find it . But , the function I used in the RequestProcessor.java is protected. For example : GeneralActionServlet s = (GeneralActionServlet)getServlet(); RequestProcessor processor = s.getProcessor (); String path = /a/b; ActionMapping mapping = (ActionMapping )processor.processMapping(m_request, m_response, path); GeneralActionForm f = (GeneralActionForm)processor.processActionForm(m_request, m_response, mapping); So I must subclass the RequestProcessor.java to create a new function to get the actionForm according to the new URL. But I think this will destroy the structure. Are there any other method? thank you . On 9/6/05, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: fenris [EMAIL PROTECTED] wrote on 09/06/2005 02:13:44 AM: In my sub class for the action.java , I want to return a ActionForward created by myself (use new ActionForward(path)) in the function execute. (because I want forward a URL which is not declared in the struts-config.xml. can I ? ) Yes, you can do this. But it throw a Exception. What exception are you getting? Can you send us the code you have? I don't know why ? Geeta
RE: class file mapping
Can you send the struts config file??? Regards Ayusman -Original Message- From: Simons Kevin [mailto:[EMAIL PROTECTED] Sent: Thursday, September 08, 2005 1:00 AM To: Struts Users Mailing List Subject: class file mapping All, I am a newbie still testing things out to understand struts better. I have the following structure : java files in folder /classes. class files in folder /classes/test. This is al normal. I have create a simple index.jsp %@ taglib uri=/WEB-INF/struts-bean.tld prefix=bean % %@ taglib uri=/WEB-INF/struts-html.tld prefix=html % html head /head body html:form action=/index.do focus=name table tr td Name:/td tdhtml:text property=name//td /tr /table html:submitok/html:submit /html:form /body /html The url is http://localhost:8080/tests/index.jsp. This loads perfect. When I hit the submit button he changes the url to http://localhost:8080/tests/index.do. Up till here I can follow. But then... Can someone explain me why I need to place my class files also in the classes folder. Otherwise he complains about a 500 error (didn't produce a class file). When I found that out, I get another 500 No action instance for path /index could be created. Apparently this means that my action file does not extend the action class but it does. package test; import org.apache.struts.action.Action; import org.apache.struts.action.ActionForward; import org.apache.struts.action.ActionMapping; import org.apache.struts.action.ActionForm; import org.apache.commons.beanutils.BeanUtils; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; public final class insertTestAction extends Action { public insertTestAction() {} public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { testService service = new testService(); testForm testForm = (testForm) form; testDTO testDTO = new testDTO(); BeanUtils.copyProperties( testDTO, testForm ); service.insertTest( testDTO ); request.setAttribute(tests,testDTO); return (mapping.findForward(success)); } } Can someone tell me a bit more about those two things ( like why these happen, what I can do to avoid the errors). The weirdest thing in fact is the fact that I need to copy my class files into the classes too, normally he should look into the test folder... Greetz, -- No virus found in this outgoing message. Checked by AVG Anti-Virus. Version: 7.0.344 / Virus Database: 267.10.18/91 - Release Date: 6/09/2005 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] CAUTION - Disclaimer * This e-mail contains PRIVILEGED AND CONFIDENTIAL INFORMATION intended solely for the use of the addressee(s). If you are not the intended recipient, please notify the sender by e-mail and delete the original message. Further, you are not to copy, disclose, or distribute this e-mail or its contents to any other person and any such actions are unlawful. This e-mail may contain viruses. Infosys has taken every reasonable precaution to minimize this risk, but is not liable for any damage you may sustain as a result of any virus in this e-mail. You should carry out your own virus checks before opening the e-mail or attachment. Infosys reserves the right to monitor and review the content of all messages sent to or from this e-mail address. Messages sent to or from this e-mail address may be stored on the Infosys e-mail system. ***INFOSYS End of Disclaimer INFOSYS*** - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
AW: AW: Struts in loadbalanced enviroment
Yes thats the case, all redirects are changed to https, but thats what I need as the all pages should be ssl encoded. In fact the logic I have in there is that it actually only converts the redirects if the hostname got a specific IP, domain (which are configured using Filter Params) in order to do local development and testing without the need of a loadbalancer to be in place. Bjoern -Ursprüngliche Nachricht- Von: Adam Hardy [mailto:[EMAIL PROTECTED] Gesendet: Mittwoch, 7. September 2005 16:30 An: Struts Users Mailing List Betreff: Re: AW: Struts in loadbalanced enviroment Hi there, this approach I presume restricts you to SSL only on all your redirects - or do you have logic in there to determine whether any particular URL has to be SSL encoded or not? Am I correct in thinking that the use of the load-balancer to do the SSL-encoding prevents the use of container-managed security in a distributed environment? Adam Eickvonder Bjoern on 06/09/05 12:04, wrote: Hello, we solved this problem by using a redirect-filter over the whole application that wraps the HttpServletResponse. This HttpServletResponseWrapper overwrites the sendRedirect method such that it replaces http by https. As every redirect-request goes through this method you got what you want. Bjoern Eickvonder -Ursprüngliche Nachricht- Von: Fritsch, Andre [mailto:[EMAIL PROTECTED] Gesendet: Dienstag, 6. September 2005 08:55 An: user@struts.apache.org Betreff: Struts in loadbalanced enviroment Hello to everyone in the struts user-group! In our productive environment we have a problem concerning struts redirects behind our load balanced servers. Queries to the running struts applications are sent by https protocol towards the load balancer which receives the query, terminates ssl and forwards plain http to a Jboss application server in which the struts application is running. Our problem is that struts receives the query in http and uses this protocol for the redirect but we would need https to recontact the load balancer correctly with ssl. We have a 4 step development process from the developer pc to our test system and then via our integration system to the productive environment. The developer pc, our test system and our integration system does not use ssl and the test and integration system is not load balanced. To support high availability our productive system is load balanced to 4 servers and uses ssl connection. We know that it is possible to solve it hard coded either by defining absolute links or define a forward in the struts config xml. But our release workflow through the 4 steps is mostly automated so that this would cause extensive administrative input for every application that passes a development phase. Therefore we are looking for a possibility to specify a global parameter so that struts redirects are sent by pre defined protocol. Http: on the developer pc, the test and integration system. Https: on our productive system. Is it possible to specify such a parameter or is there another possibility to override the protocol not restricting the use of relative links? Kind Regards, André Fritsch Virus checked by G DATA AntiVirusKit Version: AVK 16.355 from 07.09.2005 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: JSF - Shale transition
Moving from Struts to JSF is moving to a more defined framework? That is pretty difficult to grasp. Could you explain? On 9/6/05, Craig McClanahan [EMAIL PROTECTED] wrote: On 9/6/05, Walton, Kaleb (ISS Southfield) [EMAIL PROTECTED] wrote: Hey all, As I had mentioned in a previous post, our team is looking to move towards a more well defined web framework. From my limited experience using Shale (ran the shale-use-cases) I'm not feeling very confident that we could use it *right away*. I wanted to ask for opinions on what would be a gradual step for us to take towards the Shale framework (once it's stable enough to use in a production environment). For example, would JSF + Spring be a good combo that would make for an easy transition to Shale? Struts + WebFlow + Spring? Etc.. Do the aforementioned framework combinations even matter? Will Shale just add another layer on top or glue together with what we would have already developed? Although I've been reading up on Shale quite a bit, my understanding is still limited so please excuse me if these questions are easily found through already documented sources. If they are, please share where they can be found :) The key to choosing a transition approach is what you want to use for the front controller part of your architecture durng the interim. If you're starting from Struts, a straightforward path would be to use the integration library to start switching your pages to using JSF components instead of Struts HTML tags (without having to modify your actions), followed by a migration of the back-end logic to using JSF's front controller and request processing lifecycle. If, on the other hand, you decide to commit to JSF's controller early rather than late, you might as well just use Shale along with it from the beginning. Unlike the way that other frameworks deal with JSF, Shale *assumes* you will be using the JSF controller architecture, and it just adds ease of use around problems you'll face anyway. It doesn't try to treat JSF as purely a component architecture. Craig McClanahan Regards, Kaleb - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- You can lead a horse to water but you cannot make it float on its back. ~Dakota Jack~ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: AW: AW: Problem with characters
Hi all, I had a similar problem with Tomcat 5.0.24 a year or so ago and came up with a different solution. On Windows it was using a default charset which was quite limited. To force it to use something more useful I added: -Dfile.encoding=ISO-8859-1 to Tomcat's startup java options. To get around the same problem under linux I just added the same option to our Tomcat user's JAVA_OPTS environment variable. -- Stephen Martin Kindler wrote: As I took the code directly from Mike Gavaghan's article and it is available online http://www.javaworld.com/javaworld/jw-05-2004/jw-0524-i18n.html, i'ld ask you to look there. Martin -Ursprüngliche Nachricht- Von: lk [mailto:[EMAIL PROTECTED] Gesendet: Mittwoch, 7. September 2005 17:34 An: Struts Users Mailing List Betreff: Re: AW: Problem with characters Martin Kindler wrote: ... at last I installed a little filter on my container (Tomcat 5.0.x) which explicitly sets the encoding for each request and response to UTF-8. This proved to be the real solution. Hi Martin, Could you post the way you used? Thanks LuKe -- Email.it, the professional e-mail, gratis per te: http://www.email.it/f Sponsor: Con Tele2 risparmi al telefono e su Internet. Sempre. Clicca qui per conoscere le promozioni Clicca qui: http://adv.email.it/cgi-bin/foclick.cgi?mid=3757d=7-9 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]