Re: [struts 2] Two forms for one action

2008-05-13 Thread Jukka Välimaa
Both forms don't call the same *instance* of the action class. Neither does
one form, actually.
For each request, Struts 2 uses a different instance of the same class. Once
the result is
rendered, the action object is no longer used. If you want to retain action
state information, you
must store it somehow-through hidden fields in form or in session, for
example.

On Tue, May 13, 2008 at 6:13 PM, Milan Milanovic <[EMAIL PROTECTED]>
wrote:

> Thank you Randy.
> >They could, if it were me I would have different methods on the action
> class
> >to handle the different forms if I were to do it this way. Personally I
> >would create an action class for each form.
>
> No, I cannot do this, because both forms need to work with the same
> objects in
> a action class. First form works with some header data, and the second
> with list
> of data and show table also of such data.
> I asked this, because I wasn't sure if both forms would call the same
> instance of
> action class.
> --
> Thx, Milan Milanovic
> - Original Message 
> From: Randy Burgess <[EMAIL PROTECTED]>
> To: Struts Users Mailing List 
> Sent: Tuesday, May 13, 2008 5:09:19 PM
> Subject: Re: [struts 2] Two forms for one action
>
> They could, if it were me I would have different methods on the action
> class
> to handle the different forms if I were to do it this way. Personally I
> would create an action class for each form.
>
> Regards,
> Randy Burgess
> Sr. Web Applications Developer
> Nuvox Communications
>
>
>
> > From: Milan Milanovic <[EMAIL PROTECTED]>
> > Reply-To: Struts Users Mailing List 
> > Date: Tue, 13 May 2008 07:58:29 -0700 (PDT)
> > To: Struts Users Mailing List 
> > Subject: Re: [struts 2] Two forms for one action
> >
> > I have one more question about this, if I define two  in one
> page
> > would
> > they work with the same action class ?
> >
> > --
> > Thx, Milan Milanovic
> > - Original Message 
> > From: Jim Kiley <[EMAIL PROTECTED]>
> > To: Struts Users Mailing List 
> > Sent: Monday, May 12, 2008 6:15:07 PM
> > Subject: Re: [struts 2] Two forms for one action
> >
> > Milan,
> >
> > I'm not a Struts 1 guy, so this advice might not be useful to you
> (because
> > you didn't say whether this was a Struts 1 or 2 situation). But in my
> Struts
> > 2 app I have plenty of places where I have multiple  buttons
> each
> > triggering different action methods on the same action class.
> >
> > jk
> >
> >
> > On Mon, May 12, 2008 at 12:10 PM, Milan Milanovic <
> [EMAIL PROTECTED]>
> > wrote:
> >
> >> Or maybe I should define two submit buttons for the same form and
> action
> >> class ?
> >> --
> >> Regards, Milan
> >>
> >>
> >> - Original Message 
> >> From: Milan Milanovic <[EMAIL PROTECTED]>
> >> To: Struts Users Mailing List 
> >> Sent: Monday, May 12, 2008 5:57:50 PM
> >> Subject: [struts 2] Two forms for one action
> >>
> >> Hi,
> >> I need to have classic master/detail jsp page, so I need actually two
> >> forms in a jsp page to works with one action class,
> >> one main form that works with main elements of my object (e.g. User
> name,
> >> surname,...) for header and another one which works
> >> with some list that belongs to my main object (e.g., User.privileges)
> >> below such header part. How can I define this ?
> >> --
> >> Thx, Milan Milanovic
> >>
> >>
> >>
> >>
> _
> >> ___
> >> Be a better friend, newshound, and
> >> know-it-all with Yahoo! Mobile.  Try it now.
> >> http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ
> >>
> >>
> >>
> >>
> >>
> _
> >> ___
> >> Be a better friend, newshound, and
> >> know-it-all with Yahoo! Mobile.  Try it now.
> >> http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ
> >>
> >
> >
> >
> > --
> > Jim Kiley
> > Technical Consultant | Summa
> > [p] 412.258.3346 [m] 412.445.1729
> > http://www.summa-tech.com
> >
> >
> >
>
>
>
> 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.
>
>
>
>
>


Re: What is the functionality of struts 2 anchor tag?

2008-05-13 Thread akshi gupta

Hello,

I am unable to use this method in my tag handler can you please help me 
. Following is my tag handler code :


package com.axis.tag;

import java.util.Properties;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.jsp.JspException;
import javax.servlet.jsp.tagext.Tag;
import javax.servlet.jsp.PageContext;
import javax.servlet.jsp.tagext.BodyContent;

import org.apache.struts2.components.Component;
import org.apache.struts2.views.jsp.ui.AnchorTag;

import com.axis.utils.PropertyLoader;
import com.opensymphony.xwork2.util.ValueStack;

public class MyAnchorTag extends AnchorTag {

  
  
   /**

*
*/
   private static final long serialVersionUID = 1L;
  
   private PageContext pageContext;

   private Tag parent;
   protected String preInvokeJS;
   protected String targets;
   protected ValueStack stack ;
   public HttpServletRequest req;
   public HttpServletResponse res;
  
   @Override

   public void doInitBody() throws JspException {
   super.doInitBody();
   }

   @Override
   public void setBodyContent(BodyContent arg0) {
   super.setBodyContent(arg0);
   }

   @Override
   public int doAfterBody() throws JspException {
  return super.doAfterBody();
   }

   @Override
   public int doStartTag() throws JspException {
   Properties props = 
PropertyLoader.loadPropertiesBundle("resources/permissionParameter");
  
  
   String permission = props.getProperty("permission");

   System.out.println(" Method :" + permission);
   if(permission == null){
   return super.doStartTag();
   }
  
   return SKIP_BODY;

   }
  
   @Override

   public int doEndTag() throws JspException {
   return EVAL_BODY_INCLUDE;
   }

   @Override
   public Tag getParent() {
   return super.getParent();
   }
  
   @Override

   public Component getComponent() {
   // TODO Auto-generated method stub
   return super.getComponent();
   }

   @Override
   public void release() {
   super.release();
   }

   @Override
   public void setPageContext(PageContext pageContext) {
   this.pageContext = pageContext;
   super.setPageContext(pageContext);
   }

   @Override
   public void setParent(Tag parent) {
   this.parent = parent;
   super.setParent(parent);
   }

   @Override
   public Component getBean(ValueStack stack, HttpServletRequest req,
   HttpServletResponse res) {
  
   return super.getBean(stack, req, res);
  
   }
  
   @Override

   protected void populateParams() {
   // TODO Auto-generated method stub
   super.populateParams();
   }
}

Thanks,
Akshi


Musachy Barroso wrote:

In org.apache.struts2.components.Achor

public void evaluateExtraParams() {
super.evaluateExtraParams();

if (href != null)
addParameter("href",
ensureAttributeSafelyNotEscaped(findString(href)));
}


On Fri, May 9, 2008 at 9:59 AM, akshi gupta <[EMAIL PROTECTED]> wrote:
  

Actually I am writing my own custom tag by extending AnchorTag class because
I want "href" value for some business rules thats why I wanthref evaluated
value.

Now can you tell me from which method href evaluated value is coming?

Thanks,
Akshi


Musachy Barroso wrote:


I am not really sure why you want to know but here is the short
explanation:

 

This will construct a url like: "/edit.action", and push it into the
stack, associated with the key "edit" (from the "id" attribute). Later
on

Edit

"%{edit}" will be evaluated against the stack and "/edit.action" will
be found, so that is the value that the anchor tag will use on its
href.

musachy


On Fri, May 9, 2008 at 8:59 AM, akshi gupta <[EMAIL PROTECTED]> wrote:

  

Hello,

If we use anchor tag like this :

(ListSuccess.jsp) :  > <%@ taglib prefix="s"
uri="/struts-tags"%>
.
.
 > 
 >  Edit


Now , how href value get parse and get the complete url ?
Exactly through which method of the AnchorTag.java?

Can anyone please help me out ?


Thanks,

Akshi


-
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: TabbedPanel in Struts2

2008-05-13 Thread Jay Bose
OK User error: I had the struts.serve.static property set to false, and did not 
actually
have all the required files copied over. 

All, thanks for your quick responses.


  

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



Re: TabbedPanel in Struts2

2008-05-13 Thread Jay Bose
I do have debug on. No errors or config warnings are coming up.


--- Dave Newton <[EMAIL PROTECTED]> wrote:

> Do you have Dojo debugging turned on in your  tag?
> 
> Do you have an  tag, I guess? I don't recall having had
> any major issues with it, but it was awhile ago I used it.
> 
> Dave



  

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



Re: TabbedPanel in Struts2

2008-05-13 Thread Dave Newton
Do you have Dojo debugging turned on in your  tag?

Do you have an  tag, I guess? I don't recall having had
any major issues with it, but it was awhile ago I used it.

Dave

--- Jay Bose <[EMAIL PROTECTED]> wrote:

> No, not at all. I get Dojo-ififed tags, but they have no label or
> anything else, for that
> matter. They are just divs with the content of the tab, but no label.
> I will list the JSP
> content I'm using, and the resulting output.
> 
> The JSP code
> ==
> <%@ taglib uri="/struts-tags" prefix="st" %>
> 
> 
>   
>   One
>   
> 
>   
>   Two
>   
> 
> ==
> 
> 
> The output
> ==
> 
>   dojo.require("dojo.widget.TabContainer");
>   dojo.require("dojo.widget.LinkPane");
>   dojo.require("dojo.widget.ContentPane");
> 
> 
>  doLayout="false">
>showError="true">
>   One
>   
>showError="true">
>   Two
>   
> 
> ==
> 
> 
>   
> 
> -
> 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: problems nesting TileResults....

2008-05-13 Thread Darren James

Hi Antonio,

I got a 2.0.6 snapshot and the issue is fixed!  Thanks much for the 
tip.  Also noteworthy is that
now that I have actions that can forward to tiles which have nested 
within them actions that also
forward to tiles (whew), in order for action context to be available to 
JSP pages I had to follow
the steps to include the struts-cleanup filter in web.xml.  The docs on 
the struts2 site say that this
filter is solely for the purpose of sitemesh integration, but apparently 
it's beneficial to tiles

integration as well

thanks again,

- Darren.

Antonio Petrelli wrote:

2008/5/13 Darren James <[EMAIL PROTECTED]>:
  

i downloaded the 2.0.5 version of tiles, and i see the same issue
 seems to be a pretty severe limitation of tiles



It's not a limitation, it's a bug :-)
https://issues.apache.org/struts/browse/TILES-232

