Accessing User input in execute ( ) method

2010-09-27 Thread hareendra seneviratne
Hi all, I’m new to struts and getting to know it. Is it mandatory to have an ActionForm? Can we access the variables defined in *view* from *execute()* method without using an ActionForm? Thnks for ur replies J

Re: Accessing User input in execute ( ) method

2010-09-27 Thread Dave Newton
You could get it directly from the request... but why would you want to? That would defeat one of the purposes of having Struts, wouldn't it? Dave On Mon, Sep 27, 2010 at 7:24 AM, hareendra seneviratne hareend...@gmail.com wrote: Hi all, I’m new to struts and getting to know it. Is it

Re: Accessing User input in execute ( ) method

2010-09-27 Thread Kushan Jayathilake
Hi, There is a new interface called *ActionSupport *in struts 2 you can it from that, you just need to put *s:form action=summary id=main_form name=main_form * in JSP. remember to map the action with the struts.xml. thats all you need ie: *action name=summary

Re: Accessing User input in execute ( ) method

2010-09-27 Thread Li Ying
Hi hareendra : You don't need an ActionForm to capture the variables sent by client request. What you used to defined in ActionForm class, is now should be defined in Action class. You can read more detail information in http://struts.apache.org/2.2.1/docs/comparing-struts-1-and-2.html

Re: Accessing User input in execute ( ) method

2010-09-27 Thread Dave Newton
We're all making an assumption the OP is talking about Struts 2; I made an assumption the opposite way. Let's just ask--Hareendra, what version of Struts are you asking about? Dave On Mon, Sep 27, 2010 at 8:45 AM, Li Ying liying.cn.2...@gmail.com wrote: Hi hareendra : You don't need an

Re: Accessing User input in execute ( ) method

2010-09-27 Thread Kushan Jayathilake
yeah lol... -- Regards Kushan Jayathilake On Mon, Sep 27, 2010 at 6:21 PM, Dave Newton davelnew...@gmail.com wrote: We're all making an assumption the OP is talking about Struts 2; I made an assumption the opposite way. Let's just ask--Hareendra, what version of Struts are you asking

Re: S2 overriding a Localization property

2010-09-27 Thread Greg Lindholm
Martin, does your reply have anything to do with Struts 2 or my question or this thread? On Fri, Sep 24, 2010 at 8:41 PM, Martin Gainty mgai...@hotmail.com wrote: from the maven perspective package level localisation at the package (groupId) level is the easiest implementation introducing

Re: S2 overriding a Localization property

2010-09-27 Thread Oscar
Hi to all, i have a doubt about Struts 2 encoding mechanism. I have a form with a textbox and i write special characters inside it, like this: hoá ñ When i submit and i print this value using a s:property i get this value: hoá ñ Why this happens? It has something to do with Struts 2 encoding

Problem with S2 form parameters encode

2010-09-27 Thread Oscar
Hi to all, i have a doubt about Struts 2 encoding mechanism. I have a form with a textbox and i write special characters inside it, like this: hoá ñ When i submit and i print this value using a s:property i get this value: hoá ñ Why this happens? It has something to do with Struts 2 encoding

Re: Problem with S2 form parameters encode

2010-09-27 Thread Maurizio Cucchiara
Hi Oscar, 2010/9/27 Oscar oscar.kalde...@gmail.com Exist a way to tell struts 2 how to encode those characters? There is a simple way: put this line on top of you jsp file: %@ page contentType=text/html; charset=UTF-8 % Hope this help Maurizio Cucchiara

Re: Problem with S2 form parameters encode

2010-09-27 Thread Oscar
Thanks Maurizio, but that's not the problem, because i have already this header that is the same as yours: %...@page contentType=text/html pageEncoding=UTF-8% But i tried using your header and i get the same result. Regards. 2010/9/27 Maurizio Cucchiara maurizio.cucchi...@gmail.com Hi Oscar,

