Java Mailing List Archive

http://www.gg3721.com/

Home » Struts Users Mailing List »

user Digest 21 Apr 2008 03:45:30 -0000 Issue 7989

user-digest-help

2008-04-20


Author LoginPost Reply

user Digest 21 Apr 2008 03:45:30 -0000 Issue 7989

Topics (messages 185624 through 185644):

Re: from Action to PageContext: how's it done?
 185624 by: Martin Gainty
 185628 by: Adam Hardy

Re: Scope Interceptor
 185625 by: Jeromy Evans
 185631 by: Kibo

Re: s2 in tomcats shared lib/
 185626 by: Marc Ende

Theme extensino does not work for me.
 185627 by: Alex Shneyderman

Problem with internationalization in addActionError
 185629 by: stan77
 185630 by: Volker Karlmeier
 185633 by: stan77

Re: Clearing form value
 185632 by: Nils-Helge Garli Hegvik
 185644 by: aum strut

Struts 2 AJAX editable grid
 185634 by: tom tom
 185640 by: Jeromy Evans

Locale Field in Struts URL's
 185635 by: yogi1313

Help linking two autocompleters
 185636 by: Márcio Gurgel

Can these two co exists
 185637 by: tom tom

Re: [S2] IE 7 - Secure and non-secure pop up message when using https
 185638 by: Simon Sew
 185639 by: Jeromy Evans
 185641 by: Simon Sew
 185642 by: Jeromy Evans

Intenationalization questions
 185643 by: Pranav

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_185624.ezm (zipped)

ServletContext attributes 'foo'
#application['foo'] or #application.foo

Access to PageContext for attribute foo
#attr['foo'] or #attr.foo

in WebWork 1.x one could access special named objects (the request scope
attributes to be exact) by using "@(protected)",
but now special variables are accessed using "#foo" is merely a request to
another object in the OgnlContext <other than the root>

http://struts.apache.org/2.0.11.1/docs/ognl-basics.html
Good Stuff
Martin
----- Original Message -----
From: "Adam Hardy" <ahardy.struts@(protected)>
To: "Struts Users Mailing List" <user@(protected)>
Sent: Saturday, April 19, 2008 9:11 PM
Subject: Re: from Action to PageContext: how's it done?


> Dave Newton on 20/04/08 00:23, wrote:
> > --- Adam Hardy <ahardy.struts@(protected):
> >> So you say the StrutsRequestWrapper holds the struts context [...]
> >
> > No, I'm saying it has access to it via ActionContext.getContext().
> >
> >> and is accessed somewhere in the Result to pull everything down
> >> into the PageContext?
> >
> > I'm not sure what that means.
> >
> > All the request wrapper does (slightly simplified) is call
super.getAttribute
> > (where super is an HttpServletRequestWrapper). If nothing is returned
from
> > that, as would be the case with a typical action and action property,
then
> > the wrapper will query the stack for the value.
> >
> > You should probably just look at the source code, no?
>
> Yes, I guess I should if I had a team of sherpas for the expedition. I
once
> scaled the face of the Hibernate Source Massif and only 3 of the team came
back
> alive.
>
> But seriously, I appreciate your comments a lot since they buy me out of
lot of
> hard source code reading, which is not something too pleasant when you
don't
> know where you're aiming for, as you probably know.
>
> What you're saying is clear except one thing - in JSTL I can access the
action.
> And in JSTL, I'm not calling request.getAttribute() - I'm _not_ doing
this:
>
> ${requestScope['myObject']}
>
> I'm just doing this:
>
> ${myObject}
>
> and struts somehow gives me the right info, which to my mind means that
Struts
> has put that object into the PageContext already.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>