Try using the SVN version of Tiles (branch: TILES_2_0_X):
http://svn.apache.org/repos/asf/tiles/framework/branches/TILES_2_0_X/
Or you can use the 2.0.6 snapshots:
http://people.apache.org/repo/m2-snapshot-repository/org/apache/tiles/

Antonio

-
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: TabbedPanel in Struts2

2008-05-13 Thread Jay Bose
I saw this page, but no real help -
http://struts.apache.org/2.0.11/docs/ajax-tags.html#AjaxTags-tabbedPanelTag

Any help would be greatly appreciated.


  

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



problem with JUnit Test in Struts2

2008-05-13 Thread Pranav
Hi,

I am having trouble with unit testing my validation logic in Struts2.

here's the code.

1) In UserLookupAction-validation.xml I have


   You must enter a value for 
${getText("memberId.label")}.
   


2) In UserLookupActionTest.java I have the following method

public void setUp() throws Exception {
super.setUp();
ObjectFactory.setObjectFactory( new ObjectFactory() ); 
}

public void testValidationFailed() throws ValidationException {
ActionValidatorManager avm = 
ActionValidatorManagerFactory.getInstance();
UserLookupAction action = new UserLookupAction();
action.setSession(sessionMap);
action.setMemberId(null);

avm.validate(action,"UserLookupAction");
Map fieldErrors = action.getFieldErrors();
assertTrue(action.hasErrors());
}

3) UserLookupActionTest extends from TestCase and not from StrutsTestCase but I 
think I am doing ObjectFactory.setObjectFactory( new ObjectFactory() ); as an 
alternative to that so it should not cause a problem.

When I run the testValidationFailed method above, the ActionValidatorManager 
instance gets initialized but it has no properties. Afterwards, when I call 
validate method on it, it executes but then fieldErrors map is empty and the 
action.hasErrors() returns null so the assertion fails. Can someone tell me 
what is wrong here? Any help would be appreciated. This validation logic seems 
to work when I run the app.

Thanks
Pranav



  

Be a better friend, newshound, and 
know-it-all with Yahoo! Mobile.  Try it now.  
http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ



  

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



Re: [struts 2] Table question

2008-05-13 Thread Randy Burgess
OGNL expressions. It is in the documentation. :)

Regards,
Randy Burgess
Sr. Web Applications Developer
Nuvox Communications



> From: Milan Milanovic <[EMAIL PROTECTED]>
> Reply-To: Struts Users Mailing List 
> Date: Tue, 13 May 2008 15:05:34 -0700 (PDT)
> To: Struts Users Mailing List 
> Subject: Re: [struts 2] Table question
> 
> O.K. Thanks.
> 
> So, what you propose to show id and name to user ?
> 
> --
> Thx, Milan
> 
> 
> - Original Message 
> From: Randy Burgess <[EMAIL PROTECTED]>
> To: Struts Users Mailing List 
> Sent: Tuesday, May 13, 2008 11:47:57 PM
> Subject: Re: [struts 2] Table question
> 
> Except you can't use EL expressions in struts tags in the latest versions of
> S2, unless you hack the taglib.
> 
> Regards,
> Randy Burgess
> Sr. Web Applications Developer
> Nuvox Communications
> 
> 
> 
>> From: Felipe Lorenz <[EMAIL PROTECTED]>
>> Reply-To: Struts Users Mailing List 
>> Date: Tue, 13 May 2008 18:44:52 -0300
>> To: Struts Users Mailing List 
>> Subject: Re: [struts 2] Table question
>> 
>> Hi!
>> 
>> To have a composed string you can do it in JSP.
>> 
>> Something like:
>> 
>> 
>> for example.
>> 
>> And, for pagination, try displayTag, its easy to use
>> 
>> Felipe A. Lorenz
>> www.idealogic.com.br
>> 
>> On Tue, May 13, 2008 at 12:00 PM, Milan Milanovic <[EMAIL PROTECTED]>
>> wrote:
>> 
>>> Thanks Jim!
>>> Could you give me an example for the second thing (pagination) ? I need
>>> something
>>> simple as you said.
>>> For combo box, how can I tell my combobox to retrieve data from list of
>>> composed
>>> strings (e.g. List where I will compose "1 Apple"), but when
>>> selected to choose
>>> in my action class from list of Fruits, e.g. List, where Fruit
>>> have id and name attributes ?
>>> --
>>> Thx, Milan Milanovic
>>> 
>>> 
>>> - Original Message 
>>> From: Jim Kiley <[EMAIL PROTECTED]>
>>> To: Struts Users Mailing List 
>>> Sent: Tuesday, May 13, 2008 3:34:58 PM
>>> Subject: Re: [struts 2] Table question
>>> 
>>> I have to admit that in your first instance I would cheat -- I would dummy
>>> up a method somewhere on my action class or my POJO that returned the
>>> desired string, rather than trying to compose the string within the JSP.
>>> 
>>> I am unfamiliar with the various tags that can be used to display chunks
>>> of
>>> a table.  I know they're out there (the display tag library comes to
>>> mind).
>>> The most recent time I had to do this I rolled my own; it was pretty
>>> painless.  I held the data in a List of data objects, and then used
>>> List.subList() in my action method to determine the precise chunk of the
>>> List that I wanted to show.
>>> 
>>> Hope this helps.
>>> 
>>> jk
>>> 
>>> On Tue, May 13, 2008 at 9:30 AM, Milan Milanovic <
>>> [EMAIL PROTECTED]>
>>> wrote:
>>> 
 Hi,
 first I'll ask again my earlier question, is there possibility to show
>>> in
 a combo box
 two values, for example I want to show id and name of the every fruit: 1
 Apple ?
 The second question is, my struts 2 application on one jsp page will
>>> have
 5 combo
 boxes, 4 text boxes, two buttons and two datetime pickers, and below all
 these controls a table
 that will show what is entered using controls above. The problem is that
 my table will have
 about 100-120 records (rows) to show, and I think that is very much for
 one jsp page, and
 also I want user to see about last 10 rows, because he need to see if
 there is any error.
 How can I do this, can I use table pagination (how) ?
 --
 Thx in advance, Milan Milanovic
 
 
 
>>> 
>>> 
>>> 
>>> 
>>> --
>>> Jim Kiley
>>> Technical Consultant | Summa
>>> [p] 412.258.3346 [m] 412.445.1729
>>> http://www.summa-tech.com
>>> 
>>> 
>>> 
>>> 
>>> 
> 
> 
> 
> 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]
> 
> 
>   



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.

---

Re: TabbedPanel in Struts2

2008-05-13 Thread Jay Bose
No, not at all. I get Dojo-ififed tags, but they have no label or anything 
else, for that
matter. They are just divs with the content of the tab, but no label. I will 
list the JSP
content I'm using, and the resulting output.

The JSP code
==
<%@ taglib uri="/struts-tags" prefix="st" %>



One



Two


==


The output
==

  dojo.require("dojo.widget.TabContainer");
  dojo.require("dojo.widget.LinkPane");
  dojo.require("dojo.widget.ContentPane");




One


Two


==


  

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



Re: [struts 2] Table question

2008-05-13 Thread Milan Milanovic
O.K. Thanks.

So, what you propose to show id and name to user ?

--
Thx, Milan


- Original Message 
From: Randy Burgess <[EMAIL PROTECTED]>
To: Struts Users Mailing List 
Sent: Tuesday, May 13, 2008 11:47:57 PM
Subject: Re: [struts 2] Table question

Except you can't use EL expressions in struts tags in the latest versions of
S2, unless you hack the taglib.

Regards,
Randy Burgess
Sr. Web Applications Developer
Nuvox Communications



