Author Login
Post Reply
user Digest 6 Aug 2008 22:12:51 -0000 Issue 8182
Topics (messages 189770 through 189788):
Re: OGNL Help
189770 by: Brad A Cupit
Re: [S2] Refactoring Action classes
189771 by: Milan Milanovic
189772 by: Dave Newton
189773 by: Milan Milanovic
189774 by: Nils-Helge Garli Hegvik
189775 by: Dave Newton
189776 by: Dave Newton
189777 by: Jeoffrey Bakker
189783 by: Milan Milanovic
189784 by: Milan Milanovic
189785 by: Dave Newton
189787 by: Milan Milanovic
Re: Struts 2 And JFreeChart
189778 by: dynamicd
189779 by: dynamicd
189781 by: Dave Newton
189782 by: dynamicd
189786 by: Leena Borle
Handling general multipart file posts
189780 by: dm_thor
help with radio button array
189788 by: cpanon
Administrivia:
---------------------------------------------------------------------
To post to the list, e-mail: user@(protected)
To unsubscribe, e-mail: user-digest-unsubscribe@(protected)
For additional commands, e-mail: user-digest-help@(protected)
----------------------------------------------------------------------

Attachment:
user_189770.ezm (zipped)Zoran Avtarovski <zoran@(protected):
> reflection has a heavy performance
> penalty and from what I've seen of OGNL
Just a quick side note, with modern JVMs (1.4 and later) the reflection penalty is significantly reduced. IMHO, reflection is quite fast.
And OGNL uses reflection internally :-)
(note, OGNL 2.7+ can generate bytecode rather than use reflection, but from what I understand, a different API must be used to get the benefits)
Brad Cupit
Louisiana State University - UIS

Attachment:
user_189771.ezm (zipped)
I don't understand, but enabled cookies is defualt behavior, isn't it ?
--
Regards, Milan
newton.dave wrote:
>
> --- On Wed, 8/6/08, Milan Milanovic <milanmilanovich@(protected):
>> No, my cookies are enabled all the time. But if my JSessionID is not
>> automatically appended to the new location by container/struts2 in
>> case of redirect action, why ?
>
> Probably because cookies are enabled all the time.
>
> Dave
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>
>
--
Sent from the Struts - User mailing list archive at Nabble.com.

Attachment:
user_189772.ezm (zipped)--- On Wed, 8/6/08, Milan Milanovic wrote:
> newton.dave wrote:
>> --- On Wed, 8/6/08, Milan Milanovic wrote:
>>> No, my cookies are enabled all the time. But if my
>>> JSessionID is not automatically appended to the new
>>> location by container/struts2 in case of redirect action, why ?
>>
>> Probably because cookies are enabled all the time.
>
> I don't understand, but enabled cookies is defualt
> behavior, isn't it ?
Passing the session ID in the link is the workaround for someone not having their cookies enabled. It'll also happen on the first page hit because it can't tell if cookies are enabled.
I think most users have cookies enabled, although since it's a browser issue I'd hesitate to call almost anything "default".
Another reason you could lose session is moving between HTTP and HTTPS; some servers will use a different session. I'm assuming they all have a way to share the session, though.
Dave

Attachment:
user_189773.ezm (zipped)
Dear Dave,
I don't know really, I don't use HTTPS, my cookies are enabled, my redirect
action deleted my session variables, when I changed this action to standard
action it worked, NO other part of the code is changed.
--
Milan
newton.dave wrote:
>
> --- On Wed, 8/6/08, Milan Milanovic wrote:
>> newton.dave wrote:
>>> --- On Wed, 8/6/08, Milan Milanovic wrote:
>>>> No, my cookies are enabled all the time. But if my
>>>> JSessionID is not automatically appended to the new
>>>> location by container/struts2 in case of redirect action, why ?
>>>
>>> Probably because cookies are enabled all the time.
>>
>> I don't understand, but enabled cookies is defualt
>> behavior, isn't it ?
>
> Passing the session ID in the link is the workaround for someone not
> having their cookies enabled. It'll also happen on the first page hit
> because it can't tell if cookies are enabled.
>
> I think most users have cookies enabled, although since it's a browser
> issue I'd hesitate to call almost anything "default".
>
> Another reason you could lose session is moving between HTTP and HTTPS;
> some servers will use a different session. I'm assuming they all have a
> way to share the session, though.
>
> Dave
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>
>
--
Sent from the Struts - User mailing list archive at Nabble.com.

Attachment:
user_189774.ezm (zipped)And you're sure it's a session attribute and not a request attribute?
Nils-H
On Wed, Aug 6, 2008 at 6:49 PM, Milan Milanovic
<milanmilanovich@(protected):
>
> Dear Dave,
>
> I don't know really, I don't use HTTPS, my cookies are enabled, my redirect
> action deleted my session variables, when I changed this action to standard
> action it worked, NO other part of the code is changed.
>
> --
> Milan
>
>
> newton.dave wrote:
>>
>> --- On Wed, 8/6/08, Milan Milanovic wrote:
>>> newton.dave wrote:
>>>> --- On Wed, 8/6/08, Milan Milanovic wrote:
>>>>> No, my cookies are enabled all the time. But if my
>>>>> JSessionID is not automatically appended to the new
>>>>> location by container/struts2 in case of redirect action, why ?
>>>>
>>>> Probably because cookies are enabled all the time.
>>>
>>> I don't understand, but enabled cookies is defualt
>>> behavior, isn't it ?
>>
>> Passing the session ID in the link is the workaround for someone not
>> having their cookies enabled. It'll also happen on the first page hit
>> because it can't tell if cookies are enabled.
>>
>> I think most users have cookies enabled, although since it's a browser
>> issue I'd hesitate to call almost anything "default".
>>
>> Another reason you could lose session is moving between HTTP and HTTPS;
>> some servers will use a different session. I'm assuming they all have a
>> way to share the session, though.
>>
>> Dave
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@(protected)
>> For additional commands, e-mail: user-help@(protected)
>>
>>
>>
>
> --
> View this message in context: http://www.nabble.com/-S2--Refactoring-Action-classes-tp18813229p18855185.html
> Sent from the Struts - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>