Attachment: user_185628.ezm (zipped)
Dave Newton on 20/04/08 02:24, wrote:
> --- Adam Hardy <ahardy.struts@(protected):
>> What you're saying is clear except one thing - in JSTL I can access the
>> action. And in JSTL, I'm not calling request.getAttribute() - I'm _not_
> doing this:
>> ${requestScope['myObject']}
>>
>> I'm just doing this:
>>
>> ${myObject}
>>
>> and struts somehow gives me the right info, which to my mind means that
>> Struts has put that object into the PageContext already.
>
> I told you precisely what it did: if the request wrapper can't find the
> attribute in normal scope, it goes to the stack.
>
> Here is the entire relevant source; it's 36 lines. With comments.
>
>   public Object getAttribute(String s) { [snip]

OK mystery over - I just didn't see how the JSP gets to the request wrapper to
make that call to request.getAttribute().

I just realised though - the PageContext will search through all scopes,
starting with the Request until it finds what you asked for. Unless you specify
PageContext.SESSION_SCOPE or other.

Sorry for the misunderstanding.


Adam

Attachment: user_185625.ezm (zipped)
Kibo wrote:
> Hi konference
>
> I read the article there:
> http://struts.apache.org/2.0.9/docs/scope-interceptor.html
> and a want use scope interceptor, but it not work my. I dont know exactly,
> that i good understand it.
> I want save into session model: Employee.
>
>  

Hi Tomas,

You are close to getting it to work. There are two issues to understand:
- the ValueStack and the impact of the ModelDriven interface
- the role of the scope interceptor

ValueStack: the stack contains all the relevant objects created by the
framework. Normally your Action is the object at the top/root and you
can access a property like:
<s:property value="employee.firstName"/> where getEmployee() is provided
by your action.
When you enable the ModelDriven<Employee> interface, instead the
framework pushes the model (Employee) on top of the stack. Now, to
access a property of the employee you can use this:
<s:property value="firstName"/> (as an employee is the top of the tack,
it accesses the employee's first name)

The stack still contains your action behind the Model and the framework
will search it for properties that the model doesn't have.

Next, the role of the scope interceptor is to get the Model after your
action executes and put it into the session (or another scope). Also,
when an action is invoked, it will also set the Model on your action by
getting it from the session. The reason this in an interceptor is so
that your action and JSPs doesn't have to know; the interceptor hides
that a session (or other scope) was used.

That means you should design your JSP as if it was populated by a normal
ModelDriven action.

This line in your original code tries to access an object named model in
the session. It does need to (and shouldn't)

<s:property value="%{#session.model}" />

Instead, your model is already there (at the top of the stack that is; either newly created or fetched for you by the interceptor)

<s:property value="firstName" />

I hope that helps,
Jeromy Evans


Attachment: user_185631.ezm (zipped)

Hi Jeromy

I understand it now. It help me the most. Thanks You very much.

Here I find an practise for scope interceptor. Maybe it can need somebody.
http://d.hatena.ne.jp/nikkei225f/20080111/1200022384

Tomas Jurman
Czech Republic




-----
Tomas Jurman
Czech Republic
--
Sent from the Struts - User mailing list archive at Nabble.com.


Attachment: user_185626.ezm (zipped)
Okay, that's not a problem. The webapps belong together and will be
built together in one run.
All of them have the same version of struts.

Thanks for your help.



Gabriel Belingueres schrieb:
> Well it depends if you are ALWAYS developing using the same library
> versions or not.
> Be aware that Struts level of compatibility changes from version to
> version: For example, from 2.09 to 2.0.11 imposes several constraints
> in its tag library, so you may want to prevent this to be in a common
> place.
>
> However regarding Spring, upgrades from v2.0.x to v.2.0.y are drop in
> replacements, so it would not hurt (in theory at least)
>
> 2008/4/19, Marc Ende <mlists@(protected)>:
>  
>> Hi,
>>
>> a few years ago everyone told that's not good to have the sturts.jar's in a
>> shared location in a tomcat-instance.
>> What about now (struts 2)?
>> I'm asking because I've got several webapps which belongs together and most
>> of them are build using struts 2 and
>> spring. After assembling the war (directory or file) I've seen that the huge
>> size (between 12 to 17mb) of the webapps is
>> related to the number of deployed jars. So I'd like to clean up a little and
>> put some of the commonly used
>> jars in the ${catalina.home}/lib folder. What about the new s2-jar's? Do I
>> ran into trouble when I'm putting it into the
>> global lib-folder or do I get (not-wanted) side-effects from deploying them
>> into this location?
>>
>> Thanks for your help!
>>
>> Marc
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@(protected)
>> For additional commands, e-mail: user-help@(protected)
>>
>>
>>  
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>  


Attachment: user_185627.ezm (zipped)
I am extending my new theme from simple (I actually started with xhtml
but now it is a totally different beast). Somehow, theme.properties
file gets ignored. If my theme contains the tag it gets rendered
correctly however if I use the one that is provided with simple and
the one I extend the tag is not rendered at all. Anything else I have
to do to extend a theme besides the above mentioned file and its
content ?

Thanks,
Alex.

Attachment: user_185629.ezm (zipped)

Hello,

I'm new to struts 2.
I have the following problem with internationalization in my Action classes.

there are two properties files package.properties and package_en.properties
wich works correctly in most cases.

In my Logon action i would like to add an Action error like this:

addActionError(getText("error.login.failed"));

The message is dispayed in my jsp, but always get it's string from
package.properties,
never from package_en.properties. Seems, that the request_locale is not
reachable in my
Action class.
I've searched a several days for a solution, but can't find anything.

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


Attachment: user_185630.ezm (zipped)
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi,

  you should try to find out, what the acutal locale is and if there
is a suitable properties-file.
  Next, try to find out, if your properties-file is found in the
right position. (Package etc.) and if it
  is accessible.
  Maybe you have not extended RequestAware in your class.....


Volker

stan77 schrieb:
> Hello,
>
> I'm new to struts 2.
> I have the following problem with internationalization in my Action
classes.
>
> there are two properties files package.properties and package_en.properties
> wich works correctly in most cases.
>
> In my Logon action i would like to add an Action error like this:
>
> addActionError(getText("error.login.failed"));
>
> The message is dispayed in my jsp, but always get it's string from
> package.properties,
> never from package_en.properties. Seems, that the request_locale is not
> reachable in my
> Action class.
> I've searched a several days for a solution, but can't find anything.
>
> Thanks for help.

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.3 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFICzpUx4KjH6Tk4MMRApIbAKC4pKdtpGstmMYb5F7mr/SU2AdHqgCfRtQR
UKbnP14prumG73NvVAQBy7w=
=2ETC
-----END PGP SIGNATURE-----


Attachment: user_185633.ezm (zipped)

Hi Volker,

my Action class implements ServletRequestAware. When I check the locale with
request.getParameter("request_locale"), I get 'en' as result.

The both *.properties files are in the same classpath.
If the logon is invalid I put the actionError and return LOGIN
and go back to Logon.jsp.

My action definition:
<action name="doLogon" class="com.imp.app.usr.Logon">
<result name="input">/Logon.jsp</result>
<result name="error">/Logon.jsp</result>
<result name="login">/Logon.jsp</result>  
<result name="success" type="redirect-action">
Welcome
</result>        
</action>

After the action, the Logon.jsp is displayed with all contents in english
excepting the action Error and the hole login form,
including labels, buttons etc. wich seems to get his content from
package.properties.

All menu items, another form and anything else is displayed from the
package_en.properties.
I don't why, because both files are at the same position.




Volker Karlmeier wrote:
>
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Hi,
>
>   you should try to find out, what the acutal locale is and if there
> is a suitable properties-file.
>   Next, try to find out, if your properties-file is found in the
> right position. (Package etc.) and if it
>   is accessible.
>   Maybe you have not extended RequestAware in your class.....
>
>
> Volker
>
> stan77 schrieb:
>> Hello,
>>
>> I'm new to struts 2.
>> I have the following problem with internationalization in my Action
> classes.
>>
>> there are two properties files package.properties and
>> package_en.properties
>> wich works correctly in most cases.
>>
>> In my Logon action i would like to add an Action error like this:
>>
>> addActionError(getText("error.login.failed"));
>>
>> The message is dispayed in my jsp, but always get it's string from
>> package.properties,
>> never from package_en.properties. Seems, that the request_locale is not
>> reachable in my
>> Action class.
>> I've searched a several days for a solution, but can't find anything.
>>
>> Thanks for help.
>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.3 (MingW32)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
>
> iD8DBQFICzpUx4KjH6Tk4MMRApIbAKC4pKdtpGstmMYb5F7mr/SU2AdHqgCfRtQR
> UKbnP14prumG73NvVAQBy7w=
> =2ETC
> -----END PGP SIGNATURE-----
>
>
> ---------------------------------------------------------------------
> 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_185632.ezm (zipped)
Considering you're processing the form and displaying the form using
the same action within the same request, I would say this is expected
behavior. I would consider doing a redirect after the post instead.

Nils-H

On Sat, Apr 19, 2008 at 12:06 PM, aum strut <aum.struts@(protected):
> i am not using Spring at all.here is the code for my configuration and
> action class
>
> my *Quotation.jsp page* by which i am adding data
>
>
> <%@(protected)" %>
>
> <html>
>
> <head>
>
> <title>Quotation Form</title>
>
> <s:head theme="ajax"/>
>
> </head>
>
> <body>
>
> <center><font face="verdana" size="2" color="red"><s:actionmessage></
> s:actionmessage></font></center>
>
> <h1 align="center"> &nbsp;&nbsp;&nbsp;Quotation Form</h1>
>
> <s:form action="SaveBill">
>
> <table align="center">
>
>  <s:datetimepicker label="Date:" name="date"/></td><td>
>
> <s:textfield label="Voucher Number:" name="voucherNumber"/>
>
> <s:textfield label="Customer Name:" name="customerName"/>
>
> <s:textarea label="Address" name="address" cols="20" rows="4"/>
>
> <s:textfield label="Contact No:" name="contactNo"/>
>
> <s:textfield label="Item Name:" name="itemName"/>
>
> <s:textfield label="Purity:" name="purity"/>
>
> <s:textfield label="Gross Weight(Gms):" name="grossWeight"/>
>
> <s:textfield label="Net Weight(Gms):" name="netWeight"/>
>
> <s:textfield label="Diamond Weight:" name="diamondWeight"/>
>
> <s:textfield label="Gold Rate(Rs):" name="goldRate"/>
>
> <s:textfield label="Amount:" name="amount"/>
>
> <s:submit label="Save" align="center" />
>
> </table>
>
> </s:form>
>
> </body>
>
> </html>
> *my action class*
>
>
> package raisonne.billgeneration;
>
> import com.opensymphony.xwork2.ActionSupport;
> import raisonne.billgeneration.GetBillConnection;
>
> public class SaveBillingData extends ActionSupport{
>
>  /**
>  *
>  */
>  private static final long serialVersionUID = -5856152810070496725L;
>  private int rowInserted=0;
>  private String date=null;
>  private String voucherNumber=null;
>  private String customerName=null;
>  private String address=null;
>  private String contactNo=null;
>  private String itemName=null;
>  private String purity=null;
>  private double grossWeight=0.0;
>  private double netWeight=0.0;
>  private double diamondWeight=0.0;
>  private double goldRate=0.0;
>  private double amount=0.0;
>
> /*
>
> Getter and Setter Method
>
> */
>
>  public String execute() throws Exception{
>  GetBillConnection billCollection =new GetBillConnection();
>  rowInserted=billCollection.AddBillingData(getDate(),getVoucherNumber(),
>   getCustomerName(),getAddress(),getContactNo(),
>   getItemName(),getPurity(),getGrossWeight(),
>   getNetWeight(),getDiamondWeight(),getGoldRate(),getAmount());
>  if(rowInserted>0){
>   addActionMessage("Quotation data has been submitted successfully");
>   return SUCCESS;
>  }
>  else{
>   addActionMessage("Error while saving Quotation data, Pleaes retry");
>   return INPUT;
>  }
>  }
>
>
> }
>
>
> lastly *Struts.xml file*
>
>
> <package name="raisonne.billgeneration" extends="struts-default" namespace=
> "/">
>
> <action name="SaveBill" class="raisonne.billgeneration.SaveBillingData">
>
> <result name="success">/BillGeneration/Quotation.jsp</result>
>
> <result name="input">/Login/Login.jsp</result>
>
> </action>
>
> </package>
> -aum
>
>
>
>
> On 4/19/08, Nils-Helge Garli Hegvik <nilsga@(protected):
> >
> > It would be a lot easier helping if you show us some configuration
> > files and code....
> >
> > Nils-H
> >
> > On Sat, Apr 19, 2008 at 6:59 AM, aum strut <aum.struts@(protected):
> > > yes you are right
> > >
> > > not providing complete information in one mail is really not good
> > >
> > > i wil take this in to account in future...
> > >
> > > well i am not using spring in my application i have a simple form which
> > is
> > > sending the input values to my action where i am adding these in to the
> > data
> > > base using simple jdbc call everything is working fine i am even
> > getting
> > > back the success response in my add form.
> > >
> > > i am not able to understand what u mean by "not have your action
> > defined as
> > > being "prototype"
> > > scope"
> > >
> > > aum
> > >
> > >
> > >
> > >
> > > On 4/19/08, Dave Newton <newton.dave@(protected):
> > > >
> > > > Are you using Spring?
> > > >
> > > > Would it be possible for you to provide more useful information in
> > your
> > > > initial emails rather than generating a stream of a half-dozen or
> > more?
> > > > It's
> > > > rather frustrating; we've gone through this before.
> > > >
> > > > One common error is to not have your action defined as being
> > "prototype"
> > > > scope. Since actions are instantiated on each request (normally) it's
> > not
> > > > typical to see this behavior without some effort on your part or
> > > > mis-configuration.
> > > >
> > > > Dave
> > > >
> > > > --- aum strut <aum.struts@(protected):
> > > >
> > > > > currently i am using struts-2.0.11.1
> > > > >
> > > > > On 4/19/08, Dave Newton <newton.dave@(protected):
> > > > > >
> > > > > > Which version of Struts?
> > > > > >
> > > > > > --- aum strut <aum.struts@(protected):
> > > > > >
> > > > > > > Hi all,
> > > > > > >
> > > > > > > a little point which i want to know.
> > > > > > > i have a form by which we can add billing detais in the
> > database
> > > > > > >
> > > > > > > form is working fine, it is adding the value to the database as
> > > > > > expected,
> > > > > > > the problem whcih i am facing is even after successfully
> > submitting
> > > > the
> > > > > > > values, it is not clearing the form values which has been added
> > > > > > >
> > > > > > > i can clear the fields values using java script,but i want to
> > know
> > > > is
> > > > > > it
> > > > > > > possible using Struts2,is theer any was that when ever data is
> > > > > submitted
> > > > > > > successfully in the database form fields values should get
> > cleared.
> > > > > > >
> > > > > > >
> > > > > > > any help in this regard will be much appriciated.
> > > > > > >
> > > > > > >
> > > > > > > thanks in advance
> > > > > > > --aum
> > > > > > >
> > > > > >
> > > > > >
> > > > > >
> > ---------------------------------------------------------------------
> > > > > > 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)
> > > >
> > > >
> > >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@(protected)
> > For additional commands, e-mail: user-help@(protected)
> >
> >
>

Attachment: user_185644.ezm (zipped)
Nils

though i have achieved this using javascript
my problem was that i can not redirect as i have to enter multipal records
at a given time


On 4/20/08, Nils-Helge Garli Hegvik <nilsga@(protected):
>
> Considering you're processing the form and displaying the form using
> the same action within the same request, I would say this is expected
> behavior. I would consider doing a redirect after the post instead.
>
> Nils-H
>
> On Sat, Apr 19, 2008 at 12:06 PM, aum strut <aum.struts@(protected):
> > i am not using Spring at all.here is the code for my configuration and
> > action class
> >
> > my *Quotation.jsp page* by which i am adding data
> >
> >
> > <%@(protected)" %>
> >
> > <html>
> >
> > <head>
> >
> > <title>Quotation Form</title>
> >
> > <s:head theme="ajax"/>
> >
> > </head>
> >
> > <body>
> >
> > <center><font face="verdana" size="2" color="red"><s:actionmessage></
> > s:actionmessage></font></center>
> >
> > <h1 align="center"> &nbsp;&nbsp;&nbsp;Quotation Form</h1>
> >
> > <s:form action="SaveBill">
> >
> > <table align="center">
> >
> >  <s:datetimepicker label="Date:" name="date"/></td><td>
> >
> > <s:textfield label="Voucher Number:" name="voucherNumber"/>
> >
> > <s:textfield label="Customer Name:" name="customerName"/>
> >
> > <s:textarea label="Address" name="address" cols="20" rows="4"/>
> >
> > <s:textfield label="Contact No:" name="contactNo"/>
> >
> > <s:textfield label="Item Name:" name="itemName"/>
> >
> > <s:textfield label="Purity:" name="purity"/>
> >
> > <s:textfield label="Gross Weight(Gms):" name="grossWeight"/>
> >
> > <s:textfield label="Net Weight(Gms):" name="netWeight"/>
> >
> > <s:textfield label="Diamond Weight:" name="diamondWeight"/>
> >
> > <s:textfield label="Gold Rate(Rs):" name="goldRate"/>
> >
> > <s:textfield label="Amount:" name="amount"/>
> >
> > <s:submit label="Save" align="center" />
> >
> > </table>
> >
> > </s:form>
> >
> > </body>
> >
> > </html>
> > *my action class*
> >
> >
> > package raisonne.billgeneration;
> >
> > import com.opensymphony.xwork2.ActionSupport;
> > import raisonne.billgeneration.GetBillConnection;
> >
> > public class SaveBillingData extends ActionSupport{
> >
> >  /**
> >  *
> >  */
> >  private static final long serialVersionUID = -5856152810070496725L;
> >  private int rowInserted=0;
> >  private String date=null;
> >  private String voucherNumber=null;
> >  private String customerName=null;
> >  private String address=null;
> >  private String contactNo=null;
> >  private String itemName=null;
> >  private String purity=null;
> >  private double grossWeight=0.0;
> >  private double netWeight=0.0;
> >  private double diamondWeight=0.0;
> >  private double goldRate=0.0;
> >  private double amount=0.0;
> >
> > /*
> >
> > Getter and Setter Method
> >
> > */
> >
> >  public String execute() throws Exception{
> >  GetBillConnection billCollection =new GetBillConnection();
> >
> rowInserted=billCollection.AddBillingData(getDate(),getVoucherNumber(),
> >   getCustomerName(),getAddress(),getContactNo(),
> >   getItemName(),getPurity(),getGrossWeight(),
> >   getNetWeight(),getDiamondWeight(),getGoldRate(),getAmount());
> >  if(rowInserted>0){
> >   addActionMessage("Quotation data has been submitted successfully");
> >   return SUCCESS;
> >  }
> >  else{
> >   addActionMessage("Error while saving Quotation data, Pleaes retry");
> >   return INPUT;
> >  }
> >  }
> >
> >
> > }
> >
> >
> > lastly *Struts.xml file*
> >
> >
> > <package name="raisonne.billgeneration" extends="struts-default"
> namespace=
> > "/">
> >
> > <action name="SaveBill"
> class="raisonne.billgeneration.SaveBillingData">
> >
> > <result name="success">/BillGeneration/Quotation.jsp</result>
> >
> > <result name="input">/Login/Login.jsp</result>
> >
> > </action>
> >
> > </package>
> > -aum
> >
> >
> >
> >
> > On 4/19/08, Nils-Helge Garli Hegvik <nilsga@(protected):
> > >
> > > It would be a lot easier helping if you show us some configuration
> > > files and code....
> > >
> > > Nils-H
> > >
> > > On Sat, Apr 19, 2008 at 6:59 AM, aum strut <aum.struts@(protected)>
> wrote:
> > > > yes you are right
> > > >
> > > > not providing complete information in one mail is really not good
> > > >
> > > > i wil take this in to account in future...
> > > >
> > > > well i am not using spring in my application i have a simple form
> which
> > > is
> > > > sending the input values to my action where i am adding these in
> to the
> > > data
> > > > base using simple jdbc call everything is working fine i am even
> > > getting
> > > > back the success response in my add form.
> > > >
> > > > i am not able to understand what u mean by "not have your action
> > > defined as
> > > > being "prototype"
> > > > scope"
> > > >
> > > > aum
> > > >
> > > >
> > > >
> > > >
> > > > On 4/19/08, Dave Newton <newton.dave@(protected):
> > > > >
> > > > > Are you using Spring?
> > > > >
> > > > > Would it be possible for you to provide more useful information
> in
> > > your
> > > > > initial emails rather than generating a stream of a half-dozen
> or
> > > more?
> > > > > It's
> > > > > rather frustrating; we've gone through this before.
> > > > >
> > > > > One common error is to not have your action defined as being
> > > "prototype"
> > > > > scope. Since actions are instantiated on each request (normally)
> it's
> > > not
> > > > > typical to see this behavior without some effort on your part or
> > > > > mis-configuration.
> > > > >
> > > > > Dave
> > > > >
> > > > > --- aum strut <aum.struts@(protected):
> > > > >
> > > > > > currently i am using struts-2.0.11.1
> > > > > >
> > > > > > On 4/19/08, Dave Newton <newton.dave@(protected):
> > > > > > >
> > > > > > > Which version of Struts?
> > > > > > >
> > > > > > > --- aum strut <aum.struts@(protected):
> > > > > > >
> > > > > > > > Hi all,
> > > > > > > >
> > > > > > > > a little point which i want to know.
> > > > > > > > i have a form by which we can add billing detais in the
> > > database
> > > > > > > >
> > > > > > > > form is working fine, it is adding the value to the
> database as
> > > > > > > expected,
> > > > > > > > the problem whcih i am facing is even after successfully
> > > submitting
> > > > > the
> > > > > > > > values, it is not clearing the form values which has been
> added
> > > > > > > >
> > > > > > > > i can clear the fields values using java script,but i
> want to
> > > know
> > > > > is
> > > > > > > it
> > > > > > > > possible using Struts2,is theer any was that when ever
> data is
> > > > > > submitted
> > > > > > > > successfully in the database form fields values should get
> > > cleared.
> > > > > > > >
> > > > > > > >
> > > > > > > > any help in this regard will be much appriciated.
> > > > > > > >
> > > > > > > >
> > > > > > > > thanks in advance
> > > > > > > > --aum
> > > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > ---------------------------------------------------------------------
> > > > > > > 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)
> > > > >
> > > > >
> > > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: user-unsubscribe@(protected)
> > > For additional commands, e-mail: user-help@(protected)
> > >
> > >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>

Attachment: user_185634.ezm (zipped)
Hi,

What exactly the benefits of moving from struts 2.0.6
to
2.0.11.

As far as the Ajax support is concerned, we do have a
requirement to have a editable grid,

Is this facilitated within struts 2?

What is the best way to achieve it.

Thanks


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

Attachment: user_185640.ezm (zipped)
tom tom wrote:
> Hi,
>
> What exactly the benefits of moving from struts 2.0.6
> to
> 2.0.11.
>
>  
Mainly important bugfixes and security fixes. There are few new features.
2.0.x -> 2.1 provides better ajax tags and new plugins.
> As far as the Ajax support is concerned, we do have a
> requirement to have a editable grid,
>
> Is this facilitated within struts 2?
>  
There is no tag bundled in struts 2 but Struts2 can serve data to
editable grids provided by any client-side library.
> What is the best way to achieve it.
>  
Review the available editable datagrid options (eg. yui, ext, dojo1+),
examine their table model requirements, create an action that serves the
model (as json, xml or whatever the component requires).


Attachment: user_185635.ezm (zipped)

Hi all ,

We are using struts to build a Global website which will be localized in
over 30 languages.
One of our requirement for SEO is to not have any locale field in the URL's
.
In standard approach when we localize a site we have a locale field in the
URL which is then used to identify the correct struts config file.
e.g http://localhost:5555/en_US/home.do or
http://localhost:5555/en_GB/home.do
We have a corresponding mapping in the web.xml as initparam to Action
Servlet
<init-param>
       <param-name>config/en_US</param-name>
       <param-value>/WEB-INF/struts-en_US.xml</param-value>
    </init-param>

We now want to get rid of teh locale field e.g en_US and en_GB in teh URL's
and still use individual struts file for each locale.

Any thoughts on the above ?

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


Attachment: user_185636.ezm (zipped)
Hi all,

Here I'm with another problem..
I know that I've been sent lots os questions, but before I aways give a
check at documentation and showcase. I hope you can give me a hand.
--
I want to link two autocompleters. My action is setting the correct secound
list. The problem is that it's never rendered on my jsp.

The objective is to list all cities from a state.

Here's my code:

JSP -----------------------------------
<s:url id="urlListCli" action="listarCidades" namespace="/cliente"/>
<s:action var="actListarUfs" name="listarUfs" namespace="/cliente" />

    <sx:autocompleter list="#actListarUfs.ufs" listKey="cd"
listValue="sigla" label="UF"
       name="siglaUf" id="siglaUf" required="true"
cssClass="autoCompleter" forceValidOption="true"
valueNotifyTopics="/listCidades"/>

    <sx:autocompleter label="Cidade" id="idCidade" name="idCidade"
       list="cidades" listKey="cd" listValue="nome"
       href="%{urlListCli}" autoComplete="true" formId="formCli"
       listenTopics="/listCidades" forceValidOption="true"
preload="false"/>

struts.xml ------------------------------

  <action name="listarCidades" method="listarCidades"
class="br.com.sgvdba.actions.cliente.ClienteAction">
        <result></result>
    </action>

ActionClass -------------------------

  public String listarCidades(){
    this.cidades = getCidadeFacade().recuperarPorUf(siglaUf);
    return Action.SUCCESS;
  }


I also tried to follow the example in show case (linking two
autocompleters), so, on this way I just had success returning a simple array
of string with one dimension, and I thought "ok, I have the correct
description of the field, what about its id?". In this way my action as
returning a .ftl.

Tanks a lot!

Attachment: user_185637.ezm (zipped)
Hi,

We have portlet based ajax application written using
struts 2.0.6, With the introduction of the struts
2.0.11 we can see lot of bugs have been resolved.

We would like to start the next project using struts
2.0.11, both application will co exist in the same
tomcat server.

Will there be any class loading or any other issue if
we have struts 2.0.6 and struts 2.0.11 application in
the same tomcat server.

Thanks



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

Attachment: user_185638.ezm (zipped)
Hi Jeromy,
The solutions provided doesn't work for me.
I still have the pop up message.

One more thing.
I found out that struts2 dojo have some missing files.
I used fidler to check :

/struts/dojo/src/i18n/calendar/nls/en-us/gregorian.js      
/struts/dojo/src/i18n/calendar/nls/en/gregorianExtras.js      
/struts/dojo/src/i18n/calendar/nls/en-us/gregorianExtras.js      
/struts/dojo/src/widget/nls/en/TimePicker.js       /struts/dojo/src/widget/nls/en-us/TimePicker.js          
/struts/dojo/src/widget/nls/en/DropdownTimePicker.js        
/struts/dojo/src/widget/nls/en-us/DropdownTimePicker.js  

Will this be the problem.

I'm using struts2-core-2.0.9.jar



Jeromy Evans <jeromy.evans@(protected):
> Hi,
> I'm trying to create a simple ajax using struts2. The ajax is running fine.But I'm trying to fix this error message when using https server. The alert message is "This page contains both secure and nonsecure items.
>
> Do you wish to display the nonsecure items?".
> ...
>  
>  
>  
>
>
>
>
> Anyone knows what am I doing wrong here?
>    
>  

Unfortunately it's a bug in dojo 0.4 [Ticket#2390]. You have no option
but to patch it manually or upgrade to a new version. It's possible
that it's fixed in Struts 2.1 (using Dojo0.4.3) but is definitely
present in Struts 2.0.x (Dojo 0.4.0).

I don't use Dojo any more, but remarkably I kept notes about how I
patched it. You will need to extract dojo, modify it and recompress
using the instructions at :
http://cwiki.apache.org/S2WIKI/creating-a-custom-dojo-profile-for-struts-20x.html

http://trac.dojotoolkit.org/ticket/2390
To prevent the "This page contains both secure and nonsecure items"
issue present in IE7.
When you read the ticket and find the following file it will be obvious
what the change is:
src/html/iframe.js

var html="";
if (dojo.render.html.ie70) {
  html="
    + " style='position: absolute; left: 0px; top: 0px; width: 100%;
height: 100%;"
    + "z-index: -1; filter:Alpha(Opacity=\"0\");' "
    + ">";
} else {
  html="
    + "' style='position: absolute; left: 0px; top: 0px; width:
100%; height: 100%;"
    + "z-index: -1; filter:Alpha(Opacity=\"0\");' "
    + ">";
}

Good luck,
Jeromy Evans




---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@(protected)
For additional commands, e-mail: user-help@(protected)



   
---------------------------------
Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it now.

Attachment: user_185639.ezm (zipped)
Simon Sew wrote:
> Hi Jeromy,
> The solutions provided doesn't work for me.
> I still have the pop up message.
>
> One more thing.
> I found out that struts2 dojo have some missing files.
> I used fidler to check :
>
> /struts/dojo/src/i18n/calendar/nls/en-us/gregorian.js      
> /struts/dojo/src/i18n/calendar/nls/en/gregorianExtras.js      
> /struts/dojo/src/i18n/calendar/nls/en-us/gregorianExtras.js      
> /struts/dojo/src/widget/nls/en/TimePicker.js       /struts/dojo/src/widget/nls/en-us/TimePicker.js          
> /struts/dojo/src/widget/nls/en/DropdownTimePicker.js        
> /struts/dojo/src/widget/nls/en-us/DropdownTimePicker.js  
>
> Will this be the problem.
>
>  

No, missing files won't cause the warning message. Those missing files
will prevent the DatePicker from working. That implies the custom dojo
profile didn't include the DatePicker.

The IE warning message is caused by dojo (or something else in the page)
loading a file via HTTP within an secure page. The patch I provided
fixed Dojo's use of one particular iframe (used with remote divs).
You'll need to isolate exactly which widget is causing the problem by
taking sections out of your page.

Also while debugging use the uncompressed dojo file. Rename the
compressed one to something else and substitute in the uncompressed
version. You can add breakpoints to find the precise cause.

I did have an application working in IE7 HTTPS using Struts 2.0.9 with
the following widgets: div, datepicker, timepicker, tabbedpanel
I stopped using Dojo when I needed asyc fileupload in HTTPS in IE7.

You may need to contact the Dojo user group to ask for more
information. You're using Dojo 0.4.0 though so they may just tell you
to upgrade.

Hope that helps. It's a difficult problem to solve.

regards,
Jeromy Evans


Attachment: user_185641.ezm (zipped)
Hi,

I have pinpoint the problem to this remote div.. The code as below.


<s:div id="contentReport" href="%{report_dynamic}"
autoStart="false" listenTopics="/refreshContent" formId="report_form"

showErrorTransportText="false" theme="ajax">
I tried change the iframe.js but to no avail.
I tried using
1) https://
2) https://about:blank
3) javascript:false
4) "blank"