> From: Felipe Lorenz <[EMAIL PROTECTED]>
> Reply-To: Struts Users Mailing List 
> Date: Tue, 13 May 2008 18:44:52 -0300
> To: Struts Users Mailing List 
> Subject: Re: [struts 2] Table question
> 
> Hi!
> 
> To have a composed string you can do it in JSP.
> 
> Something like:
> 
> 
> for example.
> 
> And, for pagination, try displayTag, its easy to use
> 
> Felipe A. Lorenz
> www.idealogic.com.br
> 
> On Tue, May 13, 2008 at 12:00 PM, Milan Milanovic <[EMAIL PROTECTED]>
> wrote:
> 
>> Thanks Jim!
>> Could you give me an example for the second thing (pagination) ? I need
>> something
>> simple as you said.
>> For combo box, how can I tell my combobox to retrieve data from list of
>> composed
>> strings (e.g. List where I will compose "1 Apple"), but when
>> selected to choose
>> in my action class from list of Fruits, e.g. List, where Fruit
>> have id and name attributes ?
>> --
>> Thx, Milan Milanovic
>> 
>> 
>> - Original Message 
>> From: Jim Kiley <[EMAIL PROTECTED]>
>> To: Struts Users Mailing List 
>> Sent: Tuesday, May 13, 2008 3:34:58 PM
>> Subject: Re: [struts 2] Table question
>> 
>> I have to admit that in your first instance I would cheat -- I would dummy
>> up a method somewhere on my action class or my POJO that returned the
>> desired string, rather than trying to compose the string within the JSP.
>> 
>> I am unfamiliar with the various tags that can be used to display chunks
>> of
>> a table.  I know they're out there (the display tag library comes to
>> mind).
>> The most recent time I had to do this I rolled my own; it was pretty
>> painless.  I held the data in a List of data objects, and then used
>> List.subList() in my action method to determine the precise chunk of the
>> List that I wanted to show.
>> 
>> Hope this helps.
>> 
>> jk
>> 
>> On Tue, May 13, 2008 at 9:30 AM, Milan Milanovic <
>> [EMAIL PROTECTED]>
>> wrote:
>> 
>>> Hi,
>>> first I'll ask again my earlier question, is there possibility to show
>> in
>>> a combo box
>>> two values, for example I want to show id and name of the every fruit: 1
>>> Apple ?
>>> The second question is, my struts 2 application on one jsp page will
>> have
>>> 5 combo
>>> boxes, 4 text boxes, two buttons and two datetime pickers, and below all
>>> these controls a table
>>> that will show what is entered using controls above. The problem is that
>>> my table will have
>>> about 100-120 records (rows) to show, and I think that is very much for
>>> one jsp page, and
>>> also I want user to see about last 10 rows, because he need to see if
>>> there is any error.
>>> How can I do this, can I use table pagination (how) ?
>>> --
>>> Thx in advance, Milan Milanovic
>>> 
>>> 
>>> 
>> 
>> 
>> 
>> 
>> --
>> Jim Kiley
>> Technical Consultant | Summa
>> [p] 412.258.3346 [m] 412.445.1729
>> http://www.summa-tech.com
>> 
>> 
>> 
>> 
>> 



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: [struts 2] Table question

2008-05-13 Thread Milan Milanovic
O.K. Thanks.

So, what you propose to show id and name to user ?

--
Thx, Milan


- Original Message 
From: Randy Burgess <[EMAIL PROTECTED]>
To: Struts Users Mailing List 
Sent: Tuesday, May 13, 2008 11:47:57 PM
Subject: Re: [struts 2] Table question

Except you can't use EL expressions in struts tags in the latest versions of
S2, unless you hack the taglib.

Regards,
Randy Burgess
Sr. Web Applications Developer
Nuvox Communications



> From: Felipe Lorenz <[EMAIL PROTECTED]>
> Reply-To: Struts Users Mailing List 
> Date: Tue, 13 May 2008 18:44:52 -0300
> To: Struts Users Mailing List 
> Subject: Re: [struts 2] Table question
> 
> Hi!
> 
> To have a composed string you can do it in JSP.
> 
> Something like:
> 
> 
> for example.
> 
> And, for pagination, try displayTag, its easy to use
> 
> Felipe A. Lorenz
> www.idealogic.com.br
> 
> On Tue, May 13, 2008 at 12:00 PM, Milan Milanovic <[EMAIL PROTECTED]>
> wrote:
> 
>> Thanks Jim!
>> Could you give me an example for the second thing (pagination) ? I need
>> something
>> simple as you said.
>> For combo box, how can I tell my combobox to retrieve data from list of
>> composed
>> strings (e.g. List where I will compose "1 Apple"), but when
>> selected to choose
>> in my action class from list of Fruits, e.g. List, where Fruit
>> have id and name attributes ?
>> --
>> Thx, Milan Milanovic
>> 
>> 
>> - Original Message 
>> From: Jim Kiley <[EMAIL PROTECTED]>
>> To: Struts Users Mailing List 
>> Sent: Tuesday, May 13, 2008 3:34:58 PM
>> Subject: Re: [struts 2] Table question
>> 
>> I have to admit that in your first instance I would cheat -- I would dummy
>> up a method somewhere on my action class or my POJO that returned the
>> desired string, rather than trying to compose the string within the JSP.
>> 
>> I am unfamiliar with the various tags that can be used to display chunks
>> of
>> a table.  I know they're out there (the display tag library comes to
>> mind).
>> The most recent time I had to do this I rolled my own; it was pretty
>> painless.  I held the data in a List of data objects, and then used
>> List.subList() in my action method to determine the precise chunk of the
>> List that I wanted to show.
>> 
>> Hope this helps.
>> 
>> jk
>> 
>> On Tue, May 13, 2008 at 9:30 AM, Milan Milanovic <
>> [EMAIL PROTECTED]>
>> wrote:
>> 
>>> Hi,
>>> first I'll ask again my earlier question, is there possibility to show
>> in
>>> a combo box
>>> two values, for example I want to show id and name of the every fruit: 1
>>> Apple ?
>>> The second question is, my struts 2 application on one jsp page will
>> have
>>> 5 combo
>>> boxes, 4 text boxes, two buttons and two datetime pickers, and below all
>>> these controls a table
>>> that will show what is entered using controls above. The problem is that
>>> my table will have
>>> about 100-120 records (rows) to show, and I think that is very much for
>>> one jsp page, and
>>> also I want user to see about last 10 rows, because he need to see if
>>> there is any error.
>>> How can I do this, can I use table pagination (how) ?
>>> --
>>> Thx in advance, Milan Milanovic
>>> 
>>> 
>>> 
>> 
>> 
>> 
>> 
>> --
>> Jim Kiley
>> Technical Consultant | Summa
>> [p] 412.258.3346 [m] 412.445.1729
>> http://www.summa-tech.com
>> 
>> 
>> 
>> 
>> 



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: [struts 2] Table question

2008-05-13 Thread Randy Burgess
Except you can't use EL expressions in struts tags in the latest versions of
S2, unless you hack the taglib.

Regards,
Randy Burgess
Sr. Web Applications Developer
Nuvox Communications



> From: Felipe Lorenz <[EMAIL PROTECTED]>
> Reply-To: Struts Users Mailing List 
> Date: Tue, 13 May 2008 18:44:52 -0300
> To: Struts Users Mailing List 
> Subject: Re: [struts 2] Table question
> 
> Hi!
> 
> To have a composed string you can do it in JSP.
> 
> Something like:
> 
> 
> for example.
> 
> And, for pagination, try displayTag, its easy to use
> 
> Felipe A. Lorenz
> www.idealogic.com.br
> 
> On Tue, May 13, 2008 at 12:00 PM, Milan Milanovic <[EMAIL PROTECTED]>
> wrote:
> 
>> Thanks Jim!
>> Could you give me an example for the second thing (pagination) ? I need
>> something
>> simple as you said.
>> For combo box, how can I tell my combobox to retrieve data from list of
>> composed
>> strings (e.g. List where I will compose "1 Apple"), but when
>> selected to choose
>> in my action class from list of Fruits, e.g. List, where Fruit
>> have id and name attributes ?
>> --
>> Thx, Milan Milanovic
>> 
>> 
>> - Original Message 
>> From: Jim Kiley <[EMAIL PROTECTED]>
>> To: Struts Users Mailing List 
>> Sent: Tuesday, May 13, 2008 3:34:58 PM
>> Subject: Re: [struts 2] Table question
>> 
>> I have to admit that in your first instance I would cheat -- I would dummy
>> up a method somewhere on my action class or my POJO that returned the
>> desired string, rather than trying to compose the string within the JSP.
>> 
>> I am unfamiliar with the various tags that can be used to display chunks
>> of
>> a table.  I know they're out there (the display tag library comes to
>> mind).
>> The most recent time I had to do this I rolled my own; it was pretty
>> painless.  I held the data in a List of data objects, and then used
>> List.subList() in my action method to determine the precise chunk of the
>> List that I wanted to show.
>> 
>> Hope this helps.
>> 
>> jk
>> 
>> On Tue, May 13, 2008 at 9:30 AM, Milan Milanovic <
>> [EMAIL PROTECTED]>
>> wrote:
>> 
>>> Hi,
>>> first I'll ask again my earlier question, is there possibility to show
>> in
>>> a combo box
>>> two values, for example I want to show id and name of the every fruit: 1
>>> Apple ?
>>> The second question is, my struts 2 application on one jsp page will
>> have
>>> 5 combo
>>> boxes, 4 text boxes, two buttons and two datetime pickers, and below all
>>> these controls a table
>>> that will show what is entered using controls above. The problem is that
>>> my table will have
>>> about 100-120 records (rows) to show, and I think that is very much for
>>> one jsp page, and
>>> also I want user to see about last 10 rows, because he need to see if
>>> there is any error.
>>> How can I do this, can I use table pagination (how) ?
>>> --
>>> Thx in advance, Milan Milanovic
>>> 
>>> 
>>> 
>> 
>> 
>> 
>> 
>> --
>> Jim Kiley
>> Technical Consultant | Summa
>> [p] 412.258.3346 [m] 412.445.1729
>> http://www.summa-tech.com
>> 
>> 
>> 
>> 
>> 



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: [struts 2] Table question

