Java Mailing List Archive

http://www.gg3721.com/

Home » Struts Users Mailing List »

user Digest 4 Aug 2008 14:33:55 -0000 Issue 8176

user-digest-help

2008-08-04


Author LoginPost Reply

user Digest 4 Aug 2008 14:33:55 -0000 Issue 8176

Topics (messages 189643 through 189667):

Re: Delete Confirmation in Struts2
 189643 by: Gabriel Belingueres

Re: paramsPrepareParams vs. staticParams
 189644 by: Andy Law
 189646 by: Gabriel Belingueres

Re: EJB Injection for Struts 2 Actions
 189645 by: Struts Two

newbie question: How can I make a Struts Project with multiple modules?
 189647 by: ryan webb
 189652 by: Antonio Petrelli
 189654 by: ryan webb
 189655 by: Antonio Petrelli

Re: Retrieve current url value
 189648 by: lei.java.gmail.com
 189650 by: Wes Wannemacher

Re: how to set classpath for servlet-api.jar, jsp-api.jar and struts.jar for Ubuntu
 189649 by: Narasimha Raju Naidu
 189661 by: Gabriel Belingueres

Re: [struts] paramsPrepareParams vs. staticParams
 189651 by: Dale Newfield
 189665 by: Gabriel Belingueres

Re: Action Execute Being called 2 times
 189653 by: aum strut
 189662 by: Gabriel Belingueres
 189664 by: aum strut

Re: Issue with Url mapping with struts-action-extension=""
 189656 by: Jeromy Evans
 189660 by: Haulyn R. Jason

separating getter and setter from action class
 189657 by: Dhiraj Thakur
 189658 by: Pawe³ Wielgus

Inconsistent HTML escaping in textfield
 189659 by: nodje

2 Validation questions
 189663 by: Gundersen, Richard

Struts2 with JSON.
 189666 by: sharath karnati

[S2] Method dependant validation
 189667 by: Andreas Mähler

Administrivia:

---------------------------------------------------------------------
To post to the list, e-mail: user@(protected)
To unsubscribe, e-mail: user-digest-unsubscribe@(protected)
For additional commands, e-mail: user-digest-help@(protected)

----------------------------------------------------------------------

Attachment: user_189643.ezm (zipped)
<s:a href="%{deleteUrl}" onclick="return confirm('Are you sure?');">
                    <s:text name="Delete" />
</s:a>

2008/8/2 hisameer <cool_sameer_for_u@(protected)>:
>
> Hi
>
> I am having a problem in getting the confirmation of a delete operation. My
> requirement is that:
> I have a list of user and I have a DELETE link for each and evey user in
> the list. I already defined a delete action mapping for the user but before
> deleting the user I want to get confirmation from the admin whether he
> wants to delete that user or not and then I want to call the delete action
> mapping my code is like that:
>
> In the userList.jsp:
>
>
> <s:url id="deleteUrl" action="deleteUser" namespace="user">
>                <s:param name="user.userID" value="userID" />
>           </s:url>
>
> <s:a href="%{deleteUrl}">
>                     <s:text name="Delete" />
> </s:a>
>
> My action Mapping is:
>
> <action name="deleteUser" class="com.support.struts.action.UserAction"
>                method="deleteUser">
>                <result>/userList.jsp</result>
>           </action>
>
>
> If you need any further info Please do let me know.
>
> Please advice me how should I handle the user confirmation. If possible
> please attach a sample code for it.
> --
> View this message in context: http://www.nabble.com/Delete-Confirmation-in-Struts2-tp18794937p18794937.html
> Sent from the Struts - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>

Attachment: user_189644.ezm (zipped)


mgainty wrote:
>
>
> Andy-
> the short answer is you don't want
> user-set parameters to override your static parameters.
>
>

Well yes - but I need the parameters for doing some prepare() work. I can
see that staticParams fires after params in the default stack. I can also
see that params is set to fire twice in the paramsPrepareParams stack and
that it fires after params. What I don't understand is why staticParams
doesn't fire twice in the struts-supplied pPP stack. Unless there is a
sensible design decision why it should not, I'm going to propose an RFE that
it should

Seems to me that the current set-up allows user-set params to overide my
static parameters if they are required in a prepare() which is just plain
wrong.