Attachment:
user_189775.ezm (zipped)--- On Wed, 8/6/08, Milan Milanovic <milanmilanovich@(protected):
> I don't know really, I don't use HTTPS, my cookies are enabled, my
> redirect action deleted my session variables, when I changed this
> action to standard action it worked, NO other part of the code is
> changed.
What do you mean, standard action?
Step through the S2 code: tell me where S2 is deleting your session variables.
Put a monitoring interceptor between every interceptor on the stack and tell me which interceptor is deleting your session variables.
Log the actual HttpSession and tell me it's the same session object being logged across action invocations.
Define your own result type by copying the existing redirectAction result and add logging to determine when (and how) it's deleting your session variables.
Create a minimal application that reproduces the problem and file a JIRA. Be **thorough** in your description (for example, originally you left out the bit about Acegi).
Does it exhibit the same behavior if you deactivate Acegi?
Dave

Attachment:
user_189776.ezm (zipped)Some request parameters are prohibited, too, but those aren't session attributes.
Dave
--- On Wed, 8/6/08, Milan Milanovic <milanmilanovich@(protected):
> From: Milan Milanovic <milanmilanovich@(protected)>
> Subject: Re: [S2] Refactoring Action classes
> To: user@(protected)
> Date: Wednesday, August 6, 2008, 12:49 PM
> Dear Dave,
>
> I don't know really, I don't use HTTPS, my cookies
> are enabled, my redirect
> action deleted my session variables, when I changed this
> action to standard
> action it worked, NO other part of the code is changed.
>
> --
> Milan
>
>
> newton.dave wrote:
> >
> > --- On Wed, 8/6/08, Milan Milanovic wrote:
> >> newton.dave wrote:
> >>> --- On Wed, 8/6/08, Milan Milanovic wrote:
> >>>> No, my cookies are enabled all the time.
> But if my
> >>>> JSessionID is not automatically appended
> to the new
> >>>> location by container/struts2 in case of
> redirect action, why ?
> >>>
> >>> Probably because cookies are enabled all the
> time.
> >>
> >> I don't understand, but enabled cookies is
> defualt
> >> behavior, isn't it ?
> >
> > Passing the session ID in the link is the workaround
> for someone not
> > having their cookies enabled. It'll also happen on
> the first page hit
> > because it can't tell if cookies are enabled.
> >
> > I think most users have cookies enabled, although
> since it's a browser
> > issue I'd hesitate to call almost anything
> "default".
> >
> > Another reason you could lose session is moving
> between HTTP and HTTPS;
> > some servers will use a different session. I'm
> assuming they all have a
> > way to share the session, though.
> >
> > Dave
> >
> >
> >
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> user-unsubscribe@(protected)
> > For additional commands, e-mail:
> user-help@(protected)
> >
> >
> >
>
> --
> View this message in context:
> http://www.nabble.com/-S2--Refactoring-Action-classes-tp18813229p18855185.html
> Sent from the Struts - User mailing list archive at
> Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail:
> user-help@(protected)

Attachment:
user_189777.ezm (zipped)Maybe adding a session listener to your web.xml is a little bit easier.
E.g. a listener like below
import
javax.servlet.http.HttpSessionAttributeListener;
import
javax.servlet.http.HttpSessionBindingEvent;
import
javax.servlet.http.HttpSessionEvent;
import
javax.servlet.http.HttpSessionListener;
public class DebugSessionListener implements HttpSessionAttributeListener,
HttpSessionListener {
@Override
public void attributeAdded(HttpSessionBindingEvent arg0) {
}
@Override
public void attributeRemoved(HttpSessionBindingEvent arg0) {
Thread.dumpStack();
}
@Override
public void attributeReplaced(HttpSessionBindingEvent arg0) {
Thread.dumpStack();
}
@Override
public void sessionCreated(HttpSessionEvent arg0) {
Thread.dumpStack();
}
@Override
public void sessionDestroyed(HttpSessionEvent arg0) {
Thread.dumpStack();
}
}
Greetings,
Jeoffrey
2008/8/6 Dave Newton <newton.dave@(protected)>:
> --- On Wed, 8/6/08, Milan Milanovic <milanmilanovich@(protected):
> > I don't know really, I don't use HTTPS, my cookies are enabled, my
> > redirect action deleted my session variables, when I changed this
> > action to standard action it worked, NO other part of the code is
> > changed.
>
> What do you mean, standard action?
>
> Step through the S2 code: tell me where S2 is deleting your session
> variables.
>
> Put a monitoring interceptor between every interceptor on the stack and
> tell me which interceptor is deleting your session variables.
>
> Log the actual HttpSession and tell me it's the same session object being
> logged across action invocations.
>
> Define your own result type by copying the existing redirectAction result
> and add logging to determine when (and how) it's deleting your session
> variables.
>
> Create a minimal application that reproduces the problem and file a JIRA.
> Be **thorough** in your description (for example, originally you left out
> the bit about Acegi).
>
> Does it exhibit the same behavior if you deactivate Acegi?
>
> Dave
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>

