Re: Migration from S2.0.x to S2.1.x

2007-11-14 Thread Antonio Petrelli
2007/11/14, Giovanni Azua [EMAIL PROTECTED]:

 hi,

 I have been collecting a few points required for migrating from S2.0.x
 to S2.1.x and I would like to bookkeep this info somewhere. Of course,
 if we do it in Wiki  it will benefit others too ... where exactly could
 we enter this?



Thanks a lot Giovanni!
First of all I suggest to read this FAQ:
http://struts.apache.org/helping.html#documentation

Possibly the best place to put it is under this page:
http://cwiki.apache.org/confluence/display/WW/Migration+Guide

Ciao
Antonio


Migration from S2.0.x to S2.1.x

2007-11-14 Thread Giovanni Azua

hi,

I have been collecting a few points required for migrating from S2.0.x 
to S2.1.x and I would like to bookkeep this info somewhere. Of course, 
if we do it in Wiki  it will benefit others too ... where exactly could 
we enter this?


best regards,
Giovanni

Jeromy Evans wrote:
There's no migration guide from 2.0.x to 2.1.x.  I agree one will be 
needed because you can't simply change jars over, but I don't think 
users should be switching over on-mass anyway yet.


If you want to start writing a transition guide from your experiences 
on the wiki I'll happily contribute a few pointers.




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



S2.1.1 sx:datetimepicker seem to ignore displayFormat on submit

2007-11-14 Thread Giovanni Azua

hi,

In version 2.0.9 I had a datetimepicker with custom user-defined 
conversion that worked fine. After migrating
to S 2.1.1 my conversion class on submit receives the beginDate in the 
wrong format, instead of the expected

.MM.dd I get something like dd-MM-Ttime part.

Seems like a defect new to 2.1.1 or?

Thanks in advance,
Best regards,
Giovanni

** formSimulationRun.jsp *

%@ page contentType=text/html; charset=UTF-8%
%@ taglib prefix=s uri=/struts-tags%
%@ taglib prefix=sx uri=/struts-dojo-tags %

s:form action=SimulationRun.action method=post theme=%{currentTheme}
sx:datetimepicker label=Begin Date name=beginDate 
displayFormat=.MM.dd toggleType=fade

 toggleDuration=500 /
...
s:submit value=Simulate align=center/
/s:form

*** SimulationRunAction-conversion.properties 
***


beginDate=com.sag.optimizer.ui.web.support.StringToDateConverter
endDate=com.sag.optimizer.ui.web.support.StringToDateConverter

*** StringToDateConverter.java 



/**
* Custom conversion used by e.g. Simulation input form.
*
* @author a href=mailto:[EMAIL PROTECTED]Giovanni Azua/a
* @version $ $Date: Oct 3, 2007 1:27:13 PM $
*/
public
class StringToDateConverter
extends StrutsTypeConverter
{
   
//

   // public
   
//

   @Override
   public Object
   convertFromString(Map aMap, String[] anArguments, Class aClass)
   {
   if (anArguments.length != 1)
   {
   super.performFallbackConversion(aMap, anArguments, aClass);
   }
   Integer myDate = 
Integer.valueOf(anArguments[0].replaceAll(\\., ));
  
   return myDate;

   }

   
//

   /**
* @throws UnsupportedOperationException Not yet implemented.
*/
   @Override
   public String
   convertToString(Map aMap, Object anArgument)
   {
   throws UnsupportedOperationException(Not yet implemented.);
   }
}


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



multi part request.

2007-11-14 Thread Sivaswamynatha K
Hello,

 

In my struts 1.2.9 application, I have a requirement to attach a file.
So in my jsp page I use enctype=multipart/form-data. Its working fine
and file gets attached. It's a tabbed page and when I click another tab,
I want to keep track the tab index. (I have tab index as hidden field).
So when I use request.getParameter(tabIndex), I got null value. How to
overcome this?

 

Regards,

K.Siva

 



S2: autocompleter + action

2007-11-14 Thread Stefano Greco

Hi,
I have a problem.
I'm trying to use autocompleter reading list
from an action using the attribute href.

As the example in the showcase i make this:

File struts.xml like:

struts
   package name=default extends=struts-default
   ...
   ...
   ...
   action name=sampleAJAX
   result/sampleAJAX.jsp/result
   /action

   action name=JSONList
   result/ajax/JSONList.js/result
   /action

   /package

/struts



The file JSONList.js has taken from showcase app example
and it is put in the directory ajax in the web content root.


The file sampleAJAX.jsp is:

!DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN 
http://www.w3.org/TR/html4/loose.dtd;

%@ page contentType=text/html;charset=windows-1252%
%@ taglib uri=/struts-tags prefix=s%
html
 head
   meta http-equiv=Content-Type content=text/html; 
charset=windows-1252/

   titlesampleAJAX/title
   s:head theme=ajax/
 /head
 body

   s:form action=doSearch
   s:url id=jsonList value=/JSONList.action/
   s:autocompleter href=%{jsonList} cssStyle=width: 200px; 
