Re: How to structure a struts2 application

2010-09-28 Thread Darren Karstens
Thanks for the responses. The validation interceptor seems to be
exactly what I was looking for.
Regards
Darren

> You don't need multiple classes. The validate interceptor, as the prepare
> one, is very flexible in this sense. You can define multiple validate
> methods inside a single action class. Particularly, you could define a
> validate (prepare) method  for every entry point (for instance: update,
> delete, etc.).  You must only follow the convention: use updateValidate for
> validate method update, deleteValidate from delete entry point, and so on.
> Remember that validate/prepare method is always invoked (so you can put here
> common validation rule).
> Furthermore, you can encapsulate validation logic inside an xml file, alway
> following the conventions:
> --validation.xml
>
>
> Maurizio Cucchiara

-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



RE: Accessing User input in execute ( ) method

2010-09-28 Thread adam pinder

 

if you're new to struts why don't you use struts2 its far better and less 
intrusive code wise.

 


 
> Date: Tue, 28 Sep 2010 09:03:51 +0530
> Subject: Re: Accessing User input in execute ( ) method
> From: hareend...@gmail.com
> To: user@struts.apache.org
> 
> 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  is like a
> router to route the requests. (Plc correct if I'm wrong) For each action the
> execute() method is acting like a controller. Am I correct? If not can u
> guys plc explain the Model View and the Controller in struts.
> Thanks
> 
> PS: I'm new to struts and hope u guys don't mind me asking basic things :)
> 
> 
> 
> On Mon, Sep 27, 2010 at 6:27 PM, Kushan Jayathilake wrote:
> 
> > yeah lol...
> >
> > --
> > Regards
> > Kushan Jayathilake
> >
> >
> > On Mon, Sep 27, 2010 at 6:21 PM, Dave Newton 
> > 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 about?
> > >
> > > Dave
> > >
> > > On Mon, Sep 27, 2010 at 8:45 AM, Li Ying 
> > wrote:
> > >
> > > > 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
> > > > (section [Harvesting Input])
> > > > about this issue.
> > > >
> > > > Hope this help you.
> > > >
> > > >
> > > > 2010/9/27 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: Problem with S2 form parameters encode

2010-09-28 Thread Josep García
I suggest you fix the Java encoding, -encoding, with JAVA_OPTS
Josep

2010/9/27 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 
>
> > 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 
> >
> > > 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?
> > >
> > >  
> > >
> > > Maurizio Cucchiara
> > >
> >
>
>
>
> --
> Oscar Calderón
> SCJP 6  
>


JAX-RS or REST plugin

2010-09-28 Thread Frans Thamura
hi all

anyone work with REST, we now work hard to migrate all our projects to
REST plugins, and we successfully make all the old execute() style
become REST,

u can get the code in our trunk at www.ugforge.net/gf/projects/cimande

this is the SVN

http://ugforge.net/gf/project/cimande/scmsvn/?action=browse&path=/trunk/

but we know there is JAX-RS, a Java API for Building RESTfull Apps

any idea about the direction, so we wont lost in the roadmap

thx

Frans
Indonesia

-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Re: Accessing User input in execute ( ) method

2010-09-28 Thread serge nana
Hareendra,

You don't need to have an ActionForm in order to invoke an Action class. An
ActionForm is a data transfer object (DTO) that allows you to transfer data
from the view to the controller( in this case your action). So, if you want
to use struts and you have a form to send to the server, i recommend you to
use ActionForm.

In the big picture though, an Action class is a Servlet sub-class. Just like
you can retrieve variables from the request object inside a do method,
so you can do the same inside the *execute()* method by calling
request.getParameter("param_name").

Hope this helps.

"Don't rely on luck to find a bug."


On Mon, Sep 27, 2010 at 5:24 AM, hareendra seneviratne  wrote:

> 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: JAX-RS or REST plugin

2010-09-28 Thread Amol Ghotankar
Not able to work with the link.

Any problems with server or link???

On Wed, Sep 29, 2010 at 1:38 AM, Frans Thamura  wrote:

> hi all
>
> anyone work with REST, we now work hard to migrate all our projects to
> REST plugins, and we successfully make all the old execute() style
> become REST,
>
> u can get the code in our trunk at www.ugforge.net/gf/projects/cimande
>
> this is the SVN
>
> http://ugforge.net/gf/project/cimande/scmsvn/?action=browse&path=/trunk/
>
> but we know there is JAX-RS, a Java API for Building RESTfull Apps
>
> any idea about the direction, so we wont lost in the roadmap
>
> thx
>
> Frans
> Indonesia
>
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>
>


-- 


With Best Regards,

Amol Ghotankar


Re: JAX-RS or REST plugin

2010-09-28 Thread Frans Thamura
Fixed after restart the svn


/m/

-Original Message-
From: Amol Ghotankar 
Date: Wed, 29 Sep 2010 10:52:26 
To: Struts Users Mailing List
Reply-To: "Struts Users Mailing List" 
Subject: Re: JAX-RS or REST plugin

Not able to work with the link.

Any problems with server or link???

On Wed, Sep 29, 2010 at 1:38 AM, Frans Thamura  wrote:

> hi all
>
> anyone work with REST, we now work hard to migrate all our projects to
> REST plugins, and we successfully make all the old execute() style
> become REST,
>
> u can get the code in our trunk at www.ugforge.net/gf/projects/cimande
>
> this is the SVN
>
> http://ugforge.net/gf/project/cimande/scmsvn/?action=browse&path=/trunk/
>
> but we know there is JAX-RS, a Java API for Building RESTfull Apps
>
> any idea about the direction, so we wont lost in the roadmap
>
> thx
>
> Frans
> Indonesia
>
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>
>


-- 


With Best Regards,

Amol Ghotankar