2008-05-13 Thread Felipe Lorenz
Hi!

To have a composed string you can do it in JSP.

Something like:


for example.

And, for pagination, try displayTag, its easy to use

Felipe A. Lorenz
www.idealogic.com.br

On Tue, May 13, 2008 at 12:00 PM, Milan Milanovic <[EMAIL PROTECTED]>
wrote:

> Thanks Jim!
> Could you give me an example for the second thing (pagination) ? I need
> something
> simple as you said.
> For combo box, how can I tell my combobox to retrieve data from list of
> composed
> strings (e.g. List where I will compose "1 Apple"), but when
> selected to choose
> in my action class from list of Fruits, e.g. List, where Fruit
> have id and name attributes ?
> --
> Thx, Milan Milanovic
>
>
> - Original Message 
> From: Jim Kiley <[EMAIL PROTECTED]>
> To: Struts Users Mailing List 
> Sent: Tuesday, May 13, 2008 3:34:58 PM
> Subject: Re: [struts 2] Table question
>
> I have to admit that in your first instance I would cheat -- I would dummy
> up a method somewhere on my action class or my POJO that returned the
> desired string, rather than trying to compose the string within the JSP.
>
> I am unfamiliar with the various tags that can be used to display chunks
> of
> a table.  I know they're out there (the display tag library comes to
> mind).
> The most recent time I had to do this I rolled my own; it was pretty
> painless.  I held the data in a List of data objects, and then used
> List.subList() in my action method to determine the precise chunk of the
> List that I wanted to show.
>
> Hope this helps.
>
> jk
>
> On Tue, May 13, 2008 at 9:30 AM, Milan Milanovic <
> [EMAIL PROTECTED]>
> wrote:
>
> > Hi,
> > first I'll ask again my earlier question, is there possibility to show
> in
> > a combo box
> > two values, for example I want to show id and name of the every fruit: 1
> > Apple ?
> > The second question is, my struts 2 application on one jsp page will
> have
> > 5 combo
> > boxes, 4 text boxes, two buttons and two datetime pickers, and below all
> > these controls a table
> > that will show what is entered using controls above. The problem is that
> > my table will have
> > about 100-120 records (rows) to show, and I think that is very much for
> > one jsp page, and
> > also I want user to see about last 10 rows, because he need to see if
> > there is any error.
> > How can I do this, can I use table pagination (how) ?
> > --
> > Thx in advance, Milan Milanovic
> >
> >
> >
>
>
>
>
> --
> Jim Kiley
> Technical Consultant | Summa
> [p] 412.258.3346 [m] 412.445.1729
> http://www.summa-tech.com
>
>
>
>
>


Re: JFreeChart plugin

2008-05-13 Thread Randy Burgess
I'm using an interceptor to store (and clear) a DefaultPieDataset in the
users session from actions that give me the data needed to create charts. My
chart action implements SessionAware and I get the dataset from the session.
I also created a package for the charts that extends struts-default because
the charts plugin doesn't define any interceptors AFAICT. I then get the
chart using an image tag in a modal window which calls my chart action.



  
150200
 
600200 


This type of configuration would work for your scenario also. If you have a
huge dataset then storing it in the session could cause an issue with
scalability. With a chart I wouldn¹t imagine that the dataset would be that
large though.

Regards,
Randy Burgess
Sr. Web Applications Developer
Nuvox Communications



> From: Leena Borle <[EMAIL PROTECTED]>
> Reply-To: Struts Users Mailing List 
> Date: Tue, 13 May 2008 13:50:00 -0700
> To: Struts Users Mailing List 
> Subject: Re: JFreeChart plugin
> 
> Hi,
>   I'm using Tomcat-5.5.25. I found out that, if I include action's url in
> , it gets displayed.
>   I am trying to display chart using Remote-Button/Remote-DIV method of S2.
> Which means when user submits form data, I need to display chart inside a
> DIV below this form. something like this ...
>   
>.
>   theme="ajax" targets="chart_div"
> cssClass="buttons" />
> 
> 
> 
> 
> 
>   Any idea how to achieve this without specifying action's URL directly
> to image tag ?
> 
> Leena
> 
> On Tue, May 13, 2008 at 11:45 AM, Randy Burgess <[EMAIL PROTECTED]> wrote:
> 
>> I used the example code from the documentation on WebLogic 9.2.2 and it
>> ran
>> fine. I built off that example code and now have several actions creating
>> nice 3D pie charts. Which application server are you using?
>> 
>> Regards,
>> Randy Burgess
>> Sr. Web Applications Developer
>> Nuvox Communications
>> 
>> 
>> 
>>> From: Leena Borle <[EMAIL PROTECTED]>
>>> Reply-To: Struts Users Mailing List 
>>> Date: Tue, 13 May 2008 10:41:57 -0700
>>> To: Struts Users Mailing List 
>>> Subject: JFreeChart plugin
>>> 
>>> Hello,
>>>   Has anyone tried out JFreeChart plugin? I am trying to run the sample
>> code
>>> available on plugin documentation page. I see all ASCII characters
>> getting
>>> printed on my browser screen instead of an image file.
>>>   Any help is appreciated.
>>> Thanks,
>>> Leena.
>> 
>> 
>> 
>> 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]
>> 
>> 



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.


Re: JFreeChart plugin

2008-05-13 Thread Felipe Lorenz
Hi, did you try put the action (DrawChart_display.action) in HREF attribute
of the DIV? I use js to do it!
Something like:
function refresh()
{
  var div = dojo.widget.byId('#div_id');
  div.href = 'DrawChart_display.action' + params_if_have;
  div.refresh();
}
Felipe Augusto Lorenz
www.idealogic.com.br
On Tue, May 13, 2008 at 5:50 PM, Leena Borle <[EMAIL PROTECTED]> wrote:

> Hi,
>  I'm using Tomcat-5.5.25. I found out that, if I include action's url in
> , it gets displayed.
>  I am trying to display chart using Remote-Button/Remote-DIV method of S2.
> Which means when user submits form data, I need to display chart inside a
> DIV below this form. something like this ...
>  
>   .
>  theme="ajax" targets="chart_div"
>cssClass="buttons" />
>
>
>
>
>
>  Any idea how to achieve this without specifying action's URL directly
> to image tag ?
>
> Leena
>
> On Tue, May 13, 2008 at 11:45 AM, Randy Burgess <[EMAIL PROTECTED]>
> wrote:
>
> > I used the example code from the documentation on WebLogic 9.2.2 and it
> > ran
> > fine. I built off that example code and now have several actions
> creating
> > nice 3D pie charts. Which application server are you using?
> >
> > Regards,
> > Randy Burgess
> > Sr. Web Applications Developer
> > Nuvox Communications
> >
> >
> >
> > > From: Leena Borle <[EMAIL PROTECTED]>
> > > Reply-To: Struts Users Mailing List 
> > > Date: Tue, 13 May 2008 10:41:57 -0700
> > > To: Struts Users Mailing List 
> > > Subject: JFreeChart plugin
> > >
> > > Hello,
> > >   Has anyone tried out JFreeChart plugin? I am trying to run the
> sample
> > code
> > > available on plugin documentation page. I see all ASCII characters
> > getting
> > > printed on my browser screen instead of an image file.
> > >   Any help is appreciated.
> > > Thanks,
> > > Leena.
> >
> >
> >
> > 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: JFreeChart plugin

2008-05-13 Thread Leena Borle
Hi,
  I'm using Tomcat-5.5.25. I found out that, if I include action's url in
, it gets displayed.
  I am trying to display chart using Remote-Button/Remote-DIV method of S2.
Which means when user submits form data, I need to display chart inside a
DIV below this form. something like this ...
  
   .
 





  Any idea how to achieve this without specifying action's URL directly
to image tag ?

Leena

On Tue, May 13, 2008 at 11:45 AM, Randy Burgess <[EMAIL PROTECTED]> wrote:

> I used the example code from the documentation on WebLogic 9.2.2 and it
> ran
> fine. I built off that example code and now have several actions creating
> nice 3D pie charts. Which application server are you using?
>
> Regards,
> Randy Burgess
> Sr. Web Applications Developer
> Nuvox Communications
>
>
>
> > From: Leena Borle <[EMAIL PROTECTED]>
> > Reply-To: Struts Users Mailing List 
> > Date: Tue, 13 May 2008 10:41:57 -0700
> > To: Struts Users Mailing List 
> > Subject: JFreeChart plugin
> >
> > Hello,
> >   Has anyone tried out JFreeChart plugin? I am trying to run the sample
> code
> > available on plugin documentation page. I see all ASCII characters
> getting
> > printed on my browser screen instead of an image file.
> >   Any help is appreciated.
> > Thanks,
> > Leena.
>
>
>
> 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: Dojo taglib?

2008-05-13 Thread Lukasz Lenart
Hi,

"To use the AJAX tags from 2.1 on you must:"

Reading http://struts.apache.org/2.x/docs/ajax-tags.html, this claims
>

You should read much more careful


Regards
-- 
Lukasz

http://www.linkedin.com/in/lukaszlenart
http://jdn.pl/blog/416
http://www.lenart.org.pl/


Re: Spring Security and Struts2 Using tiles