autoComplete=true/

   /s:form

 /body
/html


Now running but the list in autocompleter doesn't appear.

Why? What's my mistake?


Thank you in advance
Stefano


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



Re: [struts] [S2] Recursive s:iterate

2007-11-14 Thread Dave Newton
I did something similar with tiles that included
themselves; I suppose regular old includes would work
as well.

d.

--- Chris Pratt [EMAIL PROTECTED] wrote:

 On Nov 13, 2007 10:51 PM, Dale Newfield
 [EMAIL PROTECTED] wrote:
 
  Chris Pratt wrote:
   I have an folder hierarchy that I'm trying to
 display on a web page,
   but I can't figure out how to get s:iterate
 (or c:forEach) to work
   with a structure of unknown depth.  Does anyone
 know of a technique
   that would allow this?
 
  Create a .tag file that (conditionally) calls
 itself?
 
 
 Great idea, and it's an excuse to try my first .tag
 file as well.
 Thanks for the idea.
   (*Chris*)
 

-
 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: S2.1.1 sx:datetimepicker seem to ignore displayFormat on submit

2007-11-14 Thread Musachy Barroso
Actually it was wrong in 2.0.x, on 2.1 the date will always be
submitted as RFC 3339, if you define your field as a Date, or a
Calendar object you won't have to do any conversion at all.

musachy

On Nov 14, 2007 5:24 AM, Giovanni Azua [EMAIL PROTECTED] wrote:
 hi,

 In version 2.0.9 I had a datetimepicker with custom user-defined
 conversion that worked fine. After migrating
 to S 2.1.1 my conversion class on submit receives the beginDate in the
 wrong format, instead of the expected
 .MM.dd I get something like dd-MM-Ttime part.

 Seems like a defect new to 2.1.1 or?

 Thanks in advance,
 Best regards,
 Giovanni

 ** formSimulationRun.jsp *

 %@ page contentType=text/html; charset=UTF-8%
 %@ taglib prefix=s uri=/struts-tags%
 %@ taglib prefix=sx uri=/struts-dojo-tags %

 s:form action=SimulationRun.action method=post theme=%{currentTheme}
 sx:datetimepicker label=Begin Date name=beginDate
 displayFormat=.MM.dd toggleType=fade
   toggleDuration=500 /
 ...
 s:submit value=Simulate align=center/
 /s:form

 *** SimulationRunAction-conversion.properties
 ***

 beginDate=com.sag.optimizer.ui.web.support.StringToDateConverter
 endDate=com.sag.optimizer.ui.web.support.StringToDateConverter

 *** StringToDateConverter.java
 

 /**
  * Custom conversion used by e.g. Simulation input form.
  *
  * @author a href=mailto:[EMAIL PROTECTED]Giovanni Azua/a
  * @version $ $Date: Oct 3, 2007 1:27:13 PM $
  */
 public
 class StringToDateConverter
 extends StrutsTypeConverter
 {

 //
 // public

 //
 @Override
 public Object
 convertFromString(Map aMap, String[] anArguments, Class aClass)
 {
 if (anArguments.length != 1)
 {
 super.performFallbackConversion(aMap, anArguments, aClass);
 }
 Integer myDate =
 Integer.valueOf(anArguments[0].replaceAll(\\., ));

 return myDate;
 }


 //
 /**
  * @throws UnsupportedOperationException Not yet implemented.
  */
 @Override
 public String
 convertToString(Map aMap, Object anArgument)
 {
 throws UnsupportedOperationException(Not yet implemented.);
 }
 }


 -
 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: How to preselect a radio button in Struts 2

2007-11-14 Thread Randy Burgess
Use the value attribute and the radio button with that value will be
selected.

s:radio name=r1 value=some ognl value list=some ognl list/map/

Regards,
Randy Burgess
Web Applications Developer
Nuvox Communications



 From: Pankaj Gupta [EMAIL PROTECTED]
 Reply-To: Struts Users Mailing List user@struts.apache.org
 Date: Wed, 14 Nov 2007 10:42:20 +0530
 To: user@struts.apache.org
 Subject: How to preselect a radio button in Struts 2
 
 Hi,
 I am working on Struts 2 and I want to preselect  a radio button.
 If somebody can let me know how to go about it.
 Regards,
 Pankaj



This email and any attachments (Message) may contain legally privileged 
and/or confidential information.  If you are not the addressee, or if this 
Message has been addressed to you in error, you are not authorized to read, 
copy, or distribute it, and we ask that you please delete it (including all 
copies) and notify the sender by return email.  Delivery of this Message to any 
person other than the intended recipient(s) shall not be deemed a waiver of 
confidentiality and/or a privilege.

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



Re: S2.1.1 sx:datetimepicker seem to ignore displayFormat on submit