mgainty wrote:
>
> btw for 2.1.1 you also need: "actionMappingParams"
>
>
> Which means your stack should be:
>
> <interceptor-stack name="paramsPrepareParamsStack">
>
> .......
> <interceptor-ref name="params"/>
>
> <interceptor-ref name="actionMappingParams"/>
>
> <interceptor-ref name="staticParams"/>
>
> ...
>
> <interceptor-ref name="prepare"/>
>
> ...
>
> <interceptor-ref name="params"/>
>
> <interceptor-ref name="actionMappingParams"/>
>
> <interceptor-ref name="staticParams"/>
>
>
> </interceptor-stack>
>
> (courtesy of dale)
> http://www.nabble.com/about-paramsPrepareParamsStack-td15462644.html
>
> Martin
>

Thanks. This is useful info and I missed the other thread when I searched
earlier. I'm disappointed to see that I will have to refactor stuff
(struts.xml) when I shift to 2.1.x when if they were included correctly
(IMHO) in the pPP stack that gets distributed, I wouldn't need to do that.


What's the procedure for requesting enhancements?

Later,

Andy

--
Sent from the Struts - User mailing list archive at Nabble.com.


Attachment: user_189646.ezm (zipped)
From a design POV, there are differences between params and
staticParams interceptor:

AFAIK, the parameter interceptor is called twice because it serves
this design purpose: to allow your action to execute some logic which
is dependent of *some* of the current parameter values to set up the
model where will go the rest of the action parameters. So you have in
the same request, parameters that will go to the action, and other
parameters that will go to the model behind the action.

Unless you put also those two kind of static parameters in your
action, then I think staticParams should need to be executed only
once.