Re: Problem with S2 form parameters encode

2010-09-27 Thread Maurizio Cucchiara
Struts 2 version? Which encoding do you see if you press CTRL+i on firefox? 2010/9/27 Oscar oscar.kalde...@gmail.com Thanks Maurizio, but that's not the problem, because i have already this header that is the same as yours: %...@page contentType=text/html pageEncoding=UTF-8% But i tried

Re: Problem with S2 form parameters encode

2010-09-27 Thread Oscar
Unicode (UTF-8) Regards. 2010/9/27 Maurizio Cucchiara maurizio.cucchi...@gmail.com Struts 2 version? Which encoding do you see if you press CTRL+i on firefox? 2010/9/27 Oscar oscar.kalde...@gmail.com Thanks Maurizio, but that's not the problem, because i have already this header that

Re: Problem with S2 form parameters encode

2010-09-27 Thread Maurizio Cucchiara
Which struts version are you using? Which application server? is it running on linux or windows? Did you try to insert meta tag inside head section? meta http-equiv=Content-Type content=text/html; charset=UTF-8 / Maurizio Cucchiara

Re: Problem with S2 form parameters encode

2010-09-27 Thread Oscar
I'm using Struts 2.1.8 under Glassfish v3 on Windows 7. I tried the metatag but stills the same. Regards. 2010/9/27 Maurizio Cucchiara maurizio.cucchi...@gmail.com Which struts version are you using? Which application server? is it running on linux or windows? Did you try to insert meta tag

Re: Problem with S2 form parameters encode

2010-09-27 Thread Maurizio Cucchiara
You can also try to add pageEncoding inside page directive: %@ page pageEncoding=UTF-8 contentType=text/html; *charset*=UTF-8 % 2010/9/27 Maurizio Cucchiara maurizio.cucchi...@gmail.com Which struts version are you using? Which application server? is it running on linux or windows? Did you

Re: Problem with S2 form parameters encode

2010-09-27 Thread Oscar
I gonna try that. Also, right now i tried using a different charset: %@ page contentType=text/html; charset=ISO-8859-1 % and it works! 2010/9/27 Maurizio Cucchiara maurizio.cucchi...@gmail.com You can also try to add pageEncoding inside page directive: %@ page pageEncoding=UTF-8

RE: How to structure a struts2 application

2010-09-27 Thread Maurizio Cucchiara
Hi Darren, However im not sure if this is the best way of doing things because all of the user actions would share the same validate method, and each different type of action would need different validation. I was thinking of maybe putting a switch in the validate method to do different

struts.xml parsing error, involving interceptor

2010-09-27 Thread Ken
This has been driving me nuts... The following works in my code (typed by hand not copied from source): struts !-- If I add the missing content (found below) HERE, then this does NOT work -- package namespace=/secure name=secure extends=struts-default result-types

Re: struts.xml parsing error, involving interceptor

2010-09-27 Thread Dave Newton
Well, no, you need to follow the DTD. Dave On Mon, Sep 27, 2010 at 7:52 PM, Ken ken.mcwilli...@aerose.com wrote: This has been driving me nuts... The following works in my code (typed by hand not copied from source): struts !-- If I add the missing content (found below) HERE, then this

Re: Accessing User input in execute ( ) method

2010-09-27 Thread hareendra seneviratne
Guys, Thnks for all replies. I'm using struts 1.2.9. I could use request.getParameter() to get the user input. :) Can you plc advice me on what should be done and what should not be done in execute() method. According to my understanding struts-config is like a router to route the requests.

Re: struts.xml parsing error, involving interceptor

2010-09-27 Thread Li Ying
Hi Ken: In the DTD file, it is defined: !ELEMENT package (result-types?, interceptors?, default-interceptor-ref?, default-action-ref?, default-class-ref?, global-results?, global-exception-mappings?, action*) That means, you should add the definition of interceptor as children nodes of the