2007-11-14 Thread Giovanni Azua

hi,

Ok good to know! thanks!

We need a special integer-based format and not Date but this makes the 
conversion actually simpler.


Thanks!

Best regards,
Giovanni

Musachy Barroso wrote:

Actually it was wrong in 2.0.x, on 2.1 the date will always be
submitted as RFC 3339, if you define your field as a Date, or a
Calendar object you won't have to do any conversion at all.

musachy
  


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



Re: [struts] Escaping Characters in Struts Property Tag

2007-11-14 Thread Martin Gainty
Hi Ben

Have you looked at using static reference?
@[EMAIL PROTECTED]

or standard OGNL
http://struts.apache.org/2.0.11/docs/ognl-basics.html
e.g. if accessible from pageContext
#attr.comments

M--
- Original Message -
From: chengas123 [EMAIL PROTECTED]
To: user@struts.apache.org
Sent: Tuesday, November 13, 2007 6:55 PM
Subject: Re: [struts] Escaping Characters in Struts Property Tag



 That is basically what I had been trying all along.  Am I doing anything
 wrong?
 s:property value=comments / returns what I am expecting.
 s:property value=%{comments} / returns what I am expecting.
 s:property

value=@[EMAIL PROTECTED](comments)

 / returns nothing.
 s:property

value=[EMAIL PROTECTED]@escapeJavaScript(comment
s)}
 / returns nothing.

 Thanks,
 Ben



 newton.dave wrote:
 
  --- chengas123 [EMAIL PROTECTED] wrote:
  That brings me back to my original question though
  which is how do I call that from within the property
  tag?
 
  http://struts.apache.org/2.x/docs/ognl-basics.html
 
  See the section called Accessing static properties.
 
  Nutshell:
 
  s:property
 
value=@[EMAIL PROTECTED](valWithQu
otes)/
 
  d.
 
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 

 --
 View this message in context:
http://www.nabble.com/Escaping-Characters-in-Struts-Property-Tag-tf4799846.h
tml#a13737312
 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: [struts] Escaping Characters in Struts Property Tag

2007-11-14 Thread chengas123

Ahh, yes, that was my problem.  I'm afraid I wasn't expecting that.  I don't
really see how allowing static method access presents a security problem.  I
am opening myself up to any obvious risks by turning this on?

Thanks,
Ben



DNewfield wrote:
 
 
 Have you turned off this capability (or rather not turned it back on)?
 struts.ognl.allowStaticMethodAccess
 https://issues.apache.org/struts/browse/WW-2160
 
 -Dale
 
 
 

-- 
View this message in context: 
http://www.nabble.com/Escaping-Characters-in-Struts-Property-Tag-tf4799846.html#a13747747
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: How to preselect a radio button in Struts 2

2007-11-14 Thread Martin Gainty
XWork expression too-
http://struts.apache.org/2.0.11/docs/radio.html

M--
- Original Message -
From: Randy Burgess [EMAIL PROTECTED]
To: Struts Users Mailing List user@struts.apache.org
Sent: Wednesday, November 14, 2007 9:05 AM
Subject: Re: How to preselect a radio button in Struts 2


 Use the value attribute and the radio button with that value will be
 selected.

 s:radio name=r1 value=some ognl value list=some ognl list/map/

 Regards,
 Randy Burgess
 Web Applications Developer
 Nuvox Communications



  From: Pankaj Gupta [EMAIL PROTECTED]
  Reply-To: Struts Users Mailing List user@struts.apache.org
  Date: Wed, 14 Nov 2007 10:42:20 +0530
  To: user@struts.apache.org
  Subject: How to preselect a radio button in Struts 2
 
  Hi,
  I am working on Struts 2 and I want to preselect  a radio button.
  If somebody can let me know how to go about it.
  Regards,
  Pankaj



 This email and any attachments (Message) may contain legally privileged
and/or confidential information.  If you are not the addressee, or if this
Message has been addressed to you in error, you are not authorized to read,
copy, or distribute it, and we ask that you please delete it (including all
copies) and notify the sender by return email.  Delivery of this Message to
any person other than the intended recipient(s) shall not be deemed a waiver
of confidentiality and/or a privilege.

 -
 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] Escaping Characters in Struts Property Tag

2007-11-14 Thread Dale Newfield

chengas123 wrote:

Ahh, yes, that was my problem.  I'm afraid I wasn't expecting that.  I don't
really see how allowing static method access presents a security problem.  I
am opening myself up to any obvious risks by turning this on?


If someone submits a value in a form that you mirror back to them in a 
place that might be evaluated by ognl, then @[EMAIL PROTECTED](-1) would be 
a pretty evil risk, no?  I'm pretty certain that the most recent xwork 
.jar prevents ognl evaluation while setting parameters from the request, 
so the path that string must take to be destructive is now much more 
convoluted.


-Dale

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



Re: [struts] JAAS and Struts Re-authentication Question