To request a new feature you need to open a ticket in JIRA
(https://issues.apache.org/struts)

2008/8/3 Andy Law <andy.law@(protected)>:
>
>
> mgainty wrote:
>>
>>
>> Andy-
>> the short answer is you don't want
>> user-set parameters to override your static parameters.
>>
>>
>
> Well yes - but I need the parameters for doing some prepare() work. I can
> see that staticParams fires after params in the default stack. I can also
> see that params is set to fire twice in the paramsPrepareParams stack and
> that it fires after params. What I don't understand is why staticParams
> doesn't fire twice in the struts-supplied pPP stack. Unless there is a
> sensible design decision why it should not, I'm going to propose an RFE that
> it should
>
> Seems to me that the current set-up allows user-set params to overide my
> static parameters if they are required in a prepare() which is just plain
> wrong.
>
>
> mgainty wrote:
>>
>> btw for 2.1.1 you also need: "actionMappingParams"
>>
>>
>> Which means your stack should be:
>>
>> <interceptor-stack name="paramsPrepareParamsStack">
>>
>> .......
>> <interceptor-ref name="params"/>
>>
>> <interceptor-ref name="actionMappingParams"/>
>>
>> <interceptor-ref name="staticParams"/>
>>
>> ...
>>
>> <interceptor-ref name="prepare"/>
>>
>> ...
>>
>> <interceptor-ref name="params"/>
>>
>> <interceptor-ref name="actionMappingParams"/>
>>
>> <interceptor-ref name="staticParams"/>
>>
>>
>> </interceptor-stack>
>>
>> (courtesy of dale)
>> http://www.nabble.com/about-paramsPrepareParamsStack-td15462644.html
>>
>> Martin
>>
>
> Thanks. This is useful info and I missed the other thread when I searched
> earlier. I'm disappointed to see that I will have to refactor stuff
> (struts.xml) when I shift to 2.1.x when if they were included correctly
> (IMHO) in the pPP stack that gets distributed, I wouldn't need to do that.
>
>
> What's the procedure for requesting enhancements?
>
> Later,
>
> Andy
>
> --
> View this message in context: http://www.nabble.com/paramsPrepareParams-vs.-staticParams-tp18773842p18801209.html
> Sent from the Struts - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>

Attachment: user_189645.ezm (zipped)
You can extend the default stack to inject EJB3. I am not sure if the lookups for all the servers are the same, but in my case, I have extended the default stack to inject EJB3 local lookups through an interceptor on Websphere and it is working prettry good.



----- Original Message ----
From: Alexander Bätz <baetz.paderborn@(protected)>
To: Struts Users Mailing List <user@(protected)>
Sent: Sunday, August 3, 2008 4:01:12 AM
Subject: EJB Injection for Struts 2 Actions

Hi,

i'm looking for a possibility to realize EJB injection for struts
actions. The simpler the better.
I know that there is a EJB plugin in the registry but currently (and at
least for the last 3 weeks) there is now download on the project site.

Some explanation how this is possible in struts and a working example
would be great.

Greetings,
Alex



   __________________________________________________________________
Ask a question on any topic and get answers from real people. Go to Yahoo! Answers and share what you know at http://ca.answers.yahoo.com


Attachment: user_189647.ezm (zipped)
How can I make a Struts Project with multiple modules?

--
warmest regards,
Ryan Webb - Philippines

email: webb.ryan1@(protected)

Attachment: user_189652.ezm (zipped)
Version of Struts?

2008/8/4 ryan webb <webb.ryan1@(protected)>:
> How can I make a Struts Project with multiple modules?
>
> --
> warmest regards,
> Ryan Webb - Philippines
>
> email: webb.ryan1@(protected)
>

Attachment: user_189654.ezm (zipped)
Struts Version = 1.2.9
So creating a multiple module depends on struts version?


On 8/4/08, Antonio Petrelli <antonio.petrelli@(protected):
>
> Version of Struts?
>
> 2008/8/4 ryan webb <webb.ryan1@(protected)>:
> > How can I make a Struts Project with multiple modules?
> >
> > --
> > warmest regards,
> > Ryan Webb - Philippines
> >
> > email: webb.ryan1@(protected)
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>


--
warmest regards,
Ryan Webb - Philippines

email: webb.ryan1@(protected)

Attachment: user_189655.ezm (zipped)
2008/8/4 ryan webb <webb.ryan1@(protected)>:
> Struts Version = 1.2.9
> So creating a multiple module depends on struts version?

Surely it depends on being a Struts 1 project or a Struts 2 one. In
fact I think that the concept of "module" is not used inside Struts 2,
but I wanted to be sure that you were using Struts 1.
Anyway here is the link:
http://struts.apache.org/1.2.9/userGuide/configuration.html#dd_config_modules

Ciao
Antonio

Attachment: user_189648.ezm (zipped)
Hi,

Is there a way to get current page's url in struts2?

e.g. suppose a login page's url is http://.../<context
name>/login_input.action, how to get the url in that page?

JavaScript is not allowed.

Thanks.

Attachment: user_189650.ezm (zipped)
Depending on how you want it, you can use EL like -

${request.requestURI}

or, if you are talking OGNL, try -

<s:property
value="%{#context['com.opensymphony.xwork2.dispatcher.HttpServletRequest'].requestURI}"/>

-Wes

On Sun, 2008-08-03 at 23:42 -0400, lei.java@(protected):
> Hi,
>
> Is there a way to get current page's url in struts2?
>
> e.g. suppose a login page's url is http://.../<context
> name>/login_input.action, how to get the url in that page?
>
> JavaScript is not allowed.
>
> Thanks.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>


Attachment: user_189649.ezm (zipped)
ok. sure i will. but can you send link for eclipse form. becoz i faild to
found that form link.




On Sat, Aug 2, 2008 at 11:05 PM, Gabriel Belingueres
<belingueres@(protected):

> Struts are just jar files. From Eclipse POV, it is just another User
> Library or J2EE Module Dependency.
> You may find more help in an Eclipse specific mailing list/forum.
>
> 2008/8/2 Narasimha Raju Naidu <feel2work@(protected)>:
> > thanks for your reply. i installed eclipse but inorder to strat struts
> > application what are the steps required any reference sites, please
> mention.
> > waiting for your reply.
> >
> >
> > Regrads...
> >
> >
> > On 8/2/08, Gabriel Belingueres <belingueres@(protected):
> >>
> >> Install yourself a nice looking IDE like eclipse, netbeans or from any
> >> other vendor. They handle classpaths and Tomcat configurations with a
> >> few clicks of your mouse.
> >>
> >> 2008/8/2 Narasimha Raju Naidu <feel2work@(protected)>:
> >> > hi to all,
> >> >
> >> > i am using ubuntu OS and recently i installed tomcat and starting
> >> developing
> >> > struts applications. in order to compile my own servlet classes it is
> >> > required to set classpath. i am failing to set classpath becoz i am
> new
> >> to
> >> > UBUNTU. can any one resolve my problem. waiting for you people's
> >> solution.
> >> >
> >> > Regads,
> >> >
> >> > Narasimha Raju
> >> >
> >> >
> >> > --
> >> >
> >> >
> >> >
> >> > uni...
> >> >
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: user-unsubscribe@(protected)
> >> For additional commands, e-mail: user-help@(protected)
> >>
> >>
> >
> >
> > --
>

Attachment: user_189661.ezm (zipped)
http://www.eclipse.org/newsgroups/
Honestly, if you know what it takes to develop a web application with
java, then you will find all the configuration options you need just
with the eclipse help files and some common sense.
May the force be with you.

2008/8/4 Narasimha Raju Naidu <feel2work@(protected)>:
> ok. sure i will. but can you send link for eclipse form. becoz i faild to
> found that form link.
>
>
>
>
> On Sat, Aug 2, 2008 at 11:05 PM, Gabriel Belingueres
> <belingueres@(protected):
>
>> Struts are just jar files. From Eclipse POV, it is just another User
>> Library or J2EE Module Dependency.
>> You may find more help in an Eclipse specific mailing list/forum.
>>
>> 2008/8/2 Narasimha Raju Naidu <feel2work@(protected)>:
>> > thanks for your reply. i installed eclipse but inorder to strat struts
>> > application what are the steps required any reference sites, please
>> mention.
>> > waiting for your reply.
>> >
>> >
>> > Regrads...
>> >
>> >
>> > On 8/2/08, Gabriel Belingueres <belingueres@(protected):
>> >>
>> >> Install yourself a nice looking IDE like eclipse, netbeans or from any
>> >> other vendor. They handle classpaths and Tomcat configurations with a
>> >> few clicks of your mouse.
>> >>
>> >> 2008/8/2 Narasimha Raju Naidu <feel2work@(protected)>:
>> >> > hi to all,
>> >> >
>> >> > i am using ubuntu OS and recently i installed tomcat and starting
>> >> developing
>> >> > struts applications. in order to compile my own servlet classes it is
>> >> > required to set classpath. i am failing to set classpath becoz i am
>> new
>> >> to
>> >> > UBUNTU. can any one resolve my problem. waiting for you people's
>> >> solution.
>> >> >
>> >> > Regads,
>> >> >
>> >> > Narasimha Raju
>> >> >
>> >> >
>> >> > --
>> >> >
>> >> >
>> >> >
>> >> > uni...
>> >> >
>> >>
>> >> ---------------------------------------------------------------------
>> >> To unsubscribe, e-mail: user-unsubscribe@(protected)
>> >> For additional commands, e-mail: user-help@(protected)
>> >>
>> >>
>> >
>> >
>> > --
>>
>

Attachment: user_189651.ezm (zipped)
Gabriel Belingueres wrote:
> Unless you put also those two kind of static parameters in your
> action, then I think staticParams should need to be executed only
> once.

In any place where you have staticParams and/or actionMappingParams, I
would expect the semantics of the action (and potentially the
preparation of data for the action) to depend upon those values.

A classic example of code re-use would be a single action method that
can "do it's thing" for many scenarios, and for which there are numerous
defined actions. I'll pick a message sending action for this example,
where these would be valid URLs: sendMessageToGroup.action?groupId=12,
sendMessageToUser.action?userId=2354, sendMessageToAll.action, etc.,
with each separate action definition setting some parameters so the
single action method knows what to do. Some uses of this action method
can be more sensitive than others, and have different security
constraints on the url (sendMessageToAll could be restricted to role
ADMIN, for example). If you don't always ensure that static and action
mapping parameters are not overwritten by user specified values,
sendMessageToUser.action?userId=2354&sendToAll=true could be a security
hole allowing anyone to spam the entire site.

Since setup that will effect the action execution can happen inside
prepare, it's important that both prepare and the action method both see
the correct values.

-Dale

Attachment: user_189665.ezm (zipped)
I agree that execution semantics should be preserved (in an ideal
world at least).

But, if the intention is to enforce security of some parameter values
AND preserve action semantics, then the action should not change its
behavior/semantic if we call it from the context of a different
interceptor stack. That is, an action with its parameter secured (not
overwritten by user params) should remain secured whether it runs in
the paramsPrepareParamsStack, defaultStack, or even in the basicStack
for that matter.

This would require at least 2 things:
1) The developer of the Action class should declare somewhere that
some given parameters should be secured against user parameter
overwrite.
2) Even the most basic interceptor stack must enforce the rule.
(Otherwise, document it in a bold font)