I have even tried 2.0.11 which is the latest one. The bug still there.
Is there a 2.1 version out there?

Jeromy Evans <jeromy.evans@(protected):
> Hi Jeromy,
> The solutions provided doesn't work for me.
> I still have the pop up message.
>
> One more thing.
> I found out that struts2 dojo have some missing files.
> I used fidler to check :
>
> /struts/dojo/src/i18n/calendar/nls/en-us/gregorian.js      
> /struts/dojo/src/i18n/calendar/nls/en/gregorianExtras.js      
> /struts/dojo/src/i18n/calendar/nls/en-us/gregorianExtras.js      
> /struts/dojo/src/widget/nls/en/TimePicker.js       /struts/dojo/src/widget/nls/en-us/TimePicker.js          
> /struts/dojo/src/widget/nls/en/DropdownTimePicker.js        
> /struts/dojo/src/widget/nls/en-us/DropdownTimePicker.js  
>
> Will this be the problem.
>
>  

No, missing files won't cause the warning message. Those missing files
will prevent the DatePicker from working. That implies the custom dojo
profile didn't include the DatePicker.

The IE warning message is caused by dojo (or something else in the page)
loading a file via HTTP within an secure page. The patch I provided
fixed Dojo's use of one particular iframe (used with remote divs).
You'll need to isolate exactly which widget is causing the problem by
taking sections out of your page.