2007-11-14 Thread Adam Gordon
If you mean protecting the page w/ a security constraint, I think that 
would be a problem in that JAAS would detect that it's a protected 
resource and prompt the user to log in before hitting the login page and 
upon a successful login would redirect the user to the login page after 
they've already logged in.  And even if I modified the login page to 
redirect to the default home page in the webapp, the problem is when 
they try logging in as someone else without logging out - JAAS/Tomcat 
detects that they are already logged in (have an authenticated session) 
and so would bypass any authentication mechanism.


--adam

Dale Newfield wrote:

Adam Gordon wrote:
We're using JAAS for webapp authentication and we've discovered an 
issue:  If user A is logged in and tries to log in as user B, they 
stay logged in as user A.


Couldn't you protect the login form page and action so that they're 
only accessible by a session without any valid login credentials?  
That way the only way to log in as B would be to first log out as A 
(or in some other way start a new session w/o A's credentials).


-Dale

-
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] Escaping Characters in Struts Property Tag

2007-11-14 Thread Dave Newton
Another issue, a more stylistic one, is that using
methods like this is barely better than scriptlets.
Some would argue that this type of work belongs on the
server side, especially if you're working with
non-programming designers (although some can be
trained to use a set of well-defined static methods
once they have the syntax).

d.

--- Dale Newfield [EMAIL PROTECTED] wrote:

 chengas123 wrote:
  Ahh, yes, that was my problem.  I'm afraid I
 wasn't expecting that.  I don't
  really see how allowing static method access
 presents a security problem.  I
  am opening myself up to any obvious risks by
 turning this on?
 
 If someone submits a value in a form that you mirror
 back to them in a 
 place that might be evaluated by ognl, then
 @[EMAIL PROTECTED](-1) would be 
 a pretty evil risk, no?  I'm pretty certain that the
 most recent xwork 
 .jar prevents ognl evaluation while setting
 parameters from the request, 
 so the path that string must take to be destructive
 is now much more 
 convoluted.
 
 -Dale
 

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



[s2] How can I access the RequestMap from an Interceptor?

2007-11-14 Thread Thilo Ettelt

Hey,

somehow I can't find a way to access the RequestMap from within an 
Interceptor. What is the right way?



- Thilo

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



Re: [s2] How can I access the RequestMap from an Interceptor?

2007-11-14 Thread Omkar patil

Thilo,

You can directly access an HttpServletRequest in the Interceptor using 
following -


   ActionContext ac = invocation.getInvocationContext();
   HttpServletRequest request = (HttpServletRequest) 
ac.get(ServletActionContext.HTTP_REQUEST);


- Omkar


Thilo Ettelt wrote:

Hey,

somehow I can't find a way to access the RequestMap from within an 
Interceptor. What is the right way?



- Thilo

-
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: [s2] How can I access the RequestMap from an Interceptor?

2007-11-14 Thread Dave Newton
From ServletConfigInterceptor:

final Object action = invocation.getAction();
final ActionContext context =
invocation.getInvocationContext();
if (action instanceof ServletRequestAware) {
HttpServletRequest request = (HttpServletRequest)
context.get(HTTP_REQUEST);
((ServletRequestAware)
action).setServletRequest(request);
}

d.

--- Thilo Ettelt [EMAIL PROTECTED] wrote:

 Hey,
 
 somehow I can't find a way to access the RequestMap
 from within an 
 Interceptor. What is the right way?
 
 
 - Thilo
 

-
 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] Escaping Characters in Struts Property Tag

2007-11-14 Thread chengas123

I do see Dale's point now about the security risk.  
I'd generally agree with Dave that using a static method is basically the
same as a scriptlet.  However, in this case I can't say it really belongs in
my bean.  It's really more of a formatting issue.  I'd hate to have my bean
have two getters for every variable: one to get it regularly and one to get
the escaped version.  
Perhaps the property tag needs another attribute which would allow special
JavaScript characters to be escaped?

-Ben



newton.dave wrote:
 
 Another issue, a more stylistic one, is that using
 methods like this is barely better than scriptlets.
 Some would argue that this type of work belongs on the
 server side, especially if you're working with
 non-programming designers (although some can be
 trained to use a set of well-defined static methods
 once they have the syntax).
 
 d.
 
 --- Dale Newfield [EMAIL PROTECTED] wrote:
 
 chengas123 wrote:
 Ahh, yes, that was my problem.  I'm afraid I
 wasn't expecting that.  I don't
 really see how allowing static method access
 presents a security problem.  Am
 I opening myself up to any obvious risks by
 turning this on?
 
 If someone submits a value in a form that you mirror
 back to them in a 
 place that might be evaluated by ognl, then
 @[EMAIL PROTECTED](-1) would be 
 a pretty evil risk, no?  I'm pretty certain that the
 most recent xwork 
 .jar prevents ognl evaluation while setting
 parameters from the request, 
 so the path that string must take to be destructive
 is now much more 
 convoluted.
 
 -Dale
 
 
 