To implement 1), you could use some xml configuration or annotation.
To implement 2), may be the natural place to put this control is
inside the params interceptor. Because you need this interceptor if
the security condition may fail (otherwise, there are no user
parameters to worry about.)

2008/8/4 Dale Newfield <Dale@(protected)>:
> Gabriel Belingueres wrote:
>>
>> Unless you put also those two kind of static parameters in your
>> action, then I think staticParams should need to be executed only
>> once.
>
> In any place where you have staticParams and/or actionMappingParams, I would
> expect the semantics of the action (and potentially the preparation of data
> for the action) to depend upon those values.
>
> A classic example of code re-use would be a single action method that can
> "do it's thing" for many scenarios, and for which there are numerous defined
> actions. I'll pick a message sending action for this example, where these
> would be valid URLs: sendMessageToGroup.action?groupId=12,
> sendMessageToUser.action?userId=2354, sendMessageToAll.action, etc., with
> each separate action definition setting some parameters so the single action
> method knows what to do. Some uses of this action method can be more
> sensitive than others, and have different security constraints on the url
> (sendMessageToAll could be restricted to role ADMIN, for example). If you
> don't always ensure that static and action mapping parameters are not
> overwritten by user specified values,
> sendMessageToUser.action?userId=2354&sendToAll=true could be a security hole
> allowing anyone to spam the entire site.
>
> Since setup that will effect the action execution can happen inside prepare,
> it's important that both prepare and the action method both see the correct
> values.
>
> -Dale
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>

