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]
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]
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]
How to add a FormFile field at runtime?
Hi, I need to make a form with an org.apache.struts.upload.FormFile field. The user should be able to add at runtime as many new FormFile fields as he wants. How can I do that if I don't know the exact number of FormFile fields the page will contain? Thanks LuKe -- Email.it, the professional e-mail, gratis per te: http://www.email.it/f Sponsor: Dai più energia al tuo sport! Rigenera il tuo corpo in maniera naturale * Grazie agli integratori sport che trovi solo su Erboristeria.com Clicca qui: http://adv.email.it/cgi-bin/foclick.cgi?mid=2379d=25-8 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
How to put the sumbol prime; into an html:text tag
Hi, I need to show the character ' (prime;) inside an html:text tag. The problem is that the tag html:text renders an html text field substituting the escape sequence with the following sequence: amp;prime; It seems that the amperseand is substituted with the sequence amp. Why? The jstl core tag c:out has the attribute escapeXml=false. Is there something similar for html:text/textarea? Thanks LuKe -- Email.it, the professional e-mail, gratis per te: http://www.email.it/f Sponsor: Ab king pro l'unico attrezzo che ti permette di ottenere addominali piatti e scolpiti in poche sedute. * Clicca qui: http://adv.email.it/cgi-bin/foclick.cgi?mid=2844d=21-7 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
How to populate a FormFile?
Hi, I want an html:select field to show the name of a file I get from a database. I've tried to populate the field with a FormField object I instantiate with the name of the file. But there is something wrong as I get in the html field something like: input type=file name=pdf value=[EMAIL PROTECTED] What could be the problem? ByE LuKe -- Email.it, the professional e-mail, gratis per te: http://www.email.it/f Sponsor: Dai più energia al tuo sport! Rigenera il tuo corpo in maniera naturale * Grazie agli integratori sport che trovi solo su Erboristeria.com Clicca qui: http://adv.email.it/cgi-bin/foclick.cgi?mid=2379d=15-7 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Problem with html:select
Balasubramaniam, Sezhiyan wrote: I usually set the JavaScript add-options statements using logic-iterate and on the event of user clicks a button; this function will be called which will populate the select box. function refreshSelect() { logic:iterate id=MIP_SUBGRP_CD name=MIP_SUBGRP_CD document.forms[0].eligMipSubgrpCd.options[%=y%] = new Option('bean:write name=MIP_SUBGRP_CD property=description/','bean:write name=MIP_SUBGRP_CD property=code/'); %y++;% /logic:iterate } You can try this. But avoid using forms[0] or the scriptlets in logic tags(though it works fine) Make sure that the select is populated correctly and don't forget to select some item[s] before submits the form. Bala Thanks for your answer. Now if I submit the form I select all the options, but I get the following error from Tomcat: ^^ javax.servlet.ServletException: BeanUtils.populate at org.apache.struts.util.RequestUtils.populate(RequestUtils.java:1254) [...] root cause org.apache.commons.beanutils.ConversionException: Cannot assign value of type 'java.lang.String' to property 'chosen' of type 'java.util.ArrayList' at org.apache.struts.action.DynaActionForm.set(DynaActionForm.java:423) [...] ^^ 'chosen' is the select I want to read. If I don't select any item I don't get that error but of course chosen is empty. The html code is: !-- ### -- tr td style=width:200px; span class=etichettaInvestimenti disponibili/span: select class=transfer name=possible size=5 multiple c:forEach var=row items=${elencoinvestimenti} varStatus=status option value=c:out value=${row.id} /c:out value=${row.nome} / /option /c:forEach /select /td !-- ### -- td style=width:30px; a href=javascript:copyToList('possible','chosen') img src=gestione/images/icon_frecciadx.gif width=21 height=21 /abr a href=javascript:copyToList('chosen','possible') img src=gestione/images/icon_frecciasx.gif width=21 height=21 /a /td !-- ### -- td style=width:200px; span class=etichettaInvestimenti collocabili/span: html:select property=chosen size=5 styleClass=transfer multiple=true /html:select /td The firs selct is given; the second is populated by clicking over a button (using a javascript that put the values in the select box). LuKe -- Email.it, the professional e-mail, gratis per te: http://www.email.it/f Sponsor: Digitalpix: Il metodo più comodo, veloce e conveniente * per stampare le tue foto digitali migliori. Clicca qui: http://adv.email.it/cgi-bin/foclick.cgi?mid=1523d=14-7 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Problem with html:select
Hi, I have a html:select that at begin is empty. Using a javascript and clicking over a button the select field can be populated? The problem is that if I try to read in my Action class the select it seems to be empty. (I use (ArrayList)((DynaValidatorForm)form).get(chosen) to get the ArrayList that should contain the list of chosen items) The field is declared in my struts-config.xml as a DynaActionForm field. What could be the problem? Thanks LuKe -- Email.it, the professional e-mail, gratis per te: http://www.email.it/f Sponsor: Prestiti Online. Scopri subito se sei finanziabile. in 24 ore senza spese né anticipi, clicca qui * Clicca qui: http://adv.email.it/cgi-bin/foclick.cgi?mid=2908d=11-7 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
What's wrong? [prepopulating a form...]
Hi, I'm trying to prepopulate a form for editing it and I can't understand what's wrong. From a list of objects I want to edit one. I have an action for that: action path=/polizza_mod type=mypackage.PolizzaFormModAction name=polizza_newForm scope=request input=/gestione/polizza_mod.jsp validate=false forward name=OK path=/gestione/polizza_mod.jsp/ /action ^ polizza_newForm is a DynaActionForm defined in the struts-config.xml ^ The action is: import javax.servlet.ServletContext; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpSession; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.struts.action.Action; import org.apache.struts.action.ActionForm; import org.apache.struts.action.ActionForward; import org.apache.struts.action.ActionMapping; import org.apache.struts.validator.DynaValidatorForm; public class PolizzaFormModAction extends Action { public boolean DEBUG = true; public ActionForward execute( ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { HttpSession session = request.getSession(); // Here I create the bean PolizzaBean pb = new PolizzaBean(getDataSource(request, Parameters.NOME_DATA_SOURCE)); PolizzaDTO p = pb.getPolizza(request.getParameter(id)); // SAVE THE OBJECT polizza in the session session.setAttribute(polizza, p); ServletContext sc = this.getServlet().getServletContext(); xferToForm(p,form,sc); session.setAttribute(polizzaForm, form); return (mapping.findForward(OK)); } /** * transfer bean data to form */ private void xferToForm(PolizzaDTO polizza, ActionForm form, ServletContext sc) { ((DynaValidatorForm)form).set(nome,polizza.getNome()); } } ^ Everything works fine but the form /gestione/polizza_mod.jsp is empty? Why??? If I try to print on that form the bean polizza_newForm the properties are correct: c:out value=${polizza_newForm} / gives: DynaActionForm[dynaClass=polizza_newForm,nome=test] My form is: html:form action=/polizza_new_preview.do html:text name=polizza_newForm property=nome size=25 maxlength=25 value= / html:submit value=Conferma styleClass=bottone / html:button value=Elimina property=Elimina styleClass=bottone / html:reset value=Annulla styleClass=bottone / /html:form Thanks LuKe -- Email.it, the professional e-mail, gratis per te: http://www.email.it/f Sponsor: Iscriviti GRATUITAMENTE: ci sono 5 Euro che ti aspettano .e decine di corsi... * Clicca qui: http://adv.email.it/cgi-bin/foclick.cgi?mid=3416d=10-7 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: What's wrong? [prepopulating a form...]
Gotcha Oh poor man :-) The problem was in the form: I used the attribute value= for the html:text tag from an old form ByE If I try to print on that form the bean polizza_newForm the properties are correct: c:out value=${polizza_newForm} / gives: DynaActionForm[dynaClass=polizza_newForm,nome=test] My form is: html:form action=/polizza_new_preview.do html:text name=polizza_newForm property=nome size=25 maxlength=25 value= / html:submit value=Conferma styleClass=bottone / html:button value=Elimina property=Elimina styleClass=bottone /html:reset value=Annulla styleClass=bottone / /html:form Thanks LuKe -- Email.it, the professional e-mail, gratis per te: http://www.email.it/f Sponsor: Email.it Phone Card: chiami in tutto il mondo a tariffe imbattibili da tutti i telefoni fissi e cellulari! Clicca e scopri come Clicca qui: http://adv.email.it/cgi-bin/foclick.cgi?mid=2686d=10-7 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Multiple RequestProcessor
Hi, I have a problem using a Custom RequestProcessor: in my tomcat context I already have a CustomRequestProcessor that authenticates the user. Now I need to add a new module for my application with a completely different method of authentication. How can I say to the RequestProcessor from which part of the application comes the user? Thanks LuKe -- Email.it, the professional e-mail, gratis per te: http://www.email.it/f Sponsor: Problemi di Liquidità? Con Logos Finanziaria 30.000 in 24 ore a dipendenti e lavoratori autonomi con rimborsi fino a 120 mesi clicca qui * Clicca qui: http://adv.email.it/cgi-bin/foclick.cgi?mid=2907d=6-7 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Problems with tiles
Davi G. Friedman wrote: Luke, Your settings look normal. I've checked the 1.2.4 code relating to your error and somehow the struts initialization isn't loading or loading correctly. Have you turned on any sort of debugging and can show the webapp startup messages? Have you done any logging in your class to prove it is loading? Is your struts-config.xml spelled correctly, located in /WEB-INF/struts-config.xml AND mentioned with the exact path in your /WEB-INF/web.xml? Regards, David Thanks David, I think I found the problem: I was using MyEclipse 3.8.4 with Struts 1.2. I've tried to use Struts 1.1 and everything runs well. Bye LuKe -- Email.it, the professional e-mail, gratis per te: http://www.email.it/f Sponsor: Scarica la Rana Pazza sul tuo cellulare - come vista in televisione! * La prima suoneria è GRATIS! Clicca qui: http://adv.email.it/cgi-bin/foclick.cgi?mid=3539d=6-6 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Problems with tiles
David G. Friedman wrote: Luke, Can you include some of the code for your TilesRequestProcessor subclass as well as how you initialize it in your struts-config.xml (or modules) ? Regards, David -Original Message- Sure! The CustomRequestProcessor is taken from a book by Mike Robinson: ^^ package com.mycompany.struts; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpSession; //import org.apache.struts.action.RequestProcessor; import org.apache.struts.tiles.TilesRequestProcessor; /** * @author Mike Robinson * */ public class CustomRequestProcessor extends TilesRequestProcessor { /** * Handles validating of each user request, insuring that * the user has logged in properly. If not, they get re-directed * to the login page. */ protected boolean processPreprocess(HttpServletRequest request, HttpServletResponse response) { boolean continueProcessing = true; // Test if the request is a login request try { HttpSession session = null; // make sure session has not timed out if(request.isRequestedSessionIdValid()) session = request.getSession(); else response.sendRedirect(index.jsp?invalid=yes); // get the current request path String path = processPath(request, response); // if user is not trying to logon or join, make sure user has been authenticated if ((!path.equals((String) /index))( !path.equals((String) /join))) { // get the user bean UserDTO user = (UserDTO) session.getAttribute(user); // insure user has logged on if (user == null) // else make them logon first { try { response.sendRedirect(index.jsp?invalid=yes); } catch(Exception ioe) { log.error(problem redirecting in processPreprocess - + ioe.getMessage()); } continueProcessing = false; } } } catch(Exception ioe) { log.error(problem processing path - + ioe.getMessage()); continueProcessing = false; } return continueProcessing; } } ì !-- == Controller Definition == -- controller processorClass=com.mycompany.struts.CustomRequestProcessor / -- Email.it, the professional e-mail, gratis per te: http://www.email.it/f Sponsor: Niente paura, da oggi puoi recuperare i dati persi dal PC, semplice come cliccare qui Clicca qui: http://adv.email.it/cgi-bin/foclick.cgi?mid361d=5-6 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
What does it mean?
Hi, I got the following error: Exception initializing TldLocationsCache: XML parsing error on file /WEB-INF/tlds/sql.tld: (line 3, col 8): Document is invalid: no grammar found. I'm using MyEclipseIde 3.8.4 on Eclipse 3.0.2 (linux). I get that exception many times during the running of my application and I cannot understand what does it mean. I don't use this tag in my application but the sql.tld is in the correct directory. Thanks for any advise! LuKe -- Email.it, the professional e-mail, gratis per te: http://www.email.it/f Sponsor: Solo 10 Euro per chiamare in tutto il mondo!! Scopri il vantaggio di Email Phone Card,clicca subito Clicca qui: http://adv.email.it/cgi-bin/foclick.cgi?mid=2685d=5-6 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Problems with tiles
Hi, I'm trying to use the tiles framework. Everything runs well, but if I try to use a custom RequestProcessor I get this error in the console: Jun 3, 2005 4:54:26 PM org.apache.struts.tiles.TilesPlugin initRequestProcessorClass SEVERE: TilesPlugin : Specified RequestProcessor not compatible with TilesRequestProcessor In the browser window I get an error that begins with: javax.servlet.ServletException: TilesPlugin : Specified RequestProcessor not compatible with TilesRequestProcessor My custom RequestProcessor subclasses TilesRequestProcessor instead RequestProcessor. Thanks for any advice! 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=3-6 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]