-- 
View this message in context: 
http://www.nabble.com/Escaping-Characters-in-Struts-Property-Tag-tf4799846.html#a13752981
Sent from the Struts - User mailing list archive at Nabble.com.


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



struts2: some action mapping clarificacions needed

2007-11-14 Thread hernan gonzalez
I have a wildcard mapping, say

  action name=CarCRUD_* method={1} class=myCarCRUAction

If I have a form
s:form action=CarCRUD_load...
which results in (html stripped)
form action=/Presentation/test/CarCRUD_load.do2
and inside I have some submit buttons which go to other methods (besides load)
I can accomplish that by using the method and action attrbiute of
the submit struts-tag,
eg
s:submit value=Borrar action=CarCRUD_delete   /   (case 1)
s:submit value=Do1 method=met1  /  (case 2)
This would invoke the delete() and met1() methods in my action class,
respectively.
The magic, as I see, is done by struts-tag by inserting the http parameters
   action:CarCRUD_delete=Borrar
   method:met1=Do1
respectively in the resultant request. But the url of the request is
still /myapp/CarCRUD_load.do2
Then...
Am I to deduce that Struts2, BEFORE going to the struts.xml file, when
it must determine
the action name, replaces the standard action according to the url
(ie. CarCRUD_load )
if it finds some action:xxx parameter (in the first case)  ?
(say: it assumes that the action name is CarCRUD_delete and from
them it continues
as usual) ?
And that, (in the second case),  AFTER having deterined the method
name according to the standard
rule ( CarCRUD_load ) , finds the matching action mapping in
struts.xml, BUT instead of applying the
pattern matching rule, as it finds some method:xxx parameter in the
request , uses that method ?
Is this so ?
Is there some place in the documentation to see this behaviour ?
Is there other way of setting the method name ? (eg: with a -fixed
named- parameter VALUE ) ?

HernĂ¡n

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



Re: [S2] Help for Ajax Tabbed Panel

2007-11-14 Thread Raghuveer Rawat
Still not able to make it working. I had s:url inside the tabbed panel which
I have moved out but still output of MyArticlesDetail.jsp is not coming back
into tab of the MyArticle.jsp

Not sure what is causing this issue. Any help if someone is able to make
tabbelpanel working.

Tabbed Panel code look like below.. other details i have already given..

 s:url var=storyAction
value=article/myArticles_articlesByAuthorId.action?channelId=1/
s:url var=poemAction
value=article/myArticles_articlesByAuthorId.action?channelId=2 /
s:url var=jokesAction
value=article/myArticles_articlesByAuthorId.action?channelId=3 /
s:url var=shayariAction
value=article/myArticles_articlesByAuthorId.action?channelId=4 /

s:tabbedPanel id=test theme=simple cssStyle=height: 300px;
doLayout=true selectedTab=one closeButton=tab 

   s:div id=one label=Stories loadingText=Loading My Stories
   theme=ajax href=%{storyAction}

   /s:div

   s:div id=two label=Poem theme=ajax href=%{poemAction}
loadingText=Loading My Poems 

   /s:div

   s:div id=three label=Jokes/Humors theme=ajax
href=%{jokesAction} loadingText=Loading My Jokes 

   /s:div

   s:div id=four label=Shayaries/Ghazal theme=ajax
href=%{shayariAction} loadingText=Loading My Shayaries 

   /s:div

   /s:tabbedPanel



On 11/13/07, Raghuveer Rawat [EMAIL PROTECTED] wrote:

 I can see below message after execution in tabble panel..

 *Couldn't load content:Unknown runtime error*

 It looks request is getting forwarded to new
 location /WEB-INF/jsp/MyArticlesDetail.jsp. How do I include response of
 MyArticlesDetail.jsp in main jsp MyArticles.jsp

 I have below configuration in struts.xml

  package name=article namespace=/article extends=struts-default
  action name=myArticles_* method={1} class=
 com.rawatsoft.write4smile.webapp.action.ArticleAction 
  result name=success type=dispatcher
  /WEB-INF/jsp/MyArticlesDetail.jsp
  /result
 /action




  On 11/13/07, Raghuveer Rawat [EMAIL PROTECTED]  wrote:

  Thanks Basti,
  I made this change for s:url
  Now I can see from log that DisplayTag is getting populated with correct
  data but table is not getting populated to main JSP MyArticles.jsp i.e.
  response of MyArticlesDetail.jsp is not getting included in
  MyArticle.jsp which contain TabbedPanel
 
  Not sure what to do now.
 
  Thanks
  Raghu
 
 
 
  On 11/13/07, lbastil [EMAIL PROTECTED]  wrote:
  
  
   I think you have to use s:url .../ when using ajaxed remote divs.
  
   Try something like:
  
   s:url id=yourId ... /
  
   ...
   s:div id=one label=Stories  theme=ajax
   href=%{yourId}
   labelposition=top 