Attachment: user_189653.ezm (zipped)
Hi,

I tried all things and its again not working still action is getting called 2 times for each call to this Register Action i am attaching the Register.jsp,Struts.xml as well as the action class please have a look at it and point me where i am doing the mistake.


Thanks in Advance
-aum

On Fri, Aug 1, 2008 at 5:37 PM, Joachim Ansorg <jansorg@ksi.gr> wrote:
Hi,
you use the same action to render the welcome screen and Registrer.jsp.

So this means that when you display the welcome screen execute() is called and when you display the Registrer.jsp page.

Either use two separate actions or just return null in execute and have another action method (i.e. save()) which writes into the db.
In the page with the submit button link to the action's save method. So execute is used for welcome and save for the registration.

Hope that helps,
Joachim
Hi All,

While developing an application in struts2 i am facing a strange problem
with one of my action namely RegsitrationAction.
i have a jsp page for user registration where there are certain fields for
the user to be filled for the registration purpose.
i have created a UserProfile bean class with the bean properties for all the
user registration field.

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


package actionsfolder;

import com.opensymphony.xwork2.ActionSupport;

public class UserRegistrationAction extends ActionSupport{

 /**
  *
  */
 private static final long serialVersionUID = -4632666801257988218L;

 private String username=null;
 private String password=null;
 private String email=null;
 /**
  * @return the username
  */
 public String getUsername() {
   return username;
 }
 /**
  * @param username the username to set
  */
 public void setUsername(String username) {
   this.username = username;
 }
 /**
  * @return the password
  */
 public String getPassword() {
   return password;
 }
 /**
  * @param password the password to set
  */
 public void setPassword(String password) {
   this.password = password;
 }
 /**
  * @return the email
  */
 public String getEmail() {
   return email;
 }
 /**
  * @param email the email to set
  */
 public void setEmail(String email) {
   this.email = email;
 }
 
 public String execute() throws Exception{
   System.out.println("**************in Action***********");
   return SUCCESS;
 }
 
}
<!DOCTYPE struts PUBLIC
  "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
  "http://struts.apache.org/dtds/struts-2.0.dtd">
<struts>

  <package name="actionsfolder" extends="struts-default">
    <action name="Login" class="actionsfolder.LoginAuthenticationAction">
       <result name="success">/welcome/welcome.jsp</result>
       <result name="input">/index.jsp</result>
    </action>
   
    <action name="Logout" class="actionsfolder.LogoutAction">
       <result name="success">/welcome/welcome.jsp</result>
       
    </action>
    <action name="ReLogin">
   <result>/index.jsp</result>
   </action>
   
   <action name="RegisterNewUser" class="actionsfolder.UserRegistrationAction">
   <result name="success">/index.jsp</result>
   </action>
   
   <action name="Registration">
   <result>/registration/Registrer.jsp</result>
   </action>
  </package>
 
</struts>

Attachment: user_189662.ezm (zipped)
can't see the jsp file.
In the action class you are not using modeldriven as you said in the
first email.