Attachment:
user_189783.ezm (zipped)
Dear Dave,
Standard action is no redirect action.
My session variables was deleted somewhere between my action class method
and its resulting jsp, because in my action class method I had that
variable, and in jsp I don't have it any more.
O.K. I can put monitoring interceptor or listener like Jeoffrey suggested
(thanks). But now I changed my redirecting action to "normal" action, and it
is working. I must roll-back this change in my struts.xml ;-).
Put a monitoring interceptor between every interceptor on the stack and tell
me which interceptor is deleting your session variables.
Yes, indeed I didn't mention Acegi, as I didn't realize that it is imporant
for this kind of a problem. I didn't try without Acegi.
--
Regards, Milan
newton.dave wrote:
>
> --- On Wed, 8/6/08, Milan Milanovic <milanmilanovich@(protected):
>> I don't know really, I don't use HTTPS, my cookies are enabled, my
>> redirect action deleted my session variables, when I changed this
>> action to standard action it worked, NO other part of the code is
>> changed.
>
> What do you mean, standard action?
>
> Step through the S2 code: tell me where S2 is deleting your session
> variables.
>
> Put a monitoring interceptor between every interceptor on the stack and
> tell me which interceptor is deleting your session variables.
>
> Log the actual HttpSession and tell me it's the same session object being
> logged across action invocations.
>
> Define your own result type by copying the existing redirectAction result
> and add logging to determine when (and how) it's deleting your session
> variables.
>
> Create a minimal application that reproduces the problem and file a JIRA.
> Be **thorough** in your description (for example, originally you left out
> the bit about Acegi).
>
> Does it exhibit the same behavior if you deactivate Acegi?
>
> Dave
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>
>
--
Sent from the Struts - User mailing list archive at Nabble.com.

Attachment:
user_189784.ezm (zipped)
Hi Nils-Helge,
yes, I only use session attribute in my action class which implements
SessionAware interface.
--
Regards, Milan
Nils-Helge Garli wrote:
>
> And you're sure it's a session attribute and not a request attribute?
>
> Nils-H
>
> On Wed, Aug 6, 2008 at 6:49 PM, Milan Milanovic
> <milanmilanovich@(protected):
>>
>> Dear Dave,
>>
>> I don't know really, I don't use HTTPS, my cookies are enabled, my
>> redirect
>> action deleted my session variables, when I changed this action to
>> standard
>> action it worked, NO other part of the code is changed.
>>
>> --
>> Milan
>>
>>
>> newton.dave wrote:
>>>
>>> --- On Wed, 8/6/08, Milan Milanovic wrote:
>>>> newton.dave wrote:
>>>>> --- On Wed, 8/6/08, Milan Milanovic wrote:
>>>>>> No, my cookies are enabled all the time. But if my
>>>>>> JSessionID is not automatically appended to the new
>>>>>> location by container/struts2 in case of redirect action, why ?
>>>>>
>>>>> Probably because cookies are enabled all the time.
>>>>
>>>> I don't understand, but enabled cookies is defualt
>>>> behavior, isn't it ?
>>>
>>> Passing the session ID in the link is the workaround for someone not
>>> having their cookies enabled. It'll also happen on the first page hit
>>> because it can't tell if cookies are enabled.
>>>
>>> I think most users have cookies enabled, although since it's a browser
>>> issue I'd hesitate to call almost anything "default".
>>>
>>> Another reason you could lose session is moving between HTTP and HTTPS;
>>> some servers will use a different session. I'm assuming they all have a
>>> way to share the session, though.
>>>
>>> Dave
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: user-unsubscribe@(protected)
>>> For additional commands, e-mail: user-help@(protected)
>>>
>>>
>>>
>>
>> --
>> View this message in context:
>> http://www.nabble.com/-S2--Refactoring-Action-classes-tp18813229p18855185.html
>> Sent from the Struts - User mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@(protected)
>> For additional commands, e-mail: user-help@(protected)
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>
>
--
Sent from the Struts - User mailing list archive at Nabble.com.

Attachment:
user_189785.ezm (zipped)Please stop referring to the action as a "redirecting action". Results may redirect; actions specify results.
In addition to trying the things I and others have mentioned, PLEASE do the following:
1) Look at the code for the redirectAction and step through it--this is a trivial step and would be the easiest way to convince either (a) us, that the redirectAction *is* removing session attributes, or (b) you, that it isn't.
2) Create a minimal application that duplicates the problem and make it available somehow. Do you understand that we have no real way to duplicate this issue without it?
Dave
--- On Wed, 8/6/08, Milan Milanovic <milanmilanovich@(protected):
> Standard action is no redirect action.
>
> My session variables was deleted somewhere between my
> action class method
> and its resulting jsp, because in my action class method I
> had that
> variable, and in jsp I don't have it any more.
>
> O.K. I can put monitoring interceptor or listener like
> Jeoffrey suggested
> (thanks). But now I changed my redirecting action to
> "normal" action, and it
> is working. I must roll-back this change in my struts.xml
> ;-).
>
> Put a monitoring interceptor between every interceptor on
> the stack and tell
> me which interceptor is deleting your session variables.
>
> Yes, indeed I didn't mention Acegi, as I didn't
> realize that it is imporant
> for this kind of a problem. I didn't try without Acegi.
>
> --
> Regards, Milan
>
>
> newton.dave wrote:
> >
> > --- On Wed, 8/6/08, Milan Milanovic
> <milanmilanovich@(protected):
> >> I don't know really, I don't use HTTPS, my
> cookies are enabled, my
> >> redirect action deleted my session variables, when
> I changed this
> >> action to standard action it worked, NO other part
> of the code is
> >> changed.
> >
> > What do you mean, standard action?
> >
> > Step through the S2 code: tell me where S2 is deleting
> your session
> > variables.
> >
> > Put a monitoring interceptor between every interceptor
> on the stack and
> > tell me which interceptor is deleting your session
> variables.
> >
> > Log the actual HttpSession and tell me it's the
> same session object being
> > logged across action invocations.
> >
> > Define your own result type by copying the existing
> redirectAction result
> > and add logging to determine when (and how) it's
> deleting your session
> > variables.
> >
> > Create a minimal application that reproduces the
> problem and file a JIRA.
> > Be **thorough** in your description (for example,
> originally you left out
> > the bit about Acegi).
> >
> > Does it exhibit the same behavior if you deactivate
> Acegi?
> >
> > Dave
> >
> >
> >
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> user-unsubscribe@(protected)
> > For additional commands, e-mail:
> user-help@(protected)
> >
> >
> >
>
> --
> View this message in context:
> http://www.nabble.com/-S2--Refactoring-Action-classes-tp18813229p18859147.html
> Sent from the Struts - User mailing list archive at
> Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail:
> user-help@(protected)