/s:div
  
   Regards,
   basti
  
  
   Raghuveer Rawat wrote:
   
Hi,
I am using Struts2, Tile2, Spring2, Display Tag.
I am implementing tabbed panel and all the tabs make remote calls.
   Each
Tab
will contain a table which are implemented using DisplayTag. I am
implementing this table in a separagte JSP and want its content to
   be
added
to tab in the main jsp after execution.
   
I can see Tabbed Panel but it is not able to load data. Request is
reaching
to Action class but data is not reaching back to original jsp.
I am implementing like below..
   
*MyArticles.jsp* . . ...and it has Tabbed Panel.
   
 s:tabbedPanel id=test 
  s:div id=one label=Stories  theme=ajax
href=article/myArticles_articlesByAuthorId.action?channelId=1
labelposition=top 
  /s:div
   
  s:div id=two label=Poem  theme=ajax
href=article/myArticles_articlesByAuthorId.action?channelId=2
  /s:div
   
  s:div id=three label=Jokes/Humors  theme=ajax
href=article/myArticles_articlesByAuthorId.action?channelId=3
  /s:div
   
  s:div id=four label=Shayaries/Ghazal  theme=ajax
href=article/myArticles_articlesByAuthorId.action?channelId=4
  /s:div
   
 /s:tabbedPanel
*MyArticleDetail.jsp (*This jsp contain table, which will be added
   to
tab*)*
   
display:table id=articleId name=articlesByAuthor
 requestURI= defaultsort=3 sort=list
   defaultorder=descending
pagesize=10 class=table
   
  display:column property=categoryName sortable=true
 title=name style=width:20%; class=text/
   
  display:column property=title  sortable=true
title=title style=width:20%; class=text /
   
  display:column property=lastUpdatedDate
   format={0,date,dd-MMM-}
sortable=true
title=Date style=width:20%; class=text /
   
   
  display:column property=ratingCount  sortable=true
title=Rating style=width:20%; class=text /
   
   
/display:table
   
*Struts.xml*
**
   
package name=article namespace=/article
   extends=struts-default
   
action name=myArticles_* method={1} class=
com.rawatsoft.write4smile.webapp.action.ArticleAction
   
result name=success type=dispatcher
   

Re: [s2] How can I access the RequestMap from an Interceptor?

2007-11-14 Thread Thilo Ettelt
Yes, I know :) But I don't want to depend on HttpServletRequest. I would 
like to have the Request*Map*. Unfortunetely from looking at the code I 
only found out how to contruct a RequestMap from a HttpServletRequest.


Isn't there some kind of function that provides me with the Map? (Except 
the IoC RequestAware interface which only works for Actions)



- Thilo

Omkar patil wrote:

Thilo,

You can directly access an HttpServletRequest in the Interceptor using 
following -


   ActionContext ac = invocation.getInvocationContext();
   HttpServletRequest request = (HttpServletRequest) 
ac.get(ServletActionContext.HTTP_REQUEST);


- Omkar


Thilo Ettelt wrote:

Hey,

somehow I can't find a way to access the RequestMap from within an 
Interceptor. What is the right way?



- Thilo

-
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: [s2] How can I access the RequestMap from an Interceptor?

2007-11-14 Thread Gary Affonso

Thilo Ettelt wrote:
Yes, I know :) But I don't want to depend on HttpServletRequest. I would 
like to have the Request*Map*. Unfortunetely from looking at the code I 
only found out how to contruct a RequestMap from a HttpServletRequest.


Omkar showed you how to get to the invocationContext().  From there 
isn't it just...


  invocationContext.getParameters()

The API for ActionContext.getParameters() indicates:

Returns a Map of the HttpServletRequest parameters when in a servlet 
environment or a generic Map of parameters otherwise.


To be more specific, it should give you a generic map of name/value 
pairs.  When in a servlet environment that map mirrors the request map 
(but is *not* the raw request params).


That's what you want, right?

- Gary

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



Re: Without ActionServlet can i use struts ....?

2007-11-14 Thread Laurie Harper

Friend Here wrote:

without ActionServlet can i use struts ?
could u plz explain abt this  ...


How would you envision using Struts without ActionServlet, which is the 
primary entry point for a request which will be served by Struts (for 
Struts 1 at least)? And why does using ActionServlet present a problem?


L.


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



Re: forward to a particular id in a page from forward...

2007-11-14 Thread Laurie Harper

shakeel_code wrote:

Hi,

i have an html id in a jsp page tr id=theId/tr.

i have,
forward name=thisisdjsp.jsp/ in my struts config.xml

but i want to go directly to that id in the jsp page when the forward
happens.

i also tried,
forward name=thisisdjsp.jsp id=theId/ 


but it was of no help

can anyone help me?


I'm not sure if I understand what you want... Do you mean you want 
clicking on a link to scroll the page to a particular anchor, as with a 
URL ending in #someID?