Also while debugging use the uncompressed dojo file. Rename the
compressed one to something else and substitute in the uncompressed
version. You can add breakpoints to find the precise cause.

I did have an application working in IE7 HTTPS using Struts 2.0.9 with
the following widgets: div, datepicker, timepicker, tabbedpanel
I stopped using Dojo when I needed asyc fileupload in HTTPS in IE7.

You may need to contact the Dojo user group to ask for more
information. You're using Dojo 0.4.0 though so they may just tell you
to upgrade.

Hope that helps. It's a difficult problem to solve.

regards,
Jeromy Evans


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@(protected)
For additional commands, e-mail: user-help@(protected)



   
---------------------------------
Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it now.

Attachment: user_185642.ezm (zipped)
Simon Sew wrote:
> Hi,
>
> I have pinpoint the problem to this remote div.. The code as below.
>
>
> <s:div id="contentReport" href="%{report_dynamic}"
> autoStart="false" listenTopics="/refreshContent" formId="report_form"
>
> showErrorTransportText="false" theme="ajax">
> I tried change the iframe.js but to no avail.
> I tried using
> 1) https://
> 2) https://about:blank
> 3) javascript:false
> 4) "blank"
>
> I have even tried 2.0.11 which is the latest one. The bug still there.
> Is there a 2.1 version out there?
>
>  

