Problem with json and encoding
Hi! I'm using json-taglib [0] to populate lists of users (user: username, id, name, surname, description) to an s:autocompleter tag. I put the code in [1] of json. I put the snipplet of jsp in [2]. the system i'm developing is for spanish speakers, so some times they use non ascii characters in those fields. Those characters (for instance, 'ñ', 'é', ...) are rendered as ( "ñ" and "é" respectively) I have added the next line, but it dosn't seem to do anything. <%@ page language="java" contentType="application/json; charset=UTF-8" pageEncoding="UTF-8"%> I hope you can help me!! Thanks in advance Nicolas Pace [0] http://json-taglib.sourceforge.net/ [1] <%@ taglib prefix="json" uri="http://www.atg.com/taglibs/json"; %> <%@ taglib prefix="s" uri="/struts-tags" %> [2] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Parameter Mapping with Set elements
On 6/10/07, Dave Newton <[EMAIL PROTECTED]> wrote: > --- Nicolás Pace <[EMAIL PROTECTED]> wrote: > > The point here is that Sets are not indexable, so i > > can't name elements by their unique id... > > Let me rephrase: I don't know how you'd be able to use > a Set directly on a web page simply because it's *not* > indexable. > > My guess is that you'd have to massage between a > collection of some sort and the set you want, but > perhaps someone else has another suggestion. > I will answer myself, as usual The problem was that I was badly reimplementing the equals method. Because of that it was not inserting both of the elements!!! Thanks to all!! *Nico > d. > > > > > > Shape Yahoo! in your own image. Join our Network Research Panel today! > http://surveylink.yahoo.com/gmrs/yahoo_panel_invite.asp?a=7 > > > > - > 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 parameter conversion
On 7/20/07, Nicolás Pace <[EMAIL PROTECTED]> wrote: > Hello list! > I'm having the next problem: > I'm using a for picking time :P > the problem is that when i submit the form, apache throws > Jul 20, 2007 10:42:37 AM org.apache.tomcat.util.http.Parameters > processParameters > WARNING: Parameters: Invalid chunk ignored. I will answer to myself!! Debugging Tomcat (yeah!!!) i discovered that those warnings are sent when tomcat finds something like this "&=&otherprop=dgasg&", a prop without name and value. Bye *Nico > > What does it mean? how can i solve it? > > The object i'm mapping this value is a java.util.Date, maybe "13:00" > is not a complete date? > > Thanks!!! > > Nickar > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
MDA and Struts2
Hello list! Is there anyone using some sort of mda tools with struts2? I couldn't find any one out there. Thanks! *Nico
Another Problem with autocomplete
People: this is the scenary: I'm using . I pick one option with a mouse click in the optionlist. The id is modified! then i focus the textbox and add charaters. The id should be nullified, but it doen't happen. Any ideas? Nickar - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Problem with parameter conversion
Hello list! I'm having the next problem: I'm using a for picking time :P the problem is that when i submit the form, apache throws Jul 20, 2007 10:42:37 AM org.apache.tomcat.util.http.Parameters processParameters WARNING: Parameters: Invalid chunk ignored. What does it mean? how can i solve it? The object i'm mapping this value is a java.util.Date, maybe "13:00" is not a complete date? Thanks!!! Nickar - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Preparable, Type conversion and parameter
On 6/25/07, Mansour <[EMAIL PROTECTED]> wrote: Dave Newton wrote: > --- Mansour <[EMAIL PROTECTED]> wrote: > >> I am trying to extract an int in the prepare method. >> I am not able to cast it. This is an example of >> > what > >> I am trying to do: >> >> Map parameters = >> ActionContext.getContext().getParameters(); >> Integer task_id = (Integer) >> parameters.get("task.id"); >> For this one: SEVERE: Servlet.service() for servlet default threw exception java.lang.ClassCastException: [Ljava.lang.String; cannot be cast to java.lang.Integer This means that the object you are trying to cast is an String's Array. Frequently, this is an Array with only one element, ..., the string you need Good Luck! nickar at action.TaskAction.prepare(TaskAction.java:62) at com.opensymphony.xwork2.interceptor.PrepareInterceptor.doIntercept(PrepareInterceptor.java:118) at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:86) >> I wanna try to avoid using Type conversion. >> > > Um, why? > > >> This didn't work either: >> >> int task_id = Integer.parseInt( >> parameters.get("task.id").toString()) ; >> parameters.get("task.id").toString() evaluates to (java.lang.String) [Ljava.lang.String;@434ff9 >> Do I have to use type conversion even for primitive >> types? >> >> Any idea? >> > > Yes, look up what the parameters map actually > contains. > > Normally when reporting an error like this you'd show > the typecast exception you're getting, which should > provide a clue as to why it isn't working, as an array > of a type can't be converted to a single instance of a > type. > > There are quicker ways of finding answers to these > questions than posting to the group! > > Like what. Please tell me a place where I can get this resolved. :) You think I didn't look ? Sometimes programmers get stuck with a problem that looks simple to others. No one knows everything, Dave ! > d. > > > > > > Be a better Heartthrob. Get better relationship answers from someone who knows. Yahoo! Answers - Check it out. > http://answers.yahoo.com/dir/?link=list&sid=396545433 > > - > 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: How to populate Collection element of FormBean on Submit
On 6/15/07, Nagesh Kumar Suravarjula <[EMAIL PROTECTED]> wrote: Hi I have a Collection Element in my Form Bean whose elements are displayed in a table in JSP . Also, I have a hidden variable in my JSP whose values are coming from this Collection Element. I do have a reset method in my form bean. My requirement is that, when I submit the jsp, I get the below error : [Servlet Error]-[BeanUtils.populate]: javax.servlet.ServletException: BeanUtils.populate at com.netegrity.was511.filter.ServletFilter.doFilter(ServletFilter.java:75) at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstance Wrapper.java:132) at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain. java:71) at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.handleWebAppDispatch( WebAppRequestDispatcher.java:1162) at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.dispatch(WebAppReques tDispatcher.java:676) at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.forward(WebAppRequest Dispatcher.java:203) at com.ibm.ws.webcontainer.srt.WebAppInvoker.doForward(WebAppInvoker.java:125) at com.ibm.ws.webcontainer.srt.WebAppInvoker.handleInvocationHook(WebAppInvoker java:294) at com.ibm.ws.webcontainer.cache.invocation.CachedInvocation.handleInvocation(C achedInvocation.java:71) at com.ibm.ws.webcontainer.srp.ServletRequestProcessor.dispatchByURI(ServletReq uestProcessor.java:246) at com.ibm.ws.webcontainer.oselistener.OSEListenerDispatcher.service(OSEListene r.java:334) at com.ibm.ws.webcontainer.http.HttpConnection.handleRequest(HttpConnection.jav a:56) at com.ibm.ws.http.HttpConnection.readAndHandleRequest(HttpConnection.java:652) at com.ibm.ws.http.HttpConnection.run(HttpConnection.java:458) at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:912) How to overcome this situation ? How can I submit a collection at the time of submit of a form ? You can do this by mapping the elements of the collection to html forms using OGNL expressions. Look here for an explanation on how struts+ognl do the mapping: http://cwiki.apache.org/WW/ognl.html Nickar Your early reply is highly appreciated. Thanks & Regards Nagesh - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: S2: datetimepicker and multiple date formats
On 6/12/07, Scott Nesbitt <[EMAIL PROTECTED]> wrote: I have this code: It works fine if the user uses the drop-down or types in a date in just the right format. However, we would like the following to work better: user input actual value desired value -- - 06-12-07 NaN-NaN-0NaN 06-12-2007 06/13/2007 06-12-2007 (refused change) 06-13-2007 06 13 2007 06-12-2007 (refused change) 06-13-2007 etc. Basically, I would like to allow multiple date formats in order to make life easier for my users. Can I intercept the user input somehow before it goes to the validation and fix it up? Scott, Struts 2 automatically uses de correct locale information based in the host's information. You don't have to worry about it, unless you wan't to force it. The best thing to do is to hope that users will configure correctly their desktops so Struts can use that information correctly. I hope this could help you Bye nicolás Pace Thanks, Scott Sucker-punch spam with award-winning protection. Try the free Yahoo! Mail Beta. http://advision.webevents.yahoo.com/mailbeta/features_spam.html - 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: Parameter Mapping with Set elements
The point here is that Sets are not indexable, so i can't name elements by their unique id... On 6/10/07, Dave Newton <[EMAIL PROTECTED]> wrote: --- Nicolás Pace <[EMAIL PROTECTED]> wrote: > The main problem is that the only way to access > collection elements with ognl is like accessing an > array, and when i generate those dinamic components > with javascript, i don't know how to name those > elements to have them mapped to the Set. Name them whatever the name of them is in the action. For example, I have a JSP page that uses the following S2 tag for a text input field where exMap is (obviously, I guess) a map with its backing object's id as the map key: I dynamically create additional components with the following JavaScript, called from a method taking id, which, and idx parameters: var name = 'exMap[' + id + '].' + which + '[' + idx + '].foo'; var sTag = ''; This example is a little bit different because each of the map entries is an ordered list (and I formatted and edited heavily so it might be minorly broken), but you get the idea. d. Shape Yahoo! in your own image. Join our Network Research Panel today! http://surveylink.yahoo.com/gmrs/yahoo_panel_invite.asp?a=7 - 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]
Parameter Mapping with Set elements
Hi!, I'm having a problem trying to map elements from a Set Collection in my Action to form components, and to generate form components dinamically and have them inserted in this set. Any suggestions? The main problem is that the only way to access collection elements with ognl is like accessing an array, and when i generate those dinamic components with javascript, i don't know how to name those elements to have them mapped to the Set. Thanks nicolas pace - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: html:hidden
On 6/10/07, john lee <[EMAIL PROTECTED]> wrote: How to assaign value to html:hidden field? > but give me the error message, saying need double quote, after i put double quote before "<%..", cause jsp compile error, Which error did it cause? any clue? tks in advance john - Sucker-punch spam with award-winning protection. Try the free Yahoo! Mail Beta. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: ModelDriven interface
On 6/9/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: I'm working with Struts 2.0.6 and I'm trying to use the ModelDriven Interface. However, I seem to be having some troubles. My actionClass implements ModelDriven, but the values on the page don't fill with the values of the object returned by getModel(). If I explicitly declare the getXxx() methods for each attribute of the "model" within the Action, the values are populated in the .jsp form. The correct way of populating the values IS declaring the getters and setters for each object you want to populate. Matt Luce Wells Fargo Funds Management, LLC 414.577.7927 414.359.3537 Fax - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Elements in collection = null in Struts 2 view
I will answer myself!!! The problem was that I was using a wrong ognl expression to access the iterator element. The correct expression would be "#tel", not "tel". Nicolás Pace On 6/7/07, Nicolás Pace <[EMAIL PROTECTED]> wrote: Hi everyone! Description: The problem is that when i debug this webapp, inside the servlet i can see the elements inside de modelo.Telefonos collection, but the jsp can't. In the jsp, the collection only have null's, but the correct number of them. (if the collection has 3 elements, there are 3 nulls inside it) :S The database also contains those elements. Thanks in advance Nicolás Pace Struts version: 2.0.6 Hibernate version: 3.1.3 or 3.2 Mapping documents: -Modelo.hbm.xml--- http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd";> --- ---Telefono.hbm.xml http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd";> Code between sessionFactory.openSession() and session.close(): Using OpenSessionInView pattern with ServletFilter suggested here ModeloAction.java public class ModeloAction extends ActionSupport { private Modelo modelo; ... execute() { modelo = (Modelo) s.get(Modelo.class, id); modelo.getTelefonos().size(); modelo.getDomicilios().size(); modelo.getCaracteristicas().size(); modelo.getGrupoFamiliar().size(); modelo.getHabilidades().size(); modelo.getHorariosDisponibles().size(); modelo.getObservaciones().size(); modelo.getRestricciones().size(); } } Modelo.jsp: ... ... Full stack trace of any exception that occurs: Name and version of the database you are using:mysql The generated SQL (show_sql=true): Hibernate: select modelo0_.id as id16_1_, modelo0_.apellido as apellido16_1_, modelo0_.nombre as nombre16_1_, modelo0_.fechaNacimiento as fechaNac4_16_1_, modelo0_.foto as foto16_1_, modelo0_.turno as turno16_1_, modelo0_.escuela as escuela16_1_, telefonos1_.model_id as model1_3_, telefono2_.id as telefono2_3_, telefono2_.id as id9_0_, telefono2_.numero as numero9_0_ from Modelo modelo0_ left outer join modelo_telefono telefonos1_ on modelo0_.id=telefonos1_.model_id left outer join Telefono telefono2_ on telefonos1_.telefono_id=telefono2_.id where modelo0_.id=? Hibernate: select domicilios0_.model_id as model1_1_, domicilios0_.dom_id as dom2_1_, domicilio1_.dom_id as dom1_3_0_, domicilio1_.calle as calle3_0_, domicilio1_.numero as numero3_0_, domicilio1_.departamento as departam4_3_0_, domicilio1_.ciudad as ciudad3_0_ from modelo_domicilio domicilios0_ left outer join Domicilio domicilio1_ on domicilios0_.dom_id=domicilio1_.dom_id where domicilios0_.model_id=? Hibernate: select caracteris0_.model_id as model1_1_, caracteris0_.carac_id as carac2_1_, caracteris1_.carac_id as carac1_4_0_, caracteris1_.nombre as nombre4_0_ from modelo_caracteristica caracteris0_ left outer join CaracteristicaFisica caracteris1_ on caracteris0_.carac_id=caracteris1_.carac_id where caracteris0_.model_id=? Hibernate: select grupofamil0_.grupoFamiliar_id as grupoFam1_1_, grupofamil0_.model_id as model2_1_, modelo1_.id as id16_0_, modelo1_.apellido as apellido16_0_, modelo1_.nombre as nombre16_0_, modelo1_.fechaNacimiento as fechaNac4_16_0_, modelo1_.foto as foto16_0_, modelo1_.turno as turno16_0_, modelo1_.escuela as escuela16_0_ from modelo_grupoFamiliar grupofamil0_ left outer join Modelo modelo1_ on grupofamil0_.model_id=modelo1_.id where grupofamil0_.grupoFamiliar_id=? Hibernate: select habilidade0_.model_id as model1_1_, habilidade0_.habilidad_id as habilidad2_1_, habilidad1_.id as id7_0_, habilidad1_.nombre as nombre7_0_ from modelo_habilidad habilidade0_ left outer join Habilidad habilidad1_ on habilidade0_.habilidad_id=habilidad1_.id where habilidade0_.model_id=? Hibernate: select horariosdi0_.model_id as model1_1_, horariosdi0_.franja_id as franja2_1_, franjahora1_.id as id6_0_, franjahora1_.dia as dia6_0_, franjahora1_.horaInicio as horaInicio6_0_, franjahora1_.horaFin as horaFin6_0_ from modelo_horarioDisponible horariosdi0_ left outer join FranjaHoraria franjahora1_ on horariosdi0_.franja_id=franjahora1_.id where horariosdi0_.model_id=? Hibernate: select observacio0_.model_id as model1_1_, observacio0_.observacion_id as observac2_1_, observacio1_.id as id8_0_, observacio1_.nombre as nombre8_0_ from modelo_observacion observacio0_ left outer join Observacion observacio1_ on observacio0_.observacion_id=observacio1_.id where observacio0_.model_id=? Hibernate: select restriccio0_.model_id as model1_1_, restriccio0_.restricciones_id as restricc2_1_, restriccio1_.id as id5_0_, restriccio1_.nombre as nombre5_0_ from modelo_restriccion restriccio0_ left outer join Restriccion restriccio1_ on restriccio0_.restricc
autocompleter y multipart/form-data
Hello When I setup my form with encoding=multiaprt/form-data, the autocompleter tag stops working. When i trace the problem, it seems that no parameters are sent. Any suggestion? Thanks Nickoar - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Elements in collection = null in Struts 2 view
Hi everyone! Description: The problem is that when i debug this webapp, inside the servlet i can see the elements inside de modelo.Telefonos collection, but the jsp can't. In the jsp, the collection only have null's, but the correct number of them. (if the collection has 3 elements, there are 3 nulls inside it) :S The database also contains those elements. Thanks in advance Nicolás Pace Struts version: 2.0.6 Hibernate version: 3.1.3 or 3.2 Mapping documents: -Modelo.hbm.xml--- http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd";> --- ---Telefono.hbm.xml http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd";> Code between sessionFactory.openSession() and session.close(): Using OpenSessionInView pattern with ServletFilter suggested here ModeloAction.java public class ModeloAction extends ActionSupport { private Modelo modelo; ... execute() { modelo = (Modelo) s.get(Modelo.class, id); modelo.getTelefonos().size(); modelo.getDomicilios().size(); modelo.getCaracteristicas().size(); modelo.getGrupoFamiliar().size(); modelo.getHabilidades().size(); modelo.getHorariosDisponibles().size(); modelo.getObservaciones().size(); modelo.getRestricciones().size(); } } Modelo.jsp: ... ... Full stack trace of any exception that occurs: Name and version of the database you are using:mysql The generated SQL (show_sql=true): Hibernate: select modelo0_.id as id16_1_, modelo0_.apellido as apellido16_1_, modelo0_.nombre as nombre16_1_, modelo0_.fechaNacimiento as fechaNac4_16_1_, modelo0_.foto as foto16_1_, modelo0_.turno as turno16_1_, modelo0_.escuela as escuela16_1_, telefonos1_.model_id as model1_3_, telefono2_.id as telefono2_3_, telefono2_.id as id9_0_, telefono2_.numero as numero9_0_ from Modelo modelo0_ left outer join modelo_telefono telefonos1_ on modelo0_.id=telefonos1_.model_id left outer join Telefono telefono2_ on telefonos1_.telefono_id=telefono2_.id where modelo0_.id=? Hibernate: select domicilios0_.model_id as model1_1_, domicilios0_.dom_id as dom2_1_, domicilio1_.dom_id as dom1_3_0_, domicilio1_.calle as calle3_0_, domicilio1_.numero as numero3_0_, domicilio1_.departamento as departam4_3_0_, domicilio1_.ciudad as ciudad3_0_ from modelo_domicilio domicilios0_ left outer join Domicilio domicilio1_ on domicilios0_.dom_id=domicilio1_.dom_id where domicilios0_.model_id=? Hibernate: select caracteris0_.model_id as model1_1_, caracteris0_.carac_id as carac2_1_, caracteris1_.carac_id as carac1_4_0_, caracteris1_.nombre as nombre4_0_ from modelo_caracteristica caracteris0_ left outer join CaracteristicaFisica caracteris1_ on caracteris0_.carac_id=caracteris1_.carac_id where caracteris0_.model_id=? Hibernate: select grupofamil0_.grupoFamiliar_id as grupoFam1_1_, grupofamil0_.model_id as model2_1_, modelo1_.id as id16_0_, modelo1_.apellido as apellido16_0_, modelo1_.nombre as nombre16_0_, modelo1_.fechaNacimiento as fechaNac4_16_0_, modelo1_.foto as foto16_0_, modelo1_.turno as turno16_0_, modelo1_.escuela as escuela16_0_ from modelo_grupoFamiliar grupofamil0_ left outer join Modelo modelo1_ on grupofamil0_.model_id=modelo1_.id where grupofamil0_.grupoFamiliar_id=? Hibernate: select habilidade0_.model_id as model1_1_, habilidade0_.habilidad_id as habilidad2_1_, habilidad1_.id as id7_0_, habilidad1_.nombre as nombre7_0_ from modelo_habilidad habilidade0_ left outer join Habilidad habilidad1_ on habilidade0_.habilidad_id=habilidad1_.id where habilidade0_.model_id=? Hibernate: select horariosdi0_.model_id as model1_1_, horariosdi0_.franja_id as franja2_1_, franjahora1_.id as id6_0_, franjahora1_.dia as dia6_0_, franjahora1_.horaInicio as horaInicio6_0_, franjahora1_.horaFin as horaFin6_0_ from modelo_horarioDisponible horariosdi0_ left outer join FranjaHoraria franjahora1_ on horariosdi0_.franja_id=franjahora1_.id where horariosdi0_.model_id=? Hibernate: select observacio0_.model_id as model1_1_, observacio0_.observacion_id as observac2_1_, observacio1_.id as id8_0_, observacio1_.nombre as nombre8_0_ from modelo_observacion observacio0_ left outer join Observacion observacio1_ on observacio0_.observacion_id=observacio1_.id where observacio0_.model_id=? Hibernate: select restriccio0_.model_id as model1_1_, restriccio0_.restricciones_id as restricc2_1_, restriccio1_.id as id5_0_, restriccio1_.nombre as nombre5_0_ from modelo_restriccion restriccio0_ left outer join Restriccion restriccio1_ on restriccio0_.restricciones_id=restriccio1_.id where restriccio0_.model_id=?