2008-05-13 Thread Antonio Petrelli
2008/5/13 Alberto A. Flores <[EMAIL PROTECTED]>:
> I would, but it seems to me like there is little that can be done on the
> Struts2 side (unless a plugin of some sort is written). Essentially, when
> control is forwarded to the tile, Spring security can not do much (or maybe
> I'm missing something).

I see...

>  The Spring Security team is well aware of (as far as forwards), that
> resources are not secured on forwards (which sucks, really, unless I'm doing
> something terribly wrong).

Great, at least the bug is not at Struts or Tiles side :-)

>  I'll see if I can create a subset of my current app describing the problem.
> Probably would post a war file? Is that what you meant?

Exactly, with the source.

Antonio

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



Re: Spring Security and Struts2 Using tiles

2008-05-13 Thread Alberto A. Flores
I would, but it seems to me like there is little that can be done on the 
Struts2 side (unless a plugin of some sort is written). Essentially, 
when control is forwarded to the tile, Spring security can not do much 
(or maybe I'm missing something).


The Spring Security team is well aware of (as far as forwards), that 
resources are not secured on forwards (which sucks, really, unless I'm 
doing something terribly wrong).


I'll see if I can create a subset of my current app describing the 
problem. Probably would post a war file? Is that what you meant?



Antonio Petrelli wrote:

2008/5/13 Alberto A. Flores <[EMAIL PROTECTED]>:

I don't thinks that's possible as the Struts2 result would be something
like:

 my.tile

 In here, I don't have access to the forward.


Mmm... it's starting to be complicated, and I think that there is a
bug somewhere.
Can you open a JIRA issue, attaching, if possible, a sample web application?

http://issues.apache.org/struts

Antonio

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




--

Alberto A. Flores
http://www.linkedin.com/in/aflores


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

Re: Spring Security and Struts2 Using tiles

2008-05-13 Thread Antonio Petrelli
2008/5/13 Alberto A. Flores <[EMAIL PROTECTED]>:
> I don't thinks that's possible as the Struts2 result would be something
> like:
>
>  my.tile
>
>  In here, I don't have access to the forward.

Mmm... it's starting to be complicated, and I think that there is a
bug somewhere.
Can you open a JIRA issue, attaching, if possible, a sample web application?

http://issues.apache.org/struts

Antonio

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



Re: Spring Security and Struts2 Using tiles

2008-05-13 Thread Alberto A. Flores
I don't thinks that's possible as the Struts2 result would be something 
like:


my.tile

In here, I don't have access to the forward.

Antonio Petrelli wrote:

2008/5/13 Alberto A. Flores <[EMAIL PROTECTED]>:

 My understanding is that Spring Security does not secure resources on
*forwards* (I believe tiles2 do forward/chaining).


Forwards and includes, that's where I think there may be a fault.
Can you try if, using simple  tags, the security tags work?

Antonio

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




--

Alberto A. Flores
http://www.linkedin.com/in/aflores


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

Re: Spring Security and Struts2 Using tiles

2008-05-13 Thread Antonio Petrelli
2008/5/13 Alberto A. Flores <[EMAIL PROTECTED]>:
>  My understanding is that Spring Security does not secure resources on
> *forwards* (I believe tiles2 do forward/chaining).

Forwards and includes, that's where I think there may be a fault.
Can you try if, using simple  tags, the security tags work?

Antonio

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



Spring Security and Struts2 Using tiles

2008-05-13 Thread Alberto A. Flores

Folks,

My understanding is that Spring Security does not secure resources on 
*forwards* (I believe tiles2 do forward/chaining). In an application 
using Struts2, Spring and Tiles2, these forwards work just fine. Has 
anyone had success using these three frameworks together using Spring 
Security? I tried it today and It turned out that the security tag 
(http://www.springframework/security/tags/):


  

never fetches anything. Furthermore, the code:

  SecurityContextHolder.getContext().getAuthentication()

returns null (in the forwarded jsp page). Has anyone know what to do in 
this case? I'm beginning to think I can not use Spring Security at all.


Regards,

--

Alberto A. Flores
http://www.linkedin.com/in/aflores


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

Re: JFreeChart plugin

2008-05-13 Thread Randy Burgess
I used the example code from the documentation on WebLogic 9.2.2 and it ran
fine. I built off that example code and now have several actions creating
nice 3D pie charts. Which application server are you using?

Regards,
Randy Burgess
Sr. Web Applications Developer
Nuvox Communications



> From: Leena Borle <[EMAIL PROTECTED]>
> Reply-To: Struts Users Mailing List 
> Date: Tue, 13 May 2008 10:41:57 -0700
> To: Struts Users Mailing List 
> Subject: JFreeChart plugin
> 
> Hello,
>   Has anyone tried out JFreeChart plugin? I am trying to run the sample code
> available on plugin documentation page. I see all ASCII characters getting
> printed on my browser screen instead of an image file.
>   Any help is appreciated.
> Thanks,
> Leena.



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]



Dojo taglib?

2008-05-13 Thread Michael Gagnon
Reading http://struts.apache.org/2.x/docs/ajax-tags.html, this claims
(reasonably) that I must add <%@ taglib prefix="sx" uri="/struts-dojo-tags"
%> in order to use the sx ajax tags. but it appears that the
/struts-dojo-tags uri is not available to me. Eclipse doesn't see it, and I
don't see such a tld in the struts distribution. I have included struts in
my project through maven with the dependency:

 



org.apache.struts

struts2-core

2.0.11



 

 

Downloading the struts-2.0.11.1-all.zip package directly from the struts
site also does not seem to [obviously, at least] include such a tld. Is the
documentation incorrect or do I misunderstand something?



Re: struts2 access session Id

2008-05-13 Thread Jakub Milkiewicz
I had the same idea when i mentioned Servlet Config Interceptor below but I
just thought there is an easier way.
Anyway thanks for reply and it looks like i need to do just like that.



2008/5/13 Laurie Harper <[EMAIL PROTECTED]>:

> Jakub Milkiewicz wrote:
>
> > Hi
> > I have a problem with Struts 2.
> > I am looking for a way to access httpsession id?
> >
> > I have tried using ActionContext.getContext().getSession().get("id") but
> > it
> > returns null. i 've read there is a possibility to use Servlet Config
> > Interceptor<
> > http://www.opensymphony.com/webwork/wikidocs/Servlet%20Config%20Interceptor.html
> > >
> > but i would not like to do it.
> >
>
> ActionContext.getSession() gives you access to the session scope
> attributes, not the session itself. To get to the actual session object,
> obtain the HttpServletRequest object [1] and get the session from there:
>
>HttpServletRequest request = ...; // use ActionContext or
> ServletRequuestAware
>
>HttpSession session = request.getSession();
>String sessionId = session.getId();
>
> L.
>
> [1]
> http://struts.apache.org/2.0.11.1/docs/how-can-we-access-the-httpservletrequest.html
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


JFreeChart plugin

2008-05-13 Thread Leena Borle
Hello,
  Has anyone tried out JFreeChart plugin? I am trying to run the sample code
available on plugin documentation page. I see all ASCII characters getting
printed on my browser screen instead of an image file.
  Any help is appreciated.
Thanks,
Leena.


Re: Tag Data Rendering Issue

2008-05-13 Thread Laurie Harper

Himanshu Rathore wrote:

When using  tag, the first character of error message is
automatically getting converted to upper case. I haven't set any
"text-transform" property in my CSS.

If I do "View Source", I see proper text but on JSP its behaving weirdly.

My CSS:
..errorMessage {
color: red;
font: 10px verdana, arial, helvetica, sans-serif;
}

In "View Source"

Please enter User Id


But on JSP, it is displayed as
Please Enter User Id

I have included struts.properties in my project classpath and have set *
struts.ui.theme=simple*

What could be the reason of this behaviour?


Sounds like *something* is applying a text-transform to the text. When 
you view source, what stylesheets do you see referenced? Are there any 

Re: Selecting a jsp according to locale

2008-05-13 Thread Laurie Harper

Dimitris Mouchritsas wrote:

Hi all,
I want to show a system requirements page according to the web page's 
locale.

Can I use the tiles-defs.xml to do it or I need to write code in a jsp?
Thanks


I'm not sure what you want to achieve. If you just want to localize the 
page, you can do so using the I18N facilities provided by Struts. If you 
actually need to render a different JSP per locale for some reason, it 
will be more involved. Either way, the specifics depend on which version 
of Struts you are using.


Try posting more details of exactly what it is you need to do, and what 
environment you are working in (Struts version, etc.).


L.


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



Re: struts2 access session Id

2008-05-13 Thread Laurie Harper

Jakub Milkiewicz wrote:

Hi
I have a problem with Struts 2.
I am looking for a way to access httpsession id?

I have tried using ActionContext.getContext().getSession().get("id") but it
returns null. i 've read there is a possibility to use Servlet Config
Interceptor
but i would not like to do it.


ActionContext.getSession() gives you access to the session scope 
attributes, not the session itself. To get to the actual session object, 
obtain the HttpServletRequest object [1] and get the session from there:


HttpServletRequest request = ...; // use ActionContext or 
ServletRequuestAware


HttpSession session = request.getSession();
String sessionId = session.getId();

L.

[1] 
http://struts.apache.org/2.0.11.1/docs/how-can-we-access-the-httpservletrequest.html



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



Re: File upload issue

2008-05-13 Thread Laurie Harper

Zoran Avtarovski wrote:

I¹m getting an error after uploading a file. Which manifests itself in my
redirect action.

I¹m using a simple post redirect pattern, where the file upload action
redirects to a separate fileList action.

After successfully uploading the file the browser is redirected to the
appropriate action, but Tomcat throws a
³ the request was rejected because its size is unknown ³ exception. If I
call the offending action from the browser it works fine.

Here¹s the relevant snippet from my struts.xml file:


/WEB-INF/cms/formFile.jsp
 
getFile
/cms




Any ideas would be appreciated.



Where is the exception thrown? During the first request before the 
redirect is sent? Or during the request resulting from the redirect? Is 
there any Ajax involved in handling the redirect? Assuming the exception 
happens in the redirected request and there's no Ajax, I'd suggest using 
LiveHeaders or Firebug in Firefox to examine the headers/body of the 
failing request to see if there's something quirky there.


L.


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



Tag Data Rendering Issue

2008-05-13 Thread Himanshu Rathore
When using  tag, the first character of error message is
automatically getting converted to upper case. I haven't set any
"text-transform" property in my CSS.

If I do "View Source", I see proper text but on JSP its behaving weirdly.

My CSS:
.errorMessage {
color: red;
font: 10px verdana, arial, helvetica, sans-serif;
}

In "View Source"

Please enter User Id


But on JSP, it is displayed as
Please Enter User Id

I have included struts.properties in my project classpath and have set *
struts.ui.theme=simple*

What could be the reason of this behaviour?


Ajax with Struts2

2008-05-13 Thread krishna chary
 My question is ...
When I use this code 
Business
in between action form ,then I got warning like WARNING: Parameters: Invalid
chunk ignored.  and ajax action is not performed.
please answer to my question very urgent


Re: Repopulating Select Lists after Validation Error

2008-05-13 Thread Laurie Harper

Asleson, Ryan wrote:
 
Hello,
 
We're transitioning from a Struts 1.x and Tiles development environment

to Struts 2 and Sitemesh, and I need some help getting around some of
the differences.
 
Here's what I'm planning so far.  I want to have an abstract BaseAction

that extends ActionSupport.  Since we are no longer using Tiles, we
can't count on using Tiles Controller classes to prepare a page for
display -- for example, retrieving the contents of drop down lists from
the database.  In my BaseAction, I have overridden the execute() method
to call a "lifecycle" method called prepareAction() that is meant to be
an extension point for subclasses to retrieve any data the is needed to
display the page.


Why add a custom lifecycle method? Why not just let sub-classes 
implement Preparable?



For example, let's say there's a drop-down select box on a page, and its
contents come from a database.  A concrete implementation of BaseAction
should override prepareAction() to retrieve the list items for the drop
down list.  


By implementing Preparable that logic would go in either prepare() or 
prepareInput() (where 'input' is the name of the method on the action 
that is called to display the form).



Now, here's where things get sticky:  Assume the page above is
displayed.  The user enters some form data and posts the page.  However,
there are some validation errors.  Struts 2 will automatically redisplay
the page but will the drop-down list be populated with list items,
or will it be empty?


If there are validation errors, Struts will forward control to the 
action result mapped as 'input'. You can either arrange for the 
drop-down list data to be loaded before validation fires (e.g. using 
Preparable.prepare()) or, if you don't want to perform that load during 
a successful form submit, you can do it as part of the 'input' result 
processing.



In the Struts 1.x/Tiles world, where we have a Tiles Controller backing
the JSP, the list items would be repopulated by the Controller.  But
with Tiles no longer in play, what will repopulate the list?  I'm pretty
sure that the prepareAction() method that was used when the page is
first displayed will not be called when there are validation errors,
resulting in an empty drop-down list.


If a validation error occurs, Struts will not call the action method for 
handling the form submit so no, you can't rely on a method being called 
from there in this case.



So, here are my questions:
 
1.  Is my idea to have a BaseAction that provides an extension point for

subclasses, where things like database access should occur, a bad idea?


Not necessarily a bad idea, but not necessarily optimal. For example, 
since your actions would all be dependent on super.execute() being 
invoked, it may make it messy to target other methods on the action 
(e.g. calling action.input() to setup and display a form and 
action.execute() to process it on submit).



2.  What is the recommended way to repopulate drop-down selects after a
validation error, if the list items need to be retrieved from a
database?


Take a look at  the Preparable interface and the 'prepare' interceptor 
for one approach. Another may be to use the 'action-chain' result type 
for your action's 'input' result mapping, and keep the data retrieval in 
the chained action.


I recommend taking a look at some of the example applications (e.g. 
Mailo Reader and Showcase) to see how this has been handled elsewhere. 
There's More Than One Way To Do It (TM) :-)


L.



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



Re: [struts 2] Two forms for one action

2008-05-13 Thread Jim Kiley








On Tue, May 13, 2008 at 11:44 AM, Milan Milanovic <[EMAIL PROTECTED]>
wrote:

> Hi,
> regarding multiple submit buttons for the same form, if I have  ...> with
> defined action (which is actually a method name in a action class), then
> my submit
> button calls that method. But, how can I define another submit button that
> will call
> another method of the same action class ?
> --
> Thx in advance, Milan
> - Original Message 
> From: Jim Kiley <[EMAIL PROTECTED]>
> To: Struts Users Mailing List 
> Sent: Monday, May 12, 2008 6:15:07 PM
> Subject: Re: [struts 2] Two forms for one action
>
> Milan,
>
> I'm not a Struts 1 guy, so this advice might not be useful to you (because
> you didn't say whether this was a Struts 1 or 2 situation). But in my
> Struts
> 2 app I have plenty of places where I have multiple  buttons
> each
> triggering different action methods on the same action class.
>
> jk
>
>
> On Mon, May 12, 2008 at 12:10 PM, Milan Milanovic <
> [EMAIL PROTECTED]>
> wrote:
>
> > Or maybe I should define two submit buttons for the same form and action
> > class ?
> > --
> > Regards, Milan
> >
> >
> > - Original Message 
> > From: Milan Milanovic <[EMAIL PROTECTED]>
> > To: Struts Users Mailing List 
> > Sent: Monday, May 12, 2008 5:57:50 PM
> > Subject: [struts 2] Two forms for one action
> >
> > Hi,
> > I need to have classic master/detail jsp page, so I need actually two
> > forms in a jsp page to works with one action class,
> > one main form that works with main elements of my object (e.g. User
> name,
> > surname,...) for header and another one which works
> > with some list that belongs to my main object (e.g., User.privileges)
> > below such header part. How can I define this ?
> > --
> > Thx, Milan Milanovic
> >
> >
> >
> >
> 
> > Be a better friend, newshound, and
> > know-it-all with Yahoo! Mobile.  Try it now.
> > http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ
> >
> >
> >
> >
> 
> > Be a better friend, newshound, and
> > know-it-all with Yahoo! Mobile.  Try it now.
> > http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ
> >
>
>
>
> --
> Jim Kiley
> Technical Consultant | Summa
> [p] 412.258.3346 [m] 412.445.1729
> http://www.summa-tech.com
>
>
>
>
>



-- 
Jim Kiley
Technical Consultant | Summa
[p] 412.258.3346 [m] 412.445.1729
http://www.summa-tech.com


Re: [struts 2] Two forms for one action

2008-05-13 Thread Milan Milanovic
Hi,
regarding multiple submit buttons for the same form, if I have  with
defined action (which is actually a method name in a action class), then my 
submit
button calls that method. But, how can I define another submit button that will 
call
another method of the same action class ?
--
Thx in advance, Milan
- Original Message 
From: Jim Kiley <[EMAIL PROTECTED]>
To: Struts Users Mailing List 
Sent: Monday, May 12, 2008 6:15:07 PM
Subject: Re: [struts 2] Two forms for one action

Milan,

I'm not a Struts 1 guy, so this advice might not be useful to you (because
you didn't say whether this was a Struts 1 or 2 situation). But in my Struts
2 app I have plenty of places where I have multiple  buttons each
triggering different action methods on the same action class.

jk


On Mon, May 12, 2008 at 12:10 PM, Milan Milanovic <[EMAIL PROTECTED]>
wrote:

> Or maybe I should define two submit buttons for the same form and action
> class ?
> --
> Regards, Milan
>
>
> - Original Message 
> From: Milan Milanovic <[EMAIL PROTECTED]>
> To: Struts Users Mailing List 
> Sent: Monday, May 12, 2008 5:57:50 PM
> Subject: [struts 2] Two forms for one action
>
> Hi,
> I need to have classic master/detail jsp page, so I need actually two
> forms in a jsp page to works with one action class,
> one main form that works with main elements of my object (e.g. User name,
> surname,...) for header and another one which works
> with some list that belongs to my main object (e.g., User.privileges)
> below such header part. How can I define this ?
> --
> Thx, Milan Milanovic
>
>
>
> 
> Be a better friend, newshound, and
> know-it-all with Yahoo! Mobile.  Try it now.
> http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ
>
>
>
>  
>
> Be a better friend, newshound, and
> know-it-all with Yahoo! Mobile.  Try it now.
> http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ
>



-- 
Jim Kiley
Technical Consultant | Summa
[p] 412.258.3346 [m] 412.445.1729
http://www.summa-tech.com



  

Selecting a jsp according to locale

2008-05-13 Thread Dimitris Mouchritsas

Hi all,
I want to show a system requirements page according to the web page's 
locale.

Can I use the tiles-defs.xml to do it or I need to write code in a jsp?
Thanks

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



Re: [struts 2] Two forms for one action

2008-05-13 Thread Milan Milanovic
Thank you Randy.
>They could, if it were me I would have different methods on the action class
>to handle the different forms if I were to do it this way. Personally I
>would create an action class for each form.

No, I cannot do this, because both forms need to work with the same objects in
a action class. First form works with some header data, and the second with list
of data and show table also of such data.
I asked this, because I wasn't sure if both forms would call the same instance 
of
action class.
--
Thx, Milan Milanovic
- Original Message 
From: Randy Burgess <[EMAIL PROTECTED]>
To: Struts Users Mailing List 
Sent: Tuesday, May 13, 2008 5:09:19 PM
Subject: Re: [struts 2] Two forms for one action

They could, if it were me I would have different methods on the action class
to handle the different forms if I were to do it this way. Personally I
would create an action class for each form.

Regards,
Randy Burgess
Sr. Web Applications Developer
Nuvox Communications



> From: Milan Milanovic <[EMAIL PROTECTED]>
> Reply-To: Struts Users Mailing List 
> Date: Tue, 13 May 2008 07:58:29 -0700 (PDT)
> To: Struts Users Mailing List 
> Subject: Re: [struts 2] Two forms for one action
> 
> I have one more question about this, if I define two  in one page
> would
> they work with the same action class ?
> 
> --
> Thx, Milan Milanovic
> - Original Message 
> From: Jim Kiley <[EMAIL PROTECTED]>
> To: Struts Users Mailing List 
> Sent: Monday, May 12, 2008 6:15:07 PM
> Subject: Re: [struts 2] Two forms for one action
> 
> Milan,
> 
> I'm not a Struts 1 guy, so this advice might not be useful to you (because
> you didn't say whether this was a Struts 1 or 2 situation). But in my Struts
> 2 app I have plenty of places where I have multiple  buttons each
> triggering different action methods on the same action class.
> 
> jk
> 
> 
> On Mon, May 12, 2008 at 12:10 PM, Milan Milanovic <[EMAIL PROTECTED]>
> wrote:
> 
>> Or maybe I should define two submit buttons for the same form and action
>> class ?
>> --
>> Regards, Milan
>> 
>> 
>> - Original Message 
>> From: Milan Milanovic <[EMAIL PROTECTED]>
>> To: Struts Users Mailing List 
>> Sent: Monday, May 12, 2008 5:57:50 PM
>> Subject: [struts 2] Two forms for one action
>> 
>> Hi,
>> I need to have classic master/detail jsp page, so I need actually two
>> forms in a jsp page to works with one action class,
>> one main form that works with main elements of my object (e.g. User name,
>> surname,...) for header and another one which works
>> with some list that belongs to my main object (e.g., User.privileges)
>> below such header part. How can I define this ?
>> --
>> Thx, Milan Milanovic
>> 
>> 
>> 
>> _
>> ___
>> Be a better friend, newshound, and
>> know-it-all with Yahoo! Mobile.  Try it now.
>> http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ 
>> 
>> 
>> 
>>   
>> _
>> ___
>> Be a better friend, newshound, and
>> know-it-all with Yahoo! Mobile.  Try it now.
>> http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ 
>> 
> 
> 
> 
> -- 
> Jim Kiley
> Technical Consultant | Summa
> [p] 412.258.3346 [m] 412.445.1729
> http://www.summa-tech.com 
> 
> 
> 



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.



  

Re: [struts 2] Two forms for one action

2008-05-13 Thread Randy Burgess
They could, if it were me I would have different methods on the action class
to handle the different forms if I were to do it this way. Personally I
would create an action class for each form.

Regards,
Randy Burgess
Sr. Web Applications Developer
Nuvox Communications



> From: Milan Milanovic <[EMAIL PROTECTED]>
> Reply-To: Struts Users Mailing List 
> Date: Tue, 13 May 2008 07:58:29 -0700 (PDT)
> To: Struts Users Mailing List 
> Subject: Re: [struts 2] Two forms for one action
> 
> I have one more question about this, if I define two  in one page
> would
> they work with the same action class ?
> 
> --
> Thx, Milan Milanovic
> - Original Message 
> From: Jim Kiley <[EMAIL PROTECTED]>
> To: Struts Users Mailing List 
> Sent: Monday, May 12, 2008 6:15:07 PM
> Subject: Re: [struts 2] Two forms for one action
> 
> Milan,
> 
> I'm not a Struts 1 guy, so this advice might not be useful to you (because
> you didn't say whether this was a Struts 1 or 2 situation). But in my Struts
> 2 app I have plenty of places where I have multiple  buttons each
> triggering different action methods on the same action class.
> 
> jk
> 
> 
> On Mon, May 12, 2008 at 12:10 PM, Milan Milanovic <[EMAIL PROTECTED]>
> wrote:
> 
>> Or maybe I should define two submit buttons for the same form and action
>> class ?
>> --
>> Regards, Milan
>> 
>> 
>> - Original Message 
>> From: Milan Milanovic <[EMAIL PROTECTED]>
>> To: Struts Users Mailing List 
>> Sent: Monday, May 12, 2008 5:57:50 PM
>> Subject: [struts 2] Two forms for one action
>> 
>> Hi,
>> I need to have classic master/detail jsp page, so I need actually two
>> forms in a jsp page to works with one action class,
>> one main form that works with main elements of my object (e.g. User name,
>> surname,...) for header and another one which works
>> with some list that belongs to my main object (e.g., User.privileges)
>> below such header part. How can I define this ?
>> --
>> Thx, Milan Milanovic
>> 
>> 
>> 
>> _
>> ___
>> Be a better friend, newshound, and
>> know-it-all with Yahoo! Mobile.  Try it now.
>> http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ
>> 
>> 
>> 
>>   
>> _
>> ___
>> Be a better friend, newshound, and
>> know-it-all with Yahoo! Mobile.  Try it now.
>> http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ
>> 
> 
> 
> 
> -- 
> Jim Kiley
> Technical Consultant | Summa
> [p] 412.258.3346 [m] 412.445.1729
> http://www.summa-tech.com
> 
> 
> 



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.


Re: [struts 2] Table question

2008-05-13 Thread Milan Milanovic
Thanks Jim! 
Could you give me an example for the second thing (pagination) ? I need 
something
simple as you said.
For combo box, how can I tell my combobox to retrieve data from list of composed
strings (e.g. List where I will compose "1 Apple"), but when selected 
to choose
in my action class from list of Fruits, e.g. List, where Fruit have id 
and name attributes ? 
--
Thx, Milan Milanovic


- Original Message 
From: Jim Kiley <[EMAIL PROTECTED]>
To: Struts Users Mailing List 
Sent: Tuesday, May 13, 2008 3:34:58 PM
Subject: Re: [struts 2] Table question

I have to admit that in your first instance I would cheat -- I would dummy
up a method somewhere on my action class or my POJO that returned the
desired string, rather than trying to compose the string within the JSP.

I am unfamiliar with the various tags that can be used to display chunks of
a table.  I know they're out there (the display tag library comes to mind).
The most recent time I had to do this I rolled my own; it was pretty
painless.  I held the data in a List of data objects, and then used
List.subList() in my action method to determine the precise chunk of the
List that I wanted to show.

Hope this helps.

jk

On Tue, May 13, 2008 at 9:30 AM, Milan Milanovic <[EMAIL PROTECTED]>
wrote:

> Hi,
> first I'll ask again my earlier question, is there possibility to show in
> a combo box
> two values, for example I want to show id and name of the every fruit: 1
> Apple ?
> The second question is, my struts 2 application on one jsp page will have
> 5 combo
> boxes, 4 text boxes, two buttons and two datetime pickers, and below all
> these controls a table
> that will show what is entered using controls above. The problem is that
> my table will have
> about 100-120 records (rows) to show, and I think that is very much for
> one jsp page, and
> also I want user to see about last 10 rows, because he need to see if
> there is any error.
> How can I do this, can I use table pagination (how) ?
> --
> Thx in advance, Milan Milanovic
>
>
>




-- 
Jim Kiley
Technical Consultant | Summa
[p] 412.258.3346 [m] 412.445.1729
http://www.summa-tech.com



  

Re: [struts 2] Two forms for one action

2008-05-13 Thread Milan Milanovic
I have one more question about this, if I define two  in one page would
they work with the same action class ?

--
Thx, Milan Milanovic
- Original Message 
From: Jim Kiley <[EMAIL PROTECTED]>
To: Struts Users Mailing List 
Sent: Monday, May 12, 2008 6:15:07 PM
Subject: Re: [struts 2] Two forms for one action

Milan,

I'm not a Struts 1 guy, so this advice might not be useful to you (because
you didn't say whether this was a Struts 1 or 2 situation). But in my Struts
2 app I have plenty of places where I have multiple  buttons each
triggering different action methods on the same action class.

jk


On Mon, May 12, 2008 at 12:10 PM, Milan Milanovic <[EMAIL PROTECTED]>
wrote:

> Or maybe I should define two submit buttons for the same form and action
> class ?
> --
> Regards, Milan
>
>
> - Original Message 
> From: Milan Milanovic <[EMAIL PROTECTED]>
> To: Struts Users Mailing List 
> Sent: Monday, May 12, 2008 5:57:50 PM
> Subject: [struts 2] Two forms for one action
>
> Hi,
> I need to have classic master/detail jsp page, so I need actually two
> forms in a jsp page to works with one action class,
> one main form that works with main elements of my object (e.g. User name,
> surname,...) for header and another one which works
> with some list that belongs to my main object (e.g., User.privileges)
> below such header part. How can I define this ?
> --
> Thx, Milan Milanovic
>
>
>
> 
> Be a better friend, newshound, and
> know-it-all with Yahoo! Mobile.  Try it now.
> http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ
>
>
>
>  
>
> Be a better friend, newshound, and
> know-it-all with Yahoo! Mobile.  Try it now.
> http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ
>



-- 
Jim Kiley
Technical Consultant | Summa
[p] 412.258.3346 [m] 412.445.1729
http://www.summa-tech.com



  

struts2 access session Id

2008-05-13 Thread Jakub Milkiewicz
Hi
I have a problem with Struts 2.
I am looking for a way to access httpsession id?

I have tried using ActionContext.getContext().getSession().get("id") but it
returns null. i 've read there is a possibility to use Servlet Config
Interceptor
but i would not like to do it.

Any help

milo


tag with Validation problem

2008-05-13 Thread Håken Stark
Hi,

I'm facing a problem when I'm using a Struts form with client validation on a 
jsp page which is remotely fetch from a . This div is a tabpanel inside 
a  tabcontainer. When the form is submitted the following error 
displays inside the sx:div: 'ReferenceError: validateForm_saveProducer is not 
defined' (Firefox). The code is displayed below (Struts 2.1.2):

-- editProducer.jsp --




...





-- mainPage.jsp with tabbedpanel --







It looks like the validation script is not included when the jsp page is 
fetched remotely from the struts div tag. The problem occurs on both Struts 
version 2.0.11.1 and 2.1.2. Adding the executeScripts="true" and 
separateScripts="true" to the sx:div also has no effect. Any ideas!?

- Håken

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



Re: [struts 2] Table question

2008-05-13 Thread Jim Kiley
I have to admit that in your first instance I would cheat -- I would dummy
up a method somewhere on my action class or my POJO that returned the
desired string, rather than trying to compose the string within the JSP.

I am unfamiliar with the various tags that can be used to display chunks of
a table.  I know they're out there (the display tag library comes to mind).
The most recent time I had to do this I rolled my own; it was pretty
painless.  I held the data in a List of data objects, and then used
List.subList() in my action method to determine the precise chunk of the
List that I wanted to show.

Hope this helps.

jk

On Tue, May 13, 2008 at 9:30 AM, Milan Milanovic <[EMAIL PROTECTED]>
wrote:

> Hi,
> first I'll ask again my earlier question, is there possibility to show in
> a combo box
> two values, for example I want to show id and name of the every fruit: 1
> Apple ?
> The second question is, my struts 2 application on one jsp page will have
> 5 combo
> boxes, 4 text boxes, two buttons and two datetime pickers, and below all
> these controls a table
> that will show what is entered using controls above. The problem is that
> my table will have
> about 100-120 records (rows) to show, and I think that is very much for
> one jsp page, and
> also I want user to see about last 10 rows, because he need to see if
> there is any error.
> How can I do this, can I use table pagination (how) ?
> --
> Thx in advance, Milan Milanovic
>
>
>




-- 
Jim Kiley
Technical Consultant | Summa
[p] 412.258.3346 [m] 412.445.1729
http://www.summa-tech.com


[struts 2] Table question

2008-05-13 Thread Milan Milanovic
Hi,
first I'll ask again my earlier question, is there possibility to show in a 
combo box
two values, for example I want to show id and name of the every fruit: 1 Apple ?
The second question is, my struts 2 application on one jsp page will have 5 
combo
boxes, 4 text boxes, two buttons and two datetime pickers, and below all these 
controls a table
that will show what is entered using controls above. The problem is that my 
table will have
about 100-120 records (rows) to show, and I think that is very much for one jsp 
page, and
also I want user to see about last 10 rows, because he need to see if there is 
any error. 
How can I do this, can I use table pagination (how) ?
--
Thx in advance, Milan Milanovic


  

Re: redirect after logging in

2008-05-13 Thread Rushikesh Thakkar
Hi,

Check out the login-interceptor in Mail-Reader application given on Planet
Struts. I found it useful. I think you are also looking for the same.
http://www.planetstruts.org/struts2-mailreader/Tour.do

(The application may be down sometimes, you can refer to cached pages in
Google search for the same.)

-Rushikesh

On Mon, May 12, 2008 at 1:35 PM, Laurie Harper <[EMAIL PROTECTED]> wrote:

> Acegi / Spring Security can certainly get this done, but may be overkill
> if the authentication and authorization requirements are simple. Container
> Managed Security is probably the quickest and easiest way to get the
> described behaviour, but that also doesn't always fit. For a home-brewed
> custom solution a Struts2 interceptor or simply a servlet filter will give
> more flexibility.
>
> So, the answer is yes, this can be achieved using interceptors. What
> specifically do you need help with?
>
> L.
>
>
> Jim Kiley wrote:
>
> > I wouldn't implement it with interceptors so much as I'd look into
> > something
> > like Acegi Security (now Spring Security if I remember right).  I'm
> > having a
> > decent level of success on an Acegi / Sitemesh / Struts 2 / Spring /
> > Hibernate project right now.
> >
> > jk
> >
> > On Fri, May 9, 2008 at 6:01 PM, Jaarthy <[EMAIL PROTECTED]> wrote:
> >
> >  Hi,
> > >
> > > I'm trying to implement a scenario in which if the user who has not
> > > logged
> > > in clicks on a page "for logged in users only"  should be
> > > redirected to "login page", and then after logging in he should be
> > > redirected to the page he originally requested for.
> > >
> > > I need to implement this in struts2.Can I achieve this using
> > > Interceptors?Kindly help.
> > >
> > > Thanks,
> > > Aarthy
> > >
> > > --
> > > View this message in context:
> > >
> > > http://www.nabble.com/redirect-after-logging-in-tp17157183p17157183.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: Setting HTML form parameters to Custom classes (not action support)

2008-05-13 Thread Jim Kiley
I would handle this by creating an ordinary Java class for the page, and
then having the following fields:

public class MyAction {
C1 a;
C2 b;
C3 c;

//...
}

...and make sure I had a public getA() and setA(), getB() and setB(), and so
on.

If you need to preset values for a, b, and c, one option is to have MyAction
implement Preparable, and put the pre-population in the prepare() method
that it requires.

jk

On Tue, May 13, 2008 at 1:16 AM, ravi_eze <[EMAIL PROTECTED]>
wrote:

>
> hi,
>
> we have multiple classes (C1,C2,C3) each as java beans. now i have a form
> as:
> 
> 
> 
> 
>
> is it possible for me to populate the individual classes? The problem is
> that we need to build a framework in struts2 and it requires the above to
> happen.
>
> After googling a lot... i found that that the current ActionSupport class
> is
> kept in ognl value stack which is later filled. If this is true then can
> we
> push the C1's object as a, C2's object as b etc into value stack???
>
> Also, ModelInterceptor... would also push the object to the value stack.
> But
> my problem is that i need all the 3 objects into the stack...
>
> please correct me if i am wrong... any help would be great...
>
> cheers,
> ravi
> --
> View this message in context:
> http://www.nabble.com/Setting-HTML-form-parameters-to-Custom-classes-%28not-action-support%29-tp17201248p17201248.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]
>
>


-- 
Jim Kiley
Technical Consultant | Summa
[p] 412.258.3346 [m] 412.445.1729
http://www.summa-tech.com


Re: hi, what is the difference between specify time out and do not specify the timeout value in the web.xml file

2008-05-13 Thread Alberto A. Flores

Please include container type, version, etc, etc.

Laurie Harper wrote:

shrimpywu wrote:
hi, what is the difference between specify time out and do not specify 
the

timeout value in the web.xml file

   
30
 


According to the Servlet specification, if you don't specify this 
session timeout will be set to the container's default (which will be 
server dependent).