I know it's silly, but double-check that that the right versions of the
dojo files are being served up. IE aggressively caches them. Include an
alert to be sure. There has to be an HTTP request in there somewhere.

Yes, there is a Struts2.1 available. It's not GA though. It uses Dojo
0.4.3. The tags are much better than the 2.0 version but I don't know
if IE7 SSL is better supported.

http://struts.apache.org/2.x/docs/version-notes-211.html

Review the migration guide before proceeding as it could be some effort:
http://cwiki.apache.org/S2WIKI/troubleshooting-guide-migrating-from-struts-20x-to-21x.html


Attachment: user_185643.ezm (zipped)
Hi,

I am new to struts 2 and trying to figure out a problem that I am having w.r.t. I18n. My application is supposed to serve multiple clients per hosted instance of the application and the requirement is to somehow support the requirement of display of client specific text for the same message resource key based on the logged in user. E.g. so if an end user is logging on to the system on behalf of customer 1 the same key "welcome.user" should display message different from what another end user of customer 2 sees for the same message resource key. Note that the locale is still the same i.e. US English. I was thinking about the following solution:

Solution: I will extend ActionSupport class and all its getText method such that each key will be prefixed by something unique to the customer like customer_id before the lookup and each messageresouce file will define the same key multiple times with the customer_id as prefix as needed. E.g. cust1.welcome.user, cust2.welcome.user etc.

Now my questions are:
1) If I do the above, do I always have to use the getText way of looking up the messages? If I use the key attribute of the UI tags, will the overridden getText methods be still called?
2) Also is there any major problem with the approach above to solve the particular problem I am having?

Thanks and regards
Pranav




   ____________________________________________________________________________________
Be a better friend, newshound, and
know-it-all with Yahoo! Mobile. Try it now. http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ
©2008 gg3721.com - Jax Systems, LLC, U.S.A.