2008/8/4 aum strut <aum.struts@(protected)>:
> Hi,
>
> I tried all things and its again not working still action is getting called
> 2 times for each call to this Register Action i am attaching the
> Register.jsp,Struts.xml as well as the action class please have a look at it
> and point me where i am doing the mistake.
>
>
> Thanks in Advance
> -aum
>
> On Fri, Aug 1, 2008 at 5:37 PM, Joachim Ansorg <jansorg@(protected):
>>
>> Hi,
>> you use the same action to render the welcome screen and Registrer.jsp.
>>
>> So this means that when you display the welcome screen execute() is called
>> and when you display the Registrer.jsp page.
>>
>> Either use two separate actions or just return null in execute and have
>> another action method (i.e. save()) which writes into the db.
>> In the page with the submit button link to the action's save method. So
>> execute is used for welcome and save for the registration.
>>
>> Hope that helps,
>> Joachim
>>>
>>> Hi All,
>>>
>>> While developing an application in struts2 i am facing a strange problem
>>> with one of my action namely RegsitrationAction.
>>> i have a jsp page for user registration where there are certain fields
>>> for
>>> the user to be filled for the registration purpose.
>>> i have created a UserProfile bean class with the bean properties for all
>>> the
>>> user registration field.
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@(protected)
>> For additional commands, e-mail: user-help@(protected)
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>

Attachment: user_189664.ezm (zipped)
i changed this approach just to cross check the functionality
i used simple java beans properties but still find the same problem i am gain attaching the jsp file.

Thanks
aum

On Mon, Aug 4, 2008 at 3:56 PM, Gabriel Belingueres <belingueres@gmail.com> wrote:
can't see the jsp file.
In the action class you are not using modeldriven as you said in the
first email.

2008/8/4 aum strut <aum.struts@gmail.com>:
> Hi,
>
> I tried all things and its again not working still action is getting called
> 2 times for each call to this Register Action i am attaching the
> Register.jsp,Struts.xml as well as the action class please have a look at it
> and point me where i am doing the mistake.
>
>
> Thanks in Advance
> -aum
>
> On Fri, Aug 1, 2008 at 5:37 PM, Joachim Ansorg <jansorg@ksi.gr> wrote:
>>
>> Hi,
>> you use the same action to render the welcome screen and Registrer.jsp.
>>
>> So this means that when you display the welcome screen execute() is called
>> and when you display the Registrer.jsp page.
>>
>> Either use two separate actions or just return null in execute and have
>> another action method (i.e. save()) which writes into the db.
>> In the page with the submit button link to the action's save method. So
>> execute is used for welcome and save for the registration.
>>
>> Hope that helps,
>> Joachim
>>>
>>> Hi All,
>>>
>>> While developing an application in struts2 i am facing a strange problem
>>> with one of my action namely RegsitrationAction.
>>> i have a jsp page for user registration where there are certain fields
>>> for
>>> the user to be filled for the registration purpose.
>>> i have created a UserProfile bean class with the bean properties for all
>>> the
>>> user registration field.
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> For additional commands, e-mail: user-help@struts.apache.org
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>

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



Attachment: user_189656.ezm (zipped)
Haulyn R. Jason wrote:
> Hi,all
> I set struts-action-extension="" for no extension as "action" or "do" by
> default for struts2, and mapping all url to struts2 dispatcher as "/*".
> But, the problem is I can not access any jsp, html,css and js files. The
> page display:there are no action mapping for XXX.jsp action.
> Should any one give me some suggestions or referenced links? Always
> thanks very much.
>
>  

I'm not sure if your setting is interpreted as blank, not set (default)
or null.

Did your jsp, html, css and js work before you made that change?