Attachment:
user_189787.ezm (zipped)
Dear Dave,
newton.dave wrote:
>
> Please stop referring to the action as a "redirecting action". Results may
> redirect; actions specify results.
>
>
Yes, sorry, results recirect.
newton.dave wrote:
>
> In addition to trying the things I and others have mentioned, PLEASE do
> the following:
>
> 1) Look at the code for the redirectAction and step through it--this is a
> trivial step and would be the easiest way to convince either (a) us, that
> the redirectAction *is* removing session attributes, or (b) you, that it
> isn't.
>
> 2) Create a minimal application that duplicates the problem and make it
> available somehow. Do you understand that we have no real way to duplicate
> this issue without it?
>
Yes, I undersand it very well. O.K. I'll try this tomorrow and send you
detailed results where is the problem, and why I lost my session variables.
--
Regards, Milan
Dave
newton.dave wrote:
>
>
> --- On Wed, 8/6/08, Milan Milanovic <milanmilanovich@(protected):
>> Standard action is no redirect action.
>>
>> My session variables was deleted somewhere between my
>> action class method
>> and its resulting jsp, because in my action class method I
>> had that
>> variable, and in jsp I don't have it any more.
>>
>> O.K. I can put monitoring interceptor or listener like
>> Jeoffrey suggested
>> (thanks). But now I changed my redirecting action to
>> "normal" action, and it
>> is working. I must roll-back this change in my struts.xml
>> ;-).
>>
>> Put a monitoring interceptor between every interceptor on
>> the stack and tell
>> me which interceptor is deleting your session variables.
>>
>> Yes, indeed I didn't mention Acegi, as I didn't
>> realize that it is imporant
>> for this kind of a problem. I didn't try without Acegi.
>>
>> --
>> Regards, Milan
>>
>>
>> newton.dave wrote:
>> >
>> > --- On Wed, 8/6/08, Milan Milanovic
>> <milanmilanovich@(protected):
>> >> I don't know really, I don't use HTTPS, my
>> cookies are enabled, my
>> >> redirect action deleted my session variables, when
>> I changed this
>> >> action to standard action it worked, NO other part
>> of the code is
>> >> changed.
>> >
>> > What do you mean, standard action?
>> >
>> > Step through the S2 code: tell me where S2 is deleting
>> your session
>> > variables.
>> >
>> > Put a monitoring interceptor between every interceptor
>> on the stack and
>> > tell me which interceptor is deleting your session
>> variables.
>> >
>> > Log the actual HttpSession and tell me it's the
>> same session object being
>> > logged across action invocations.
>> >
>> > Define your own result type by copying the existing
>> redirectAction result
>> > and add logging to determine when (and how) it's
>> deleting your session
>> > variables.
>> >
>> > Create a minimal application that reproduces the
>> problem and file a JIRA.
>> > Be **thorough** in your description (for example,
>> originally you left out
>> > the bit about Acegi).
>> >
>> > Does it exhibit the same behavior if you deactivate
>> Acegi?
>> >
>> > Dave
>> >
>> >
>> >
>> ---------------------------------------------------------------------
>> > To unsubscribe, e-mail:
>> user-unsubscribe@(protected)
>> > For additional commands, e-mail:
>> user-help@(protected)
>> >
>> >
>> >
>>
>> --
>> View this message in context:
>> http://www.nabble.com/-S2--Refactoring-Action-classes-tp18813229p18859147.html
>> Sent from the Struts - User mailing list archive at
>> Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@(protected)
>> For additional commands, e-mail:
>> user-help@(protected)
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>
>
--
Sent from the Struts - User mailing list archive at Nabble.com.