before, i do not specify this in the web.xml file
when the session has been timeout, i sometime got some exception

but after i did that..no exception any more..why???


Without even knowing what the exception was there's no way to guess. 
You'd probably be better off trying to diagnose why the exception occurs 
in the first place, rather than ask why it goes away.


L.


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




--

Alberto A. Flores
http://www.linkedin.com/in/aflores


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

Struts2 & Tiles2

2008-05-13 Thread Pro1712

Hallo,

I'm new to struts so this may be a simple question for experts...

I started developing a classical webapp: Header and Menu on top, navigation
on the left side and details on the right side. When the user selects an
item in the navigation, the detail is displayed on the right side.

Depending on the detail, the user now can navigate and open the edit dialog
for the detail. The edit dialog should replace the detail. The user press
the save or cancel button on the edit dialog an show be redirected to the
detail again.
Depending on the detail and the user action, the header, menu and / or
navigation can change.

I want to only relaod the parts of the page that need to be changed maybe
using AJAX.

So far I use Struts 2.1.2 and Tiles 2.0.5.
But I could not find out how to "fill" tiles-definition with the action and
parameters from the navigation
How can I do this?

What is best practise for my problem?
How do you solve this?


Thanks for your help!
-- 
View this message in context: 
http://www.nabble.com/Struts2---Tiles2-tp17206560p17206560.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]



File upload issue

2008-05-13 Thread Zoran Avtarovski
I¹m getting an error after uploading a file. Which manifests itself in my
redirect action.

I¹m using a simple post redirect pattern, where the file upload action
redirects to a separate fileList action.

After successfully uploading the file the browser is redirected to the
appropriate action, but Tomcat throws a
³ the request was rejected because its size is unknown ³ exception. If I
call the offending action from the browser it works fine.

Here¹s the relevant snippet from my struts.xml file:


/WEB-INF/cms/formFile.jsp
 
getFile
/cms




Any ideas would be appreciated.

Z.