If so, that has nothing to do with Struts' forward config. HTML 
anchors are a client-side thing. They are defined in the HTML (usually 
with the 'anchor' (a) tag, though using an ID attribute on another 
element *might* work in XHTML). They are used by including the fragment 
identifier (#...) in a URL.


L.


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



Re: conditional matching using s:if

2007-11-14 Thread Laurie Harper

Without seeing more of your code I can't be sure, but (see inline):

SudarshanP wrote:

Hi Struts2 users,

I am new to Struts2

Have a problem with s:if tag, below is the code snippet
'branchsData' is a javaobject having 'branch' as its property


if that's the case, why are you trying to iterate it with s:iterator?
I'll assume below that branchsData is actually some sort of collection 
(array or list) of objects where each object has a 'branch' property.



Trying to generate table structure based on condition, i am afraid s:if
conditional tag is not working for me.  Let me know what is the problem with
this code and what best way to achieve this

Any help will be greatly appreciated

Thanks in advance

- START -
s:iterator value=branchsData status=stat
   s:if test=%{#branchsData[%{#stat.index}].branch =='START'}
tabletr
/s:if
s:elseif test=%{#branchsData[%{#stat.index}].branch =='END'}
/table/tr
/s:elseif
s:else
  
tds:textfield name=%{#branchsData[%{#stat.index}].branch
value=/s:textfield/td
   /s:else
/s:iterator
--- END --


It looks like you may be trying to encode presentational information in 
your data. Those OGNL expressions look suspicious to me, too; why are 
you trying to do the indexing manually, instead of letting s:iterator 
handle it for you?


The simple solution is to get rid of the conditional rendering stuff 
like so:


  tabletr
  s:iterator var=branch value=branchsData stat=stat
tds:textfield name=branch//td
  /s:iterator
  /tr/table

If branch=='START' and branch='END' are just placeholder/delimiter 
entries to separate logical groups of entries, consider making your data 
structure a list of lists of branches, where the intermediate list does 
the grouping.


If that doesn't help, try posting a more complete description of what 
you're trying to achieve. Maybe there are more suitable changes that can 
be applied to your data structure and/or presentation logic to get there.


L.


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



RE: Re: forward to a particular id in a page from forward...

2007-11-14 Thread Richard . Ferri
It sounds like you want to use jsp:forward and not an ActionServlet.

The ActionServlet has many design advantages and is used mainly as an
organized controller in the model-view-controller design pattern.

If you are writing a very large application, you should use this as you
can decrease the amount of code you need to write and the application
will be easier to maintain.

If you are writing a very small application, you can still use the
ActionServlet

ActionServlet runs like a RequestProcessor which selects and invokes an
action to run the necessary business logic.

You may want to look up a tutorial on how to write your first Action -
ActionForm and attempt to move from there.


Otherwise, just do what you need to in your JSP.

 
-Original Message-
From: news [mailto:[EMAIL PROTECTED] On Behalf Of Laurie Harper
Sent: Wednesday, November 14, 2007 6:47 PM
To: user@struts.apache.org
Subject: Re: forward to a particular id in a page from forward...

shakeel_code wrote:
 Hi,
 
 i have an html id in a jsp page tr id=theId/tr.
 
 i have,
 forward name=thisisdjsp.jsp/ in my struts config.xml
 
 but i want to go directly to that id in the jsp page when the forward
 happens.
 
 i also tried,
 forward name=thisisdjsp.jsp id=theId/ 
 
 but it was of no help
 
 can anyone help me?

I'm not sure if I understand what you want... Do you mean you want 
clicking on a link to scroll the page to a particular anchor, as with a 
URL ending in #someID?

If so, that has nothing to do with Struts' forward config. HTML 
anchors are a client-side thing. They are defined in the HTML (usually 
with the 'anchor' (a) tag, though using an ID attribute on another 
element *might* work in XHTML). They are used by including the fragment 
identifier (#...) in a URL.

L.


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



The information contained in this message and any attachment may be
proprietary, confidential, and privileged or subject to the work
product doctrine and thus protected from disclosure.  If the reader
of this message is not the intended recipient, or an employee or
agent responsible for delivering this message to the intended
recipient, you are hereby notified that any dissemination,
distribution or copying of this communication is strictly prohibited.
If you have received this communication in error, please notify me
immediately by replying to this message and deleting it and all
copies and backups thereof.  Thank you.



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



Re: [struts] JAAS and Struts Re-authentication Question

2007-11-14 Thread Laurie Harper
I don't think Container Managed Security has provisions for logging 
users out, other than by expiring the session (and not even then if 
you're relying on HTTP authentication rather than form-based).


If you have a separate 'login' page (as opposed to having a login form 
on each page) you might be able to get away with invalidating the 
session when that page is shown, with the caveat that logged in users 
would implicitly be logged out if they visit that page.


Perhaps it would help to more fully describe the use case (i.e. 'user is 
logged in and tries to log in...' and how it is failing (i.e. 'user 
stays logged in as old user'), along with specific details of how you 
have authentication configured.


L.

Adam Gordon wrote:
If you mean protecting the page w/ a security constraint, I think that 
would be a problem in that JAAS would detect that it's a protected 
resource and prompt the user to log in before hitting the login page and 
upon a successful login would redirect the user to the login page after 
they've already logged in.  And even if I modified the login page to 
redirect to the default home page in the webapp, the problem is when 
they try logging in as someone else without logging out - JAAS/Tomcat 
detects that they are already logged in (have an authenticated session) 
and so would bypass any authentication mechanism.


--adam

Dale Newfield wrote:

Adam Gordon wrote:
We're using JAAS for webapp authentication and we've discovered an 
issue:  If user A is logged in and tries to log in as user B, they 
stay logged in as user A.


Couldn't you protect the login form page and action so that they're 
only accessible by a session without any valid login credentials?  
That way the only way to log in as B would be to first log out as A 
(or in some other way start a new session w/o A's credentials).


-Dale

-
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: multi part request.

2007-11-14 Thread Laurie Harper

Sivaswamynatha K wrote:

In my struts 1.2.9 application, I have a requirement to attach a file.
So in my jsp page I use enctype=multipart/form-data. Its working fine


I'm not clear how this...


and file gets attached. It's a tabbed page and when I click another tab,
I want to keep track the tab index. (I have tab index as hidden field).
So when I use request.getParameter(tabIndex), I got null value. How to
overcome this?


...is related to this? Some things to check:

* Are you sure you included the tabIndex hidden field in the form? And 
that its value is rendered correctly?


* What are you using to render the tabs? Does clicking on a tab actually 
submit a form? Is it the same one that you have your hidden field in?


* Where are you calling request.getParameter() from? Are other 
parameters you expect visible? (i.e. is it just this form field that's 
missing?


Posting relevant excerpts of your code would probably help.

L.


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



S2: Struts way of submitting a value on change?

2007-11-14 Thread James Carr
Hi All,

What is the struts 2 way of using ajax to submit a value and calling
a method on an action? Currently I am just having a select with a name
that maps to a value via OGNL, then just using javascript to read and
submit the value onchange.

I keep thinking struts does this out of the box?


Thanks,
James

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



Re: How to preselect a radio button in Struts 2

2007-11-14 Thread Pankaj Gupta
Hi,
I tried the same. But it didn't worked
s:radio label=Courtesy Call  Requested name=courtesyCallFlag
list={'Yes','No'} value=No required=true /
Regards,
Pankaj


On 11/14/07, Randy Burgess [EMAIL PROTECTED] wrote:

 Use the value attribute and the radio button with that value will be
 selected.

 s:radio name=r1 value=some ognl value list=some ognl list/map/

 Regards,
 Randy Burgess
 Web Applications Developer
 Nuvox Communications



  From: Pankaj Gupta [EMAIL PROTECTED]
  Reply-To: Struts Users Mailing List user@struts.apache.org
  Date: Wed, 14 Nov 2007 10:42:20 +0530
  To: user@struts.apache.org
  Subject: How to preselect a radio button in Struts 2
 
  Hi,
  I am working on Struts 2 and I want to preselect  a radio button.
  If somebody can let me know how to go about it.
  Regards,
  Pankaj



 This email and any attachments (Message) may contain legally privileged
 and/or confidential information.  If you are not the addressee, or if this
 Message has been addressed to you in error, you are not authorized to read,
 copy, or distribute it, and we ask that you please delete it (including all
 copies) and notify the sender by return email.  Delivery of this Message to
 any person other than the intended recipient(s) shall not be deemed a waiver
 of confidentiality and/or a privilege.

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




Re: Migration from S2.0.x to S2.1.x

2007-11-14 Thread Ted Husted
While the paperwork clears, you can always start a Migrating From 2.0
to 2.1 page in the Struts 2 community wiki, and we can move the page
over later.

* http://cwiki.apache.org/S2WIKI/home.html

Then, to point people to it, add a comment to the Migration Guide page.

HTH, Ted
http://www.husted.com/ted/blog/


On Nov 14, 2007 5:03 AM, Antonio Petrelli [EMAIL PROTECTED] wrote:
 2007/11/14, Giovanni Azua [EMAIL PROTECTED]:
 
  hi,
 
  I have been collecting a few points required for migrating from S2.0.x
  to S2.1.x and I would like to bookkeep this info somewhere. Of course,
  if we do it in Wiki  it will benefit others too ... where exactly could
  we enter this?



 Thanks a lot Giovanni!
 First of all I suggest to read this FAQ:
 http://struts.apache.org/helping.html#documentation

 Possibly the best place to put it is under this page:
 http://cwiki.apache.org/confluence/display/WW/Migration+Guide

 Ciao
 Antonio


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