Attachment:
user_189778.ezm (zipped)
This is cool.. I tried it out. However once the
chart_display.jsp is called the first time through the image tag. it does
not call the DisplayChart.action again to refresh the image with a new one
when clicked on the DrawChart.action. (I added the println statement in the
display method to find out that the div is not refreshing) I have to log
out and log in (invalidate session) to get the new chart. I am missing
something
public String display() throws Exception {
System.out.println("I AM IN THE DISPLAY NOW ");
Map attributes = ActionContext.getContext().getSession();
this.chart = (JFreeChart) attributes.get("CHART");
if(chart == null) {
return Constants.FORWARD_INVALIDACTION;
}
return Constants.FORWARD_SUCCESS;
}
private void setChart(JFreeChart chart){
Map attributes = ActionContext.getContext().getSession();
attributes.put("CHART", null);
this.chart = chart;
attributes.put("CHART", this.chart);
}
public JFreeChart getChart() {
return chart;
}
Leena Borle wrote:
>
> Hello,
> See if this helps you.
> I have a form with remote DIV which displays chart after user clicks on
> submit.
> Trick here is to generate chart object, store it in session and display it
> in separate JSP. Remove the form part if you want to display just the
> dynamic-DIV using Chart image.
>
> Form.jsp [
> <s:form>
> <s:url id="display_chart" value="DrawChart_draw.action"
> namespace="/user" />
>
> <s:submit value="Draw chart" href="%{display_chart}"
> theme="ajax" targets="*chart_div*" />
> <br />
> </s:form>
>
> <h4>Your Running Chart</h4>
> <div id="*chart_div*">
> </div> <!-- End display chart -->
> </div>
>
> ]
>
>
> display_chart.jsp [
> <body>
>
> /MyApp/user/DrawChart_display.action
> </body>
>
> ]
>
>
> struts.xml[
> <package name="user" extends
> ="struts-default,jfreechart-default">
> <!-- Separate method to draw and display due to Remote
> DIV/Button tag contsraints.
> -->
> <action name="DrawChart_input" method="input"
> class=".xxx.DrawChart">
> <result name="input">form.jsp </result>
> </action>
>
> <action name="DrawChart_draw" method="draw"
> class="xxx..DrawChart">
> <result name="success">/jsp/display_chart.jsp
> </result>
> </action>
> <action name="DrawChart_display" method="display"
> class="xxx.DrawChart">
> <result name="success" type="chart">
> 400
> 300
> </result>
> </action>
>
> </package>
> ]
>
>
> DrawChart.java [
> JFreeChart chart;
> public String draw() throws Exception {
> //chart creation logic.
> //generate chart object
> chart = ....
> session = ....
> session.put("CHART", chart);
> return success;
> }
>
> /**
> * returns chart obejct from the session.
> This methos is used by display_chart.jsp
> */
> public String display() throws Exception {
> session = ...get session ...
> this.chart = (JFreeChart) session.get("CHART");
> if(chart == null) {
> addActionError(getText("error.nochart"));
> return ERROR;
> }
> return SUCCESS;
> }
>
> // this method will get called if we specify chart
> public JFreeChart getChart() {
> return chart;
> }
>
> /**
> * <p> input action
> */
> public String input() throws Exception {
> return INPUT;
> }
>
> ]
>
>
>
> Leena
>
>
--
Sent from the Struts - User mailing list archive at Nabble.com.

Attachment:
user_189779.ezm (zipped)
Also tried implementing the SessionAware. However the same thing.
dynamicd wrote:
>
> This is cool.. I tried it out. However once the
> chart_display.jsp is called the first time through the image tag. it does
> not call the DisplayChart.action again to refresh the image with a new one
> when clicked on the DrawChart.action. (I added the println statement in
> the display method to find out that the div is not refreshing) I have to
> log out and log in (invalidate session) to get the new chart. I am missing
> something
>
>
>
> public String display() throws Exception {
> System.out.println("I AM IN THE DISPLAY NOW ");
> Map attributes = ActionContext.getContext().getSession();
> this.chart = (JFreeChart) attributes.get("CHART");
>
> if(chart == null) {
> return Constants.FORWARD_INVALIDACTION;
> }
> return Constants.FORWARD_SUCCESS;
> }
>
>
> private void setChart(JFreeChart chart){
> Map attributes = ActionContext.getContext().getSession();
> attributes.put("CHART", null);
> this.chart = chart;
> attributes.put("CHART", this.chart);
> }
>
> public JFreeChart getChart() {
> return chart;
> }
>
>
>
> Leena Borle wrote:
>>
>> Hello,
>> See if this helps you.
>> I have a form with remote DIV which displays chart after user clicks on
>> submit.
>> Trick here is to generate chart object, store it in session and display
>> it
>> in separate JSP. Remove the form part if you want to display just the
>> dynamic-DIV using Chart image.
>>
>> Form.jsp [
>> <s:form>
>> <s:url id="display_chart" value="DrawChart_draw.action"
>> namespace="/user" />
>>
>> <s:submit value="Draw chart" href="%{display_chart}"
>> theme="ajax" targets="*chart_div*" />
>> <br />
>> </s:form>
>>
>> <h4>Your Running Chart</h4>
>> <div id="*chart_div*">
>> </div> <!-- End display chart -->
>> </div>
>>
>> ]
>>
>>
>> display_chart.jsp [
>> <body>
>>
>> /MyApp/user/DrawChart_display.action
>> </body>
>>
>> ]
>>
>>
>> struts.xml[
>> <package name="user" extends
>> ="struts-default,jfreechart-default">
>> <!-- Separate method to draw and display due to Remote
>> DIV/Button tag contsraints.
>> -->
>> <action name="DrawChart_input" method="input"
>> class=".xxx.DrawChart">
>> <result name="input">form.jsp </result>
>> </action>
>>
>> <action name="DrawChart_draw" method="draw"
>> class="xxx..DrawChart">
>> <result name="success">/jsp/display_chart.jsp
>> </result>
>> </action>
>> <action name="DrawChart_display" method="display"
>> class="xxx.DrawChart">
>> <result name="success" type="chart">
>> 400
>> 300
>> </result>
>> </action>
>>
>> </package>
>> ]
>>
>>
>> DrawChart.java [
>> JFreeChart chart;
>> public String draw() throws Exception {
>> //chart creation logic.
>> //generate chart object
>> chart = ....
>> session = ....
>> session.put("CHART", chart);
>> return success;
>> }
>>
>> /**
>> * returns chart obejct from the session.
>> This methos is used by display_chart.jsp
>> */
>> public String display() throws Exception {
>> session = ...get session ...
>> this.chart = (JFreeChart) session.get("CHART");
>> if(chart == null) {
>> addActionError(getText("error.nochart"));
>> return ERROR;
>> }
>> return SUCCESS;
>> }
>>
>> // this method will get called if we specify chart
>> public JFreeChart getChart() {
>> return chart;
>> }
>>
>> /**
>> * <p> input action
>> */
>> public String input() throws Exception {
>> return INPUT;
>> }
>>
>> ]
>>
>>
>>
>> Leena
>>
>>
>
>
--
Sent from the Struts - User mailing list archive at Nabble.com.