The process works like this:
1. the container sees the request and maps it to the Strust2
FilterDispatcher because it matches /*
2. the FilterDispatcher checks whether the request contains a known
action extension, and if so, invokes the ActionMapper
3. If the ActionMapper didn't find anything, the FilterDispatcher checks
if there's struts static resource for the request (if
serve.static.resource=true)
4. If nothing matched, the filter does nothing
5. If nothing has processed the request, the container eventually
invokes the Default Servlet (and JSP handling, other file handling)

So there's two possible problems:
a. the FilterDispatcher thinks it can handle everything and tries to,
causing an error; or
b. there is a configuration problem with the container (eg. the default
servlet is disabled or the request never reached the container).

In case it is a, I would try the following settings:

struts.action.extension=,,action

Note the double comma. That means a blank (no extension), or .action
extension. The double-comma ensures blank isn't trimmed as whitespace.

Hope that helps,
Jeromy Evans



Attachment: user_189660.ezm (zipped)
Jeromy Evans 写道:
> Haulyn R. Jason wrote:
>  
>> Hi,all
>> I set struts-action-extension="" for no extension as "action" or "do" by
>> default for struts2, and mapping all url to struts2 dispatcher as "/*".
>> But, the problem is I can not access any jsp, html,css and js files. The
>> page display:there are no action mapping for XXX.jsp action.
>> Should any one give me some suggestions or referenced links? Always
>> thanks very much.
>>
>>  
>>  
>
> I'm not sure if your setting is interpreted as blank, not set (default)
> or null.
>
> Did your jsp, html, css and js work before you made that change?
>
> The process works like this:
> 1. the container sees the request and maps it to the Strust2
> FilterDispatcher because it matches /*
> 2. the FilterDispatcher checks whether the request contains a known
> action extension, and if so, invokes the ActionMapper
> 3. If the ActionMapper didn't find anything, the FilterDispatcher checks
> if there's struts static resource for the request (if
> serve.static.resource=true)
> 4. If nothing matched, the filter does nothing
> 5. If nothing has processed the request, the container eventually
> invokes the Default Servlet (and JSP handling, other file handling)
>
> So there's two possible problems:
> a. the FilterDispatcher thinks it can handle everything and tries to,
> causing an error; or
> b. there is a configuration problem with the container (eg. the default
> servlet is disabled or the request never reached the container).
>
> In case it is a, I would try the following settings:
>
> struts.action.extension=,,action
>
> Note the double comma. That means a blank (no extension), or .action
> extension. The double-comma ensures blank isn't trimmed as whitespace.
>
> Hope that helps,
> Jeromy Evans
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>
>  
Hi, Evans

Thanks for your answer, it looks very useful but some new problem occurred:

When I set

"struts.action.extension="

value as "" with no space or " "(same as before with one whitespace)

Struts treat all html, js, css and jsp as action, but all real actions work well.

Without struts 2 FilterDispatcher, everything works well.(Certainly real action can not work)

Then I tried your solution as:
struts.action.extension=,,action

but modified as
struts.action.extension=,,jsps

ok, this time, when I visit http://localhost:8080/8f/myAction.jsps, everything works well,but I can not access to
http://localhost:8080/8f/myAction without any extension.

And something interesting occurred: I can access "http://localhost:8080/8f/myAction." and everything works well.
I mean, I can not visit myAction with no extension but I can visit myAction "with extension":".", just a "."

I am not sure what's wrong with my configuration. And I use struts2.0.11.1.





--

Thanks!

Mobile: +086-15864011231
EMail&gtalk:saharabear@(protected)
EMail&yahoo:jia_haolin@(protected)
Skype:saharabear


Haulyn Runner Jason


Attachment: user_189657.ezm (zipped)
Hi there,
is it possible to separate getter and setter from ActionClass ?
so that my action class will only contain logic related to action and BO
class with all the getter and setter.

Regards,
Dhiraj

Attachment: user_189658.ezm (zipped)
Hi,
try to add getMyBussinessObject() in ActionClass and on Your jsp
<s:property value="myBussinessObject.someBussinesProperty"/>. Still,
You need myBussinessObject field in ActionClass.

Best greetings,
Paweł Wielgus.

On 04/08/2008, Dhiraj Thakur <desi.tek.org@(protected):
> Hi there,
> is it possible to separate getter and setter from ActionClass ?
> so that my action class will only contain logic related to action and BO
> class with all the getter and setter.
>
> Regards,
>
> Dhiraj
>

Attachment: user_189659.ezm (zipped)

I'm using struts2.0.11.1 with Velocity.

In my #stextfield tags I'm trying to use &eacute; in the label and the
tooltip.
It gets transformed in &amp;eacute; in the resulting web page. If I use the
original é it doesn't work either and display an inconsistent character, and
this with UTF-8 encoding as well as iso-8859-1.

Besides I'm having big formating problem using "labelposition=left" for a
serie of input items.
They are too close to each others and the resulting input boxes height is
too small. It seems there's no hook to modify class="wwgrp". My solution is
to add <br> in between #stextfield tags, but Id ont' think it's so nice.
Did anyone faced and solved that issue?

cheers
--
Sent from the Struts - User mailing list archive at Nabble.com.


Attachment: user_189663.ezm (zipped)
Hi

Basic question sorry (looked all over but can't find the answer)

1) When validation fails for my 'username' textfield, the error message
is displayed ABOVE the text box.

Is it possible to have more fine-grained control over how to position
the error message. Ideally I would like it below (and in line with) the
text box.

2) If I enter an invalid value twice, the original message is still
there, so I have two 'username is invalid' messages on the screen now. I
know this is done by the javascript so I want to know the recommended
way of overriding this behaviour.

Thanks

-Richard

As a responsible corporate citizen, London Scottish Bank plc asks you to consider the environment before printing this email.

*** Disclaimer ***

This electronic communication is confidential and for the exclusive use of the addressee. It may contain private and confidential information. The information, attachments and opinions contained in this E-mail are those of its author only and do not necessarily represent those of London Scottish Bank PLC or any other members of the London Scottish Group.

If you are not the intended addressee, you are prohibited from any disclosure, distribution or further copying or use of this communication or the information in it or taking any action in reliance on it. If you have received this communication in error please notify the Information Security Manager at ISM@(protected).

We utilise virus scanning software but we cannot guarantee the security of electronic communications and you are advised to check any attachments for viruses. We do not accept liability for any loss resulting from any corruption or alteration of data or importation of any virus as a result of receiving this electronic communication.

Replies to this E-mail may be monitored for operational or business reasons. London Scottish Bank PLC is regulated by the Financial Services Authority.


London Scottish Bank plc, Registered Office: 201 Deansgate, Manchester M3 3NW Registered Number 973008 England.

Subsidiary Companies:-

London Scottish Finance Limited, Registered Office: 201 Deansgate, Manchester M3 3NW Registered Number 233259 England.

London Scottish Broking Limited, Registered Office: 201 Deansgate, Manchester M3 3NW Registered Number 230110 England.

London Scottish Invoice Finance Limited, Registered Office: 201 Deansgate, Manchester M3 3NW Registered Number 2643766 England.

Robinson Way & Company Limited, Registered Office: 201 Deansgate, Manchester M3 3NW Registered Number 885896 England.

______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.

Attachment: user_189666.ezm (zipped)
Hi All,
 
   Using JSON, I'm getting below response from action
 
     {"list":{"com.beans.ComplaintDO":{"user__complaint__number":"08-C00000153","user__complaint__key":"08-C00000153-1","form__type":"2000B","first__name":"Sharath","last__name":"Karnati"}}}
 
   In this response, 'com.beans.ComplaintDO' is a javabean. 'list' is a java arraylist and it may contain multiple 'com.beans.ComplaintDO' javabeans.
 
  I'd like to know how to read this response in java script, I tried below way but getting java script error(jsonObject has no properties)
  
function onReadyState()
{
   alert('In onReadyState');
   var ready=req.readyState;
   var jsonObject=null;

   if ( ready == READY_STATE_COMPLETE )
  {
     jsonObject=eval( req.responseText );   
     var searchresults = jsonObject.ComplaintDO.entry;   
     alert('In searchresults:'+searchresults.length);
   }
}
 
   Please let me know how to read these values from json object.
 
Thanks,
Sharath.
 
 
        



Attachment: user_189667.ezm (zipped)
Hello everyone,

maybe this question has been asked before, but I couldn't find any
postings on the topic:

How can I validate my input in dependency of the action method (without
XML)?

I know that method dependant processing is possible with the
PrepareInterceptor (i.e. prepareDoThis, prepareDoThat methods that are
automatically invoked). I checked the Struts2.1.2 docs[1], but it seems
that the ValidationInterceptor does not offer this feature. I also can't
find a way to make annotation based validation method dependant, which
would also be very useful. (Think of a 'method' parameter that is a
comma-seperated list of methods for which the validation applies -
default is all).

As I thought that this is mainly a WebWork issue, I found this
thread[2]. Someone is saying that it (at least the part with the
source-based validation) is implemented in WebWork2.2, but it seems that
S2 is still using 2.1 - will this change in the near future?

CU
~Andreas


[1] http://struts.apache.org/2.1.2/docs/validation-interceptor.html
[2] http://forums.opensymphony.com/thread.jspa?messageID=28352&#28352

©2008 gg3721.com - Jax Systems, LLC, U.S.A.