EJB Injection for Struts 2 Actions

2008-08-03 Thread Alexander Bätz

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

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: EJB Injection for Struts 2 Actions

2008-08-03 Thread Marc Ende

Hi,

I've followed this article and it works great for me.

http://blogs.cuetech.eu/roller/psartini/entry/in_struts2_auf_ejb3_session

Marc

� schrieb:
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.








signature.asc
Description: OpenPGP digital signature


RE: paramsPrepareParams vs. staticParams

2008-08-03 Thread Martin Gainty

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


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 
__ 
Disclaimer and confidentiality note 
Everything in this e-mail and any attachments relates to the official business 
of Sender. This transmission is of a confidential nature and Sender does not 
endorse distribution to any party other than intended recipient. Sender does 
not necessarily endorse content contained within this transmission. 


 Date: Fri, 1 Aug 2008 05:59:57 -0700
 From: [EMAIL PROTECTED]
 To: user@struts.apache.org
 Subject: paramsPrepareParams vs. staticParams
 
 
 Is there any design reason why staticParams is not called before prepare in
 the paramsPrepareParams stack?
 
 Also, in a potential RFE sort of vein, would there be any support for a
 request for a way of making staticParams non-overwritable? (i.e. the params
 defined in the action configuration XML and specified as non-mutable would
 not be overwritten by clever folk sticking
 '?paramname=valueparam2name=value2' at the end of any given URL)
 
 Later,
 
 Andy
 -- 
 View this message in context: 
 http://www.nabble.com/paramsPrepareParams-vs.-staticParams-tp18773842p18773842.html
 Sent from the Struts - User mailing list archive at Nabble.com.
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 

_
Got Game? Win Prizes in the Windows Live Hotmail Mobile Summer Games Trivia 
Contest
http://www.gowindowslive.com/summergames?ocid=TXT_TAGHM

Re: paramsPrepareParams vs. staticParams

2008-08-03 Thread Musachy Barroso
You can configure the params interceptor to ignore some parameters,
passing regular expressions to the excludeParams attribute.

http://struts.apache.org/2.x/docs/parameters-interceptor.html

musachy
On Fri, Aug 1, 2008 at 12:53 PM, Gabriel Belingueres
[EMAIL PROTECTED] wrote:
 staticParams provide some sort of default parameter injection when you
 declare an action in your struts.xml, but it should be ok to override
 this value if it came as a parameter. If the interceptor order would
 be the opposite, then static parameters would take precedence over
 regular parameters.

 As you said, actions are POJOs and its properties can be used with
 many design intentions:
 1) hold URL parameters
 2) hold static initialization parameters
 3) Hold action result objects (but you want to write a setter too to
 perform some repetitive logic)
 4) hold injected objects (think S2 beans or Spring's)

 From the security perspective, for the 4) case is not much I think
 (because probably the ParameterInterceptor will throw an exception
 when type conversion fails).
 To differentiate between the 1) and both 2) and 3), it could be an
 improvement if with some annotation you could tag a parameter as
 static only and then the ParameterInterceptor will not try to set
 any value there (or throw an exception).

 2008/8/1 Andy Law [EMAIL PROTECTED]:

 Is there any design reason why staticParams is not called before prepare in
 the paramsPrepareParams stack?

 Also, in a potential RFE sort of vein, would there be any support for a
 request for a way of making staticParams non-overwritable? (i.e. the params
 defined in the action configuration XML and specified as non-mutable would
 not be overwritten by clever folk sticking
 '?paramname=valueparam2name=value2' at the end of any given URL)

 Later,

 Andy
 --
 View this message in context: 
 http://www.nabble.com/paramsPrepareParams-vs.-staticParams-tp18773842p18773842.html
 Sent from the Struts - User mailing list archive at Nabble.com.


 -
 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]





-- 
Hey you! Would you help me to carry the stone? Pink Floyd

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Delete Confirmation in Struts2

2008-08-03 Thread Gabriel Belingueres
s:a href=%{deleteUrl} onclick=return confirm('Are you sure?');
   s:text name=Delete /
/s:a

2008/8/2 hisameer [EMAIL 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: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: paramsPrepareParams vs. staticParams

2008-08-03 Thread Andy Law


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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: EJB Injection for Struts 2 Actions

2008-08-03 Thread Struts Two
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 [EMAIL PROTECTED]
To: Struts Users Mailing List user@struts.apache.org
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


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



newbie question: How can I make a Struts Project with multiple modules?

2008-08-03 Thread ryan webb
How can I make a Struts Project with multiple modules?

-- 
warmest regards,
Ryan Webb - Philippines

email: [EMAIL PROTECTED]


s2: Retrieve current url value

2008-08-03 Thread [EMAIL 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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: how to set classpath for servlet-api.jar, jsp-api.jar and struts.jar for Ubuntu

2008-08-03 Thread Narasimha Raju Naidu
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
[EMAIL PROTECTED]wrote:

 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 [EMAIL 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 [EMAIL PROTECTED] wrote:
 
  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 [EMAIL 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: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 
 
  --



Re: s2: Retrieve current url value

2008-08-03 Thread Wes Wannemacher
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, [EMAIL PROTECTED] wrote:
 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: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [struts] paramsPrepareParams vs. staticParams

2008-08-03 Thread Dale Newfield

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=2354sendToAll=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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]