Attachment:
user_189781.ezm (zipped)--- On Wed, 8/6/08, dynamicd <dhaval.parekh@(protected):
> Also tried implementing the SessionAware. However the same thing.
Why?
Did you try setting the headers for not caching?
Dave
> dynamicd wrote:
> >
> > This is cool.. I tried it out. However once the
> > chart_display.jsp is called the first time through the
> image tag. it does
> > not call the DisplayChart.action again to refresh the
> image with a new one
> > when clicked on the DrawChart.action. (I added the
> println statement in
> > the display method to find out that the div is not
> refreshing) I have to
> > log out and log in (invalidate session) to get the new
> chart. I am missing
> > something
> >
> >
> >
> > public String display() throws Exception {
> > System.out.println("I AM IN THE DISPLAY
> NOW ");
> > Map attributes =
> ActionContext.getContext().getSession();
> > this.chart = (JFreeChart)
> attributes.get("CHART");
> >
> > if(chart == null) {
> > return Constants.FORWARD_INVALIDACTION;
> > }
> > return Constants.FORWARD_SUCCESS;
> > }
> >
> >
> > private void setChart(JFreeChart chart){
> > Map attributes =
> ActionContext.getContext().getSession();
> > attributes.put("CHART", null);
> > this.chart = chart;
> > attributes.put("CHART", this.chart);
> > }
> >
> > public JFreeChart getChart() {
> > return chart;
> > }
> >
> >
> >
> > Leena Borle wrote:
> >>
> >> Hello,
> >> See if this helps you.
> >> I have a form with remote DIV which displays
> chart after user clicks on
> >> submit.
> >> Trick here is to generate chart object, store it
> in session and display
> >> it
> >> in separate JSP. Remove the form part if you
> want to display just the
> >> dynamic-DIV using Chart image.
> >>
> >> Form.jsp [
> >> <s:form>
> >> <s:url id="display_chart"
> value="DrawChart_draw.action"
> >> namespace="/user" />
> >>
> >> <s:submit value="Draw
> chart" href="%{display_chart}"
> >> theme="ajax"
> targets="*chart_div*" />
> >> <br />
> >> </s:form>
> >>
> >> <h4>Your Running Chart</h4>
> >> <div id="*chart_div*">
> >> </div> <!-- End display chart
> -->
> >> </div>
> >>
> >> ]
> >>
> >>
> >> display_chart.jsp [
> >> <body>
> >>
> >> /MyApp/user/DrawChart_display.action
> >> </body>
> >>
> >> ]
> >>
> >>
> >> struts.xml[
> >> <package name="user"
> extends
> >> ="struts-default,jfreechart-default">
> >> <!-- Separate method to draw and
> display due to Remote
> >> DIV/Button tag contsraints.
> >> -->
> >> <action
> name="DrawChart_input" method="input"
> >> class=".xxx.DrawChart">
> >> <result
> name="input">form.jsp </result>
> >> </action>
> >>
> >> <action
> name="DrawChart_draw" method="draw"
> >> class="xxx..DrawChart">
> >> <result
> name="success">/jsp/display_chart.jsp
> >> </result>
> >> </action>
> >> <action
> name="DrawChart_display"
> method="display"
> >> class="xxx.DrawChart">
> >> <result
> name="success" type="chart">
> >> 400
> >> 300
> >> </result>
> >> </action>
> >>
> >> </package>
> >> ]
> >>
> >>
> >> DrawChart.java [
> >> JFreeChart chart;
> >> public String draw() throws Exception {
> >> //chart creation logic.
> >> //generate chart object
> >> chart = ....
> >> session = ....
> >> session.put("CHART",
> chart);
> >> return success;
> >> }
> >>
> >> /**
> >> * returns chart obejct from the session.
> >> This methos is used by display_chart.jsp
> >> */
> >> public String display() throws Exception {
> >> session = ...get session ...
> >> this.chart = (JFreeChart)
> session.get("CHART");
> >> if(chart == null) {
> >>
> addActionError(getText("error.nochart"));
> >> return ERROR;
> >> }
> >> return SUCCESS;
> >> }
> >>
> >> // this method will get called if we specify
> chart
> >> public JFreeChart getChart() {
> >> return chart;
> >> }
> >>
> >> /**
> >> * <p> input action
> >> */
> >> public String input() throws Exception {
> >> return INPUT;
> >> }
> >>
> >> ]

Attachment:
user_189782.ezm (zipped)
I have tried
<%
response.setHeader("Cache-Control", "no-cache"); //HTTP 1.1
response.setHeader("Pragma", "no-cache"); //HTTP 1.0
response.setDateHeader("Expires", 0); //prevents caching at the proxy
server
%>
as well..
newton.dave wrote:
>
> --- On Wed, 8/6/08, dynamicd <dhaval.parekh@(protected):
>> Also tried implementing the SessionAware. However the same thing.
>
> Why?
>
> Did you try setting the headers for not caching?
>
> Dave
>
>> dynamicd wrote:
>> >
>> > This is cool.. I tried it out. However once the
>> > chart_display.jsp is called the first time through the
>> image tag. it does
>> > not call the DisplayChart.action again to refresh the
>> image with a new one
>> > when clicked on the DrawChart.action. (I added the
>> println statement in
>> > the display method to find out that the div is not
>> refreshing) I have to
>> > log out and log in (invalidate session) to get the new
>> chart. I am missing
>> > something
>> >
>> >
>> >
>> > public String display() throws Exception {
>> > System.out.println("I AM IN THE DISPLAY
>> NOW ");
>> > Map attributes =
>> ActionContext.getContext().getSession();
>> > this.chart = (JFreeChart)
>> attributes.get("CHART");
>> >
>> > if(chart == null) {
>> > return Constants.FORWARD_INVALIDACTION;
>> > }
>> > return Constants.FORWARD_SUCCESS;
>> > }
>> >
>> >
>> > private void setChart(JFreeChart chart){
>> > Map attributes =
>> ActionContext.getContext().getSession();
>> > attributes.put("CHART", null);
>> > this.chart = chart;
>> > attributes.put("CHART", this.chart);
>> > }
>> >
>> > public JFreeChart getChart() {
>> > return chart;
>> > }
>> >
>> >
>> >
>> > Leena Borle wrote:
>> >>
>> >> Hello,
>> >> See if this helps you.
>> >> I have a form with remote DIV which displays
>> chart after user clicks on
>> >> submit.
>> >> Trick here is to generate chart object, store it
>> in session and display
>> >> it
>> >> in separate JSP. Remove the form part if you
>> want to display just the
>> >> dynamic-DIV using Chart image.
>> >>
>> >> Form.jsp [
>> >> <s:form>
>> >> <s:url id="display_chart"
>> value="DrawChart_draw.action"
>> >> namespace="/user" />
>> >>
>> >> <s:submit value="Draw
>> chart" href="%{display_chart}"
>> >> theme="ajax"
>> targets="*chart_div*" />
>> >> <br />
>> >> </s:form>
>> >>
>> >> <h4>Your Running Chart</h4>
>> >> <div id="*chart_div*">
>> >> </div> <!-- End display chart
>> -->
>> >> </div>
>> >>
>> >> ]
>> >>
>> >>
>> >> display_chart.jsp [
>> >> <body>
>> >>
>> >> /MyApp/user/DrawChart_display.action
>> >> </body>
>> >>
>> >> ]
>> >>
>> >>
>> >> struts.xml[
>> >> <package name="user"
>> extends
>> >> ="struts-default,jfreechart-default">
>> >> <!-- Separate method to draw and
>> display due to Remote
>> >> DIV/Button tag contsraints.
>> >> -->
>> >> <action
>> name="DrawChart_input" method="input"
>> >> class=".xxx.DrawChart">
>> >> <result
>> name="input">form.jsp </result>
>> >> </action>
>> >>
>> >> <action
>> name="DrawChart_draw" method="draw"
>> >> class="xxx..DrawChart">
>> >> <result
>> name="success">/jsp/display_chart.jsp
>> >> </result>
>> >> </action>
>> >> <action
>> name="DrawChart_display"
>> method="display"
>> >> class="xxx.DrawChart">
>> >> <result
>> name="success" type="chart">
>> >> 400
>> >> 300
>> >> </result>
>> >> </action>
>> >>
>> >> </package>
>> >> ]
>> >>
>> >>
>> >> DrawChart.java [
>> >> JFreeChart chart;
>> >> public String draw() throws Exception {
>> >> //chart creation logic.
>> >> //generate chart object
>> >> chart = ....
>> >> session = ....
>> >> session.put("CHART",
>> chart);
>> >> return success;
>> >> }
>> >>
>> >> /**
>> >> * returns chart obejct from the session.
>> >> This methos is used by display_chart.jsp
>> >> */
>> >> public String display() throws Exception {
>> >> session = ...get session ...
>> >> this.chart = (JFreeChart)
>> session.get("CHART");
>> >> if(chart == null) {
>> >>
>> addActionError(getText("error.nochart"));
>> >> return ERROR;
>> >> }
>> >> return SUCCESS;
>> >> }
>> >>
>> >> // this method will get called if we specify
>> chart
>> >> public JFreeChart getChart() {
>> >> return chart;
>> >> }
>> >>
>> >> /**
>> >> * <p> input action
>> >> */
>> >> public String input() throws Exception {
>> >> return INPUT;
>> >> }
>> >>
>> >> ]
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>
>
--
Sent from the Struts - User mailing list archive at Nabble.com.

Attachment:
user_189786.ezm (zipped)Hi,
How are you creating new chart object ? For me every time user clicks on
submit-DrawChart_draw,action will create New chart object (e.g.
chart=ChartFactory.createBarChart) and store it in the session which
afterwards is used by DIV(DrawChart_display.action). You need to refresh
your chart object.
Leena
On Wed, Aug 6, 2008 at 11:36 AM, dynamicd <dhaval.parekh@(protected):
> This is cool.. I tried it out. However once the
> chart_display.jsp is called the first time through the image tag. it does
> not call the DisplayChart.action again to refresh the image with a new one
> when clicked on the DrawChart.action. (I added the println statement in the
> display method to find out that the div is not refreshing) I have to log
> out and log in (invalidate session) to get the new chart. I am missing
> something
>
>
>
> public String display() throws Exception {
> System.out.println("I AM IN THE DISPLAY NOW ");
> Map attributes =
> ActionContext.getContext().getSession();
> this.chart = (JFreeChart) attributes.get("CHART");
>
> if(chart == null) {
> return Constants.FORWARD_INVALIDACTION;
> }
> return Constants.FORWARD_SUCCESS;
> }
>
>
> private void setChart(JFreeChart chart){
> Map attributes = ActionContext.getContext().getSession();
> attributes.put("CHART", null);
> this.chart = chart;
> attributes.put("CHART", this.chart);
> }
>
> public JFreeChart getChart() {
> return chart;
> }
>
>
>
> Leena Borle wrote:
> >
> > Hello,
> > See if this helps you.
> > I have a form with remote DIV which displays chart after user clicks on
> > submit.
> > Trick here is to generate chart object, store it in session and display
> it
> > in separate JSP. Remove the form part if you want to display just the
> > dynamic-DIV using Chart image.
> >
> > Form.jsp [
> > <s:form>
> > <s:url id="display_chart" value="DrawChart_draw.action"
> > namespace="/user" />
> >
> > <s:submit value="Draw chart" href="%{display_chart}"
> > theme="ajax" targets="*chart_div*" />
> > <br />
> > </s:form>
> >
> > <h4>Your Running Chart</h4>
> > <div id="*chart_div*">
> > </div> <!-- End display chart -->
> > </div>
> >
> > ]
> >
> >
> > display_chart.jsp [
> > <body>
> >
> > /MyApp/user/DrawChart_display.action
> > </body>
> >
> > ]
> >
> >
> > struts.xml[
> > <package name="user" extends
> > ="struts-default,jfreechart-default">
> > <!-- Separate method to draw and display due to Remote
> > DIV/Button tag contsraints.
> > -->
> > <action name="DrawChart_input" method="input"
> > class=".xxx.DrawChart">
> > <result name="input">form.jsp </result>
> > </action>
> >
> > <action name="DrawChart_draw" method="draw"
> > class="xxx..DrawChart">
> > <result name="success">/jsp/display_chart.jsp
> > </result>
> > </action>
> > <action name="DrawChart_display" method="display"
> > class="xxx.DrawChart">
> > <result name="success" type="chart">
> > 400
> > 300
> > </result>
> > </action>
> >
> > </package>
> > ]
> >
> >
> > DrawChart.java [
> > JFreeChart chart;
> > public String draw() throws Exception {
> > //chart creation logic.
> > //generate chart object
> > chart = ....
> > session = ....
> > session.put("CHART", chart);
> > return success;
> > }
> >
> > /**
> > * returns chart obejct from the session.
> > This methos is used by display_chart.jsp
> > */
> > public String display() throws Exception {
> > session = ...get session ...
> > this.chart = (JFreeChart) session.get("CHART");
> > if(chart == null) {
> > addActionError(getText("error.nochart"));
> > return ERROR;
> > }
> > return SUCCESS;
> > }
> >
> > // this method will get called if we specify chart
> > public JFreeChart getChart() {
> > return chart;
> > }
> >
> > /**
> > * <p> input action
> > */
> > public String input() throws Exception {
> > return INPUT;
> > }
> >
> > ]
> >
> >
> >
> > Leena
> >
> >
>
> --
> View this message in context:
> http://www.nabble.com/Struts-2-And-JFreeChart-tp18740589p18857105.html
> Sent from the Struts - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>

Attachment:
user_189780.ezm (zipped)
Hi all,
I am working on an application that needs to implement multiple uploads. As
a solution I used a small client-side flash file called SWFUpload to allow
for the functionality I need.
My application runs primarily within the struts framework; however, I have
been unable to figure out how to handle the post request the .swf file sends
to my server. I have been able to get a working solution using UploadBean
from Javazoom; however, I would really like to use struts to handle this
request so that I can have tighter integration with my core framework. As
such, I need to be able to handle a multipart post containing a file from
any source, regardless of whether or not the client knows its contents. This
means I can't use a bean behind the JSP page because all the management and
posting is handled from within the .swf file. As far as I can tell from my
investigation, I cannot change anything to do with the way the post is
generated.
I have seen some older references to MultipartRequestWrapper in Struts 1.1,
but I haven't seen anything with enough code present to help me figure out
how to handle these requests. I am not particularly good at getting raw HTTP
decoded and organized so the more descriptive the code example the better.
If anybody could help I would really appreciate it.
Thanks in advance.
--
Sent from the Struts - User mailing list archive at Nabble.com.

Attachment:
user_189788.ezm (zipped)Hello
I am trying to construct a model that has multiple radio buttons per object but keep them distinct, therefore they need a different name. I almost have it by creating a array of objects and using nested iterate, with the code below. However, of course it does not increment the index on the second and successive iterations. Is this possible? I have tried all permutations of attributes and all I want is it to automatically increment, radioOptions[n] for each record. Any help appreciated.
this struts <nested:iterate property="radioOptions" name="current">
<nested:define id="first" property="firstOptionVal" type="
java.lang.String"/>
<nested:radio value='<%=first%>' property="value"/>
<nested:define id="second" property="secondOptionVal" type="
java.lang.String"/>
<nested:radio value='<%=second%>' property="value"/>
</nested:iterate>
generates this for all records
<input type="radio" name="radioOptions[0].value" value="radio">
<input type="radio" name="radioOptions[0].value" value="checkbox">