Java Mailing List Archive

http://www.gg3721.com/

Home » Struts Users Mailing List »

user Digest 16 Jul 2008 08:28:04 -0000 Issue 8144

user-digest-help

2008-07-16


Author LoginPost Reply

user Digest 16 Jul 2008 08:28:04 -0000 Issue 8144

Topics (messages 188953 through 188982):

Re: struts2 jsp s:set question
 188953 by: Lukasz Lenart
 188954 by: Harden ZHU
 188975 by: Lukasz Lenart

Re: about iterating values
 188955 by: Laurie Harper

ActionSupport.input()-- what's it for?
 188956 by: Brad A Cupit
 188957 by: Dave Newton

Re: DateTimePicker
 188958 by: nauke.

Re: Submit a struts form using javascript
 188959 by: rapsy
 188960 by: Dave Newton
 188976 by: Lukasz Lenart

Re: Problem from defining JavaBean as an attribute inside ActionForm
 188961 by: Chandramouli P

'include' struts.xml stuff is broken?
 188962 by: Dave Belfer-Shevett
 188967 by: Wes Wannemacher

Re: struts menu problem
 188963 by: nauke.
 188977 by: Lukasz Lenart
 188978 by: nauke.
 188980 by: Al Sutton
 188982 by: Antonio Petrelli

Struts tags ID generation
 188964 by: Phan Le
 188968 by: Wes Wannemacher
 188972 by: Phan Le
 188973 by: Wes Wannemacher
 188981 by: Phan Le

struts2 file (how to define files of type)
 188965 by: Nicole Luneburg
 188969 by: Wes Wannemacher
 188970 by: Nicole Luneburg

Re: Struts 2.1 tags + JSTL EL?
 188966 by: Oleg Mikheev
 188971 by: Chris Pratt

Re: an issue with my Action class - help me
 188974 by: Narayana S

[ANN] Struts 2.0.11.2 General Availability Release with Important Security Fix
 188979 by: Rene Gielen

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

<% Company cmp = request.getAttribute("company"); %>
<%= cmp.formatName("aa") %>

but this is ugly ;-(

Better solution is to develop some custom tag.


Regards
--
Lukasz
http://www.lenart.org.pl/

Attachment: user_188954.ezm (zipped)
Ok, Thanks,

In struts1.x, there is tag like "bean:define". Anything like in struts2?

On Tue, Jul 15, 2008 at 1:18 PM, Lukasz Lenart
<lukasz.lenart@(protected):
> Try
>
> <% Company cmp = request.getAttribute("company"); %>
> <%= cmp.formatName("aa") %>
>
> but this is ugly ;-(
>
> Better solution is to develop some custom tag.
>
>
> Regards
> --
> Lukasz
> http://www.lenart.org.pl/
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>

Attachment: user_188975.ezm (zipped)
> In struts1.x, there is tag like "bean:define". Anything like in struts2?

The problem is in OGNL, which is using ValueStack, it's totally
separated from common request objects.
I don't understand why you want to access variable in <% %> ? It's is
good for constants and not for logic. As I show you, you can call
directly methods from actions or other classes (static for example).
It's much more clean solution.


Regards
--
Lukasz
http://www.lenart.org.pl/

Attachment: user_188955.ezm (zipped)
hns wrote:
> HI
> Thanks for reply
>
> but session is appropriate for large size map stored in it?
> it can works fine?

It certainly *can* work. Whether the session is the best place to keep
this data depends on the size of the list, how much it varies (if at
all) between users, how often it changes, etc. You might be better off
looking into a caching solution at the persistence layer level (e.g.
Hibernate or whatever you use), or, perhaps, building a custom
application cache at the application level (using something like ehcache).

L.


Attachment: user_188956.ezm (zipped)
Hi,
Anybody know what the input() method on ActionSupport is for?

It doesn't seem to be defined by any interfaces. I was hoping that it
was called whenever there was a validation error, but that doesn't seem
to be the case.

Here's the method definition:

public String input() throws Exception {
  return INPUT;
}

Brad Cupit
Louisiana State University - UIS


Attachment: user_188957.ezm (zipped)
--- On Tue, 7/15/08, Brad A Cupit <brad@(protected):
> Anybody know what the input() method on ActionSupport is for?
>
> It doesn't seem to be defined by any interfaces. I was
> hoping that it was called whenever there was a validation
> error, but that doesn't seem to be the case.

It's the default implementation of a method designed for form input; validation is skipped by default.

When you have an action implementing Prepareable it's a convenience, before annotation-based configuration you'd configure two action mappings--the initial form display would use the input() method, submission would use execute().

That's my take on it, anyway.

Dave


Attachment: user_188958.ezm (zipped)
Hi Pablo,

This works for me ... I hope it helps.

At the top of my JSP page I have this:
<s:head theme="ajax" />

Then for the actual datepicker I have:

<s:datetimepicker label="My Date" name="myDate" displayFormat="dd-MMM-yyyy"
/>

My problems with it that I'm just living with are:

1) When I visit the JSP page, if the myDate value is not already populated,
an exception is thrown in my logs (not on the page, so I'm just ignoring it
for now).
2) I can't line up the label value the way I want.


On Tue, Jul 15, 2008 at 9:38 PM, ManiKanta G <manikanta.gade@(protected)>
wrote:

> I would suggest Struts2JSCalendar plug-in, which has lot of features,which
> is working fine for me.
> http://code.google.com/p/struts2jscalendarplugin/
>
> Regards,
> ManiKanta
>
>
> Pablo Vázquez Blázquez wrote:
>
>> Hello,
>>
>> I have several problems with DateTimePicker widget used for selecting
>> times (type="time")
>>
>>
>> a) If no time is in the text input, I can´t write (without using the
>> widget) any. I can use the widget, but I also would like to be able to write
>> it by myself.
>>
>> b) If a time value is in the input text, when I want to edit the time
>> value, I can only set 5 multiples values (if I write 10:01 it is converted
>> to 10:00).
>>
>>
>> Thanks.
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@(protected)
>> For additional commands, e-mail: user-help@(protected)
>>
>>
>
>
> ********** DISCLAIMER **********
> Information contained and transmitted by this E-MAIL is proprietary to Sify
> Limited and is intended for use only by the individual or entity to which it
> is addressed, and may contain information that is privileged, confidential
> or exempt from disclosure under applicable law. If this is a forwarded
> message, the content of this E-MAIL may not have been sent with the
> authority of the Company. If you are not the intended recipient, an agent of
> the intended recipient or a person responsible for delivering the
> information to the named recipient, you are notified that any use,
> distribution, transmission, printing, copying or dissemination of this
> information in any way or in any manner is strictly prohibited. If you have
> received this communication in error, please delete this mail & notify us
> immediately at admin@(protected)
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>

Attachment: user_188959.ezm (zipped)


I am trying to submit two forms at once.

The first form is being submitted by "onclick" event which calls javascript
form.submit() and the second form is submitted by submit button itself when
it is clicked. The first form submission is failing i.e when I try to
retrieve the values of the first form later in the application it is blank.
It is working on local machine but not on production server. Can there be
some network latency issue?
Is there a better way to submit two forms?

Thanks for your response!

<input type="submit" name="method" value="Go"
onclick="javascript:document.forms['firstForm'].submit();" />





Lukasz Lenart wrote:
>
>> I am using struts 1.1 and having problem submitting first form from
>> inside
>> the second form.
>> What happens when the first form is submitted from the second form using
>> javascript? Does it call the 'execute" method of first form?
>
> I don't understand exactly what you mean, when you talk about "inside
> form", could you show some real page?
>
>> For example:
>> Here is the code:
>> <form name='secondForm' method='post' action='secondForm.do'>
>>
>> <input type="submit" name="method" value="Go"
>> onclick="javascript:document.forms['firstForm'].submit();" />
>> </form>
>>
>> In the above code, "firstForm" is a struts form and it not getting
>> submitted. The values are getting lost.
>
> What you mean "not getting submitted"? Do you have any JavaScript error or
> what?
>
>> The weird thing is works on my local machine but when I deploy on
>> production
>> server it doesn't work. Any help is greatly appreciated.
>
> Do you have locally the same server as on production? Did you try to
> access application which is running on your dev machine from some
> other computer?
>
>
> Regards
> --
> Lukasz
> http://www.lenart.org.pl/
>
> ---------------------------------------------------------------------
> 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_188960.ezm (zipped)
--- On Tue, 7/15/08, rapsy <roshini.bhalla@(protected):
> I am trying to submit two forms at once.

Is that even possible? I guess I don't really see how that would work.

Not sure why you'd try to do that in the first place, but you'd probably have better luck (a) using a single form, or (b) copying one form's values to the other and submitting only one.

Dave


Attachment: user_188976.ezm (zipped)
> I am trying to submit two forms at once.

Khe? As I know, it isn't possible. If you send them to the same
action, just use one form for all the fields. If you send them to
separated actions (different action attribute), you have to made two
request at the same time, but there isn't something like
multithreading in JavaScript/WebBrowser ;-)
It can works if you will use AJAX to submit values.

> The first form is being submitted by "onclick" event which calls javascript
> form.submit()

An the request goes... and browser is waiting for response

> and the second form is submitted by submit button itself when
> it is clicked. The first form submission is failing i.e when I try to
> retrieve the values of the first form later in the application it is blank.

And probably, the second request override the first one, that's why
you got blank form.

> It is working on local machine but not on production server. Can there be
> some network latency issue?

Did you try access your local machine from other computer? Web browser
can behave differently base on localhost address, it allows for more
for localhost, than for remote address. Try to access your local
version from some other computer.

> Is there a better way to submit two forms?

AJAX


Regards
--
Lukasz
http://www.lenart.org.pl/

Attachment: user_188961.ezm (zipped)
Its working now. Thank you very much for the replies.

The problem was that the naming convention (it was like sStreet, sCity and the getter/setters were getStreet, getCity etc.)of my attributes and I did not initialize the inside bean in the ActionForm.

Thanks & Regards,
Chandra.



> To: user@(protected)>
_________________________________________________________________
Missed your favourite programme? Stop surfing TV channels and start planning your weekend TV viewing with our comprehensive TV Listing
http://entertainment.in.msn.com/TV/TVListing.aspx

Attachment: user_188962.ezm (zipped)
This seems like it should work, but I'm getting all sorts of hassles, and
the documentation page for this, naturally, provides no examples of what
the include file should look like.

My struts.xml has...

<!DOCTYPE struts PUBLIC
  "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
  "http://struts.apache.org/dtds/struts-2.0.dtd">
<struts>
 <include file="struts-editevent.xml">
 <package name="CONGO" extends="struts-default">
   <interceptors>
   [blah blah blah]
   </interceptors>
 (more actions)
 </package>
</struts>

The 'struts-editevent.xml' has:
 <action name="coconut/viewEditEvent" method="load"
class="com.stonekeep.congo.coconut.EditEvent">
   <interceptor-ref name="mystack" />
   <result
name="success">/WEB-INF/jsp/coconut/EditEventForm.jsp</result>
   <result name="login"
type="redirect-action">coconut/showloginpage</result>
 </action>

 <action name="coconut/postEditEvent" method="update"
class="com.stonekeep.congo.coconut.EditEvent">
   <interceptor-ref name="mystack" />
   <result
name="success">/WEB-INF/jsp/coconut/Maintenance.jsp</result>
   <result
name="input">/WEB-INF/jsp/coconut/EditEventForm.jsp</result>
   <result name="login"
type="redirect-action">coconut/showloginpage</result>
 </action>

A basic block of actions.

I'm getting XML validatoin errors up the wazoo because the
struts-editevent.xml file isn't well-formed. If I put it in <struts>
blocks, I get "you're referencing interceptors that don't exist".

If I try and duplicate the entire package, interceptors, and DTD
definition into the include file, I get package collisions.

My take is the <include> function does not work as described in the
documentation. It should be a linear include, and the resulting document
is parsed by SAX, but that doesn't seem to be happening.

Can someone give me an example of an included XML file that actually
works?

Here are links to what I'm seeing:
My main struts.xml: http://pastebin.stonekeep.com/4955

My struts-editevent.xml: http://pastebin.stonekeep.com/4956

What happens when I deploy:

http://pastebin.stonekeep.com/4957

Note that says "no grammar found". Adding the DTD says "you need a
package name in your struts block" - etc etc etc. It never really
resolves.

Can someone show me an <include> setup that actually works?

--
-------------------.--------.-------------------------------.
Dave Belfer-Shevett \ KB1FWR \ JID: dbs@(protected) \
blog:planet-geek.com >--------'-----------------------------------.
dbs@(protected)   \
-------------------<     List; Please Wait For Next Error     |
             \______________________________________________/

Attachment: user_188967.ezm (zipped)
When you use an include, the entire included document is parsed and
added to the configuration. This means that the included document must
work as if it were a stand-alone configuration file. You'll have to not
only create well-formed struts xml files, but package configuration as
well. If you're going to reuse interceptors, etc., then you'll need to
pull them in with "extends".

-Wes

On Tue, 2008-07-15 at 23:53 -0400, Dave Belfer-Shevett wrote:
> This seems like it should work, but I'm getting all sorts of hassles, and
> the documentation page for this, naturally, provides no examples of what
> the include file should look like.
>
> My struts.xml has...
>
> <!DOCTYPE struts PUBLIC
>    "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
>    "http://struts.apache.org/dtds/struts-2.0.dtd">
> <struts>
>  <include file="struts-editevent.xml">
>  <package name="CONGO" extends="struts-default">
>    <interceptors>
>    [blah blah blah]
>    </interceptors>
>  (more actions)
>  </package>
> </struts>
>
> The 'struts-editevent.xml' has:
>  <action name="coconut/viewEditEvent" method="load"
> class="com.stonekeep.congo.coconut.EditEvent">
>    <interceptor-ref name="mystack" />
>    <result
> name="success">/WEB-INF/jsp/coconut/EditEventForm.jsp</result>
>    <result name="login"
> type="redirect-action">coconut/showloginpage</result>
>  </action>
>
>  <action name="coconut/postEditEvent" method="update"
> class="com.stonekeep.congo.coconut.EditEvent">
>    <interceptor-ref name="mystack" />
>    <result
> name="success">/WEB-INF/jsp/coconut/Maintenance.jsp</result>
>    <result
> name="input">/WEB-INF/jsp/coconut/EditEventForm.jsp</result>
>    <result name="login"
> type="redirect-action">coconut/showloginpage</result>
>  </action>
>
> A basic block of actions.
>
> I'm getting XML validatoin errors up the wazoo because the
> struts-editevent.xml file isn't well-formed. If I put it in <struts>
> blocks, I get "you're referencing interceptors that don't exist".
>
> If I try and duplicate the entire package, interceptors, and DTD
> definition into the include file, I get package collisions.
>
> My take is the <include> function does not work as described in the
> documentation. It should be a linear include, and the resulting document
> is parsed by SAX, but that doesn't seem to be happening.
>
> Can someone give me an example of an included XML file that actually
> works?
>
> Here are links to what I'm seeing:
> My main struts.xml: http://pastebin.stonekeep.com/4955
>
> My struts-editevent.xml: http://pastebin.stonekeep.com/4956
>
> What happens when I deploy:
>
> http://pastebin.stonekeep.com/4957
>
> Note that says "no grammar found". Adding the DTD says "you need a
> package name in your struts block" - etc etc etc. It never really
> resolves.
>
> Can someone show me an <include> setup that actually works?
>


Attachment: user_188963.ezm (zipped)
Hi,

I don't suppose anyone knows why this issue is occurring ... ?

Thanks

On Mon, Jul 14, 2008 at 4:30 PM, nauke. <nauke0@(protected):

> Hi!
>
> I'm using struts version 2.0.11.
> I am using struts menu, which works provided it is not on top of a table
> ...
> Please see screenshot of issue here:
> http://mytmpdir.googlepages.com/menu.jpg
>
> No idea how I can fix this!
> Does anyone?
>
> Thanks guys
>
>
>

Attachment: user_188977.ezm (zipped)
Try with other browser than IE, it looks like a common problem in IE
with layering.


Regards
--
Lukasz
http://www.lenart.org.pl/

Attachment: user_188978.ezm (zipped)
Hi,

Thanks for replying.
It occurs in firefox too.
the customer for this will predominantly use IE so will have to get it
working for IE in the end anyway :( :( :(

On Wed, Jul 16, 2008 at 4:04 PM, Lukasz Lenart <lukasz.lenart@(protected)>
wrote:

> Try with other browser than IE, it looks like a common problem in IE
> with layering.
>
>
> Regards
> --
> Lukasz
> http://www.lenart.org.pl/
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>

Attachment: user_188980.ezm (zipped)
Have you looked at using the zindex property in your stylesheet?
(http://www.w3schools.com/Css/pr_pos_z-index.asp)

nauke. wrote:
> Hi,
>
> Thanks for replying.
> It occurs in firefox too.
> the customer for this will predominantly use IE so will have to get it
> working for IE in the end anyway :( :( :(
>
> On Wed, Jul 16, 2008 at 4:04 PM, Lukasz Lenart <lukasz.lenart@(protected)>
> wrote:
>
>> Try with other browser than IE, it looks like a common problem in IE
>> with layering.
>>
>>
>> Regards
>> --
>> Lukasz
>> http://www.lenart.org.pl/
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@(protected)
>> For additional commands, e-mail: user-help@(protected)
>>
>>
>


Attachment: user_188982.ezm (zipped)
2008/7/14 nauke. <nauke0@(protected)>:
> Hi!
>
> I'm using struts version 2.0.11.
> I am using struts menu, which works provided it is not on top of a table ...
> Please see screenshot of issue here:
> http://mytmpdir.googlepages.com/menu.jpg
>
> No idea how I can fix this!
> Does anyone?

Probably you have to ask the Struts menu maintainers:
http://struts-menu.sourceforge.net/mail-lists.html

Antonio

Attachment: user_188964.ezm (zipped)

Hi there,
I am new to this mailing list and currently experiencing strange
behavior when rendering ids for HTML elements.
I have something like this in my HTML code

<div
class="fieldWrap" id="wwctrl_com.mycompany.profile:profile-app:war:
0.0.1-SNAPSHOT">
I didn't specify any id in my <s:textfield> tag

Any one know how Struts 2 do this?
Thanks




This email, including attachments, is intended only for the addressee
and may be confidential, privileged and subject to copyright. If you
have received this email in error, please advise the sender and delete
it. If you are not the intended recipient of this email, you must not
communicate to others content that is confidential or subject to
copyright, unless you have the consent of the content owner.

Attachment: user_188968.ezm (zipped)
Struts 2 will create an id for you when using it's built-in tags. I've
never seen it quite as long as yours... Perhaps you built from a maven
archetype and might have passed in some parameters wrong?

When you leave it up to struts, it will generate unique ids and it will
work w/o intervention. It also works fine if you specify an id, so it's
mostly a matter of preference and whether or not you need to know the id
for some added javascript.

-Wes

On Wed, 2008-07-16 at 14:33 +1000, Phan Le wrote:
> Hi there,
> I am new to this mailing list and currently experiencing strange
> behavior when rendering ids for HTML elements.
> I have something like this in my HTML code
>
> <div
>  class="fieldWrap" id="wwctrl_com.mycompany.profile:profile-app:war:
> 0.0.1-SNAPSHOT">
> I didn't specify any id in my <s:textfield> tag
>
> Any one know how Struts 2 do this?
> Thanks
>
>  
>  
>
> This email, including attachments, is intended only for the addressee
> and may be confidential, privileged and subject to copyright. If you
> have received this email in error, please advise the sender and delete
> it. If you are not the intended recipient of this email, you must not
> communicate to others content that is confidential or subject to
> copyright, unless you have the consent of the content owner.


Attachment: user_188972.ezm (zipped)
Thanks for the response Wes, I do use maven to build.
Is there anyway that I can force struts NOT to auto-generate IDs for
me? any properties?
Thanks


On 16/07/2008, at 3:15 PM, Wes Wannemacher wrote:

> Struts 2 will create an id for you when using it's built-in tags. I've
> never seen it quite as long as yours... Perhaps you built from a maven
> archetype and might have passed in some parameters wrong?
>
> When you leave it up to struts, it will generate unique ids and it
> will
> work w/o intervention. It also works fine if you specify an id, so
> it's
> mostly a matter of preference and whether or not you need to know
> the id
> for some added javascript.
>
> -Wes
>
> On Wed, 2008-07-16 at 14:33 +1000, Phan Le wrote:
>> Hi there,
>> I am new to this mailing list and currently experiencing strange
>> behavior when rendering ids for HTML elements.
>> I have something like this in my HTML code
>>
>> <div
>> class="fieldWrap" id="wwctrl_com.mycompany.profile:profile-app:war:
>> 0.0.1-SNAPSHOT">
>> I didn't specify any id in my <s:textfield> tag
>>
>> Any one know how Struts 2 do this?
>> Thanks
>>
>>
>>
>>
>> This email, including attachments, is intended only for the addressee
>> and may be confidential, privileged and subject to copyright. If you
>> have received this email in error, please advise the sender and
>> delete
>> it. If you are not the intended recipient of this email, you must
>> not
>> communicate to others content that is confidential or subject to
>> copyright, unless you have the consent of the content owner.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>


Attachment: user_188973.ezm (zipped)
Sure, specify your own id attribute...

-Wes

On Wed, 2008-07-16 at 15:45 +1000, Phan Le wrote:
> Thanks for the response Wes, I do use maven to build.
> Is there anyway that I can force struts NOT to auto-generate IDs for
> me? any properties?
> Thanks
>
>
> On 16/07/2008, at 3:15 PM, Wes Wannemacher wrote:
>
> > Struts 2 will create an id for you when using it's built-in tags. I've
> > never seen it quite as long as yours... Perhaps you built from a maven
> > archetype and might have passed in some parameters wrong?
> >
> > When you leave it up to struts, it will generate unique ids and it
> > will
> > work w/o intervention. It also works fine if you specify an id, so
> > it's
> > mostly a matter of preference and whether or not you need to know
> > the id
> > for some added javascript.
> >
> > -Wes
> >
> > On Wed, 2008-07-16 at 14:33 +1000, Phan Le wrote:
> >> Hi there,
> >> I am new to this mailing list and currently experiencing strange
> >> behavior when rendering ids for HTML elements.
> >> I have something like this in my HTML code
> >>
> >> <div
> >> class="fieldWrap" id="wwctrl_com.mycompany.profile:profile-app:war:
> >> 0.0.1-SNAPSHOT">
> >> I didn't specify any id in my <s:textfield> tag
> >>
> >> Any one know how Struts 2 do this?
> >> Thanks
> >>
> >>
> >>
> >>
> >> This email, including attachments, is intended only for the addressee
> >> and may be confidential, privileged and subject to copyright. If you
> >> have received this email in error, please advise the sender and
> >> delete
> >> it. If you are not the intended recipient of this email, you must
> >> not
> >> communicate to others content that is confidential or subject to
> >> copyright, unless you have the consent of the content owner.
> >
> >
> > ---------------------------------------------------------------------
> > 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_188981.ezm (zipped)
What if I dont want to put Id at all and leave it blank?
Cheers
On 16/07/2008, at 3:49 PM, Wes Wannemacher wrote:

> Sure, specify your own id attribute...
>
> -Wes
>
> On Wed, 2008-07-16 at 15:45 +1000, Phan Le wrote:
>> Thanks for the response Wes, I do use maven to build.
>> Is there anyway that I can force struts NOT to auto-generate IDs for
>> me? any properties?
>> Thanks
>>
>>
>> On 16/07/2008, at 3:15 PM, Wes Wannemacher wrote:
>>
>>> Struts 2 will create an id for you when using it's built-in tags.
>>> I've
>>> never seen it quite as long as yours... Perhaps you built from a
>>> maven
>>> archetype and might have passed in some parameters wrong?
>>>
>>> When you leave it up to struts, it will generate unique ids and it
>>> will
>>> work w/o intervention. It also works fine if you specify an id, so
>>> it's
>>> mostly a matter of preference and whether or not you need to know
>>> the id
>>> for some added javascript.
>>>
>>> -Wes
>>>
>>> On Wed, 2008-07-16 at 14:33 +1000, Phan Le wrote:
>>>> Hi there,
>>>> I am new to this mailing list and currently experiencing strange
>>>> behavior when rendering ids for HTML elements.
>>>> I have something like this in my HTML code
>>>>
>>>> <div
>>>> class="fieldWrap" id="wwctrl_com.mycompany.profile:profile-app:war:
>>>> 0.0.1-SNAPSHOT">
>>>> I didn't specify any id in my <s:textfield> tag
>>>>
>>>> Any one know how Struts 2 do this?
>>>> Thanks
>>>>
>>>>
>>>>
>>>>
>>>> This email, including attachments, is intended only for the
>>>> addressee
>>>> and may be confidential, privileged and subject to copyright. If
>>>> you
>>>> have received this email in error, please advise the sender and
>>>> delete
>>>> it. If you are not the intended recipient of this email, you must
>>>> not
>>>> communicate to others content that is confidential or subject to
>>>> copyright, unless you have the consent of the content owner.
>>>
>>>
>>> ---------------------------------------------------------------------
>>> 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_188965.ezm (zipped)
Hi all,

Got another prob that I've also been trying to fix for a while ...
I have a file upload tag like:

<s:file name="fileName" label="File" />

I want to be able to specify what types of files are shown in the File Upload dialogue's "Files of type" field.
Right now it just says "All Files". I want to limit this to say *.csv files.

I have tried adding this:

accept="application/csv"

also tried:

accept="csv"

but none of these appears to change anything at all.

What am I doing wrong?

Thanks!
Nicole

________________________________
The contents of this email are confidential and may be subject to legal or professional privilege and copyright. No representation is made that this email is free of viruses or other defects. If you have received this communication in error, you may not copy or distribute any part of it or otherwise disclose its contents to anyone. Please advise the sender of your incorrect receipt of this correspondence.

Attachment: user_188969.ezm (zipped)
I could be wrong, but I don't think there is a reliable method to
accomplish what you're looking for...

http://htmlhelp.com/reference/html40/forms/input.html#file

Although it looks like it's part of the spec, I think browsers ignore
attempts at setting "accept"



On Wed, 2008-07-16 at 14:06 +0930, Nicole Luneburg wrote:
> Hi all,
>
> Got another prob that I've also been trying to fix for a while ...
> I have a file upload tag like:
>
> <s:file name="fileName" label="File" />
>
> I want to be able to specify what types of files are shown in the File Upload dialogue's "Files of type" field.
> Right now it just says "All Files". I want to limit this to say *.csv files.
>
> I have tried adding this:
>
> accept="application/csv"
>
> also tried:
>
> accept="csv"
>
> but none of these appears to change anything at all.
>
> What am I doing wrong?
>
> Thanks!
> Nicole
>
> ________________________________
> The contents of this email are confidential and may be subject to legal or professional privilege and copyright. No representation is made that this email is free of viruses or other defects. If you have received this communication in error, you may not copy or distribute any part of it or otherwise disclose its contents to anyone. Please advise the sender of your incorrect receipt of this correspondence.


Attachment: user_188970.ezm (zipped)
oh bummer that sucks :(
I just read that comment from the link you sent me:

"Current browsers generally ignore the ACCEPT attribute."

Grrr

Thanks for showing me that, I won't give up just yet so fingers crossed!
Maybe there's a workaround hehe!

Nicole

-----Original Message-----
From: Wes Wannemacher [mailto:wesw@(protected)]
Sent: Wednesday, 16 July 2008 2:49 PM
To: Struts Users Mailing List
Subject: Re: struts2 file (how to define files of type)

I could be wrong, but I don't think there is a reliable method to
accomplish what you're looking for...

http://htmlhelp.com/reference/html40/forms/input.html#file

Although it looks like it's part of the spec, I think browsers ignore
attempts at setting "accept"



On Wed, 2008-07-16 at 14:06 +0930, Nicole Luneburg wrote:
> Hi all,
>
> Got another prob that I've also been trying to fix for a while ...
> I have a file upload tag like:
>
> <s:file name="fileName" label="File" />
>
> I want to be able to specify what types of files are shown in the File Upload dialogue's "Files of type" field.
> Right now it just says "All Files". I want to limit this to say *.csv files.
>
> I have tried adding this:
>
> accept="application/csv"
>
> also tried:
>
> accept="csv"
>
> but none of these appears to change anything at all.
>
> What am I doing wrong?
>
> Thanks!
> Nicole
>
> ________________________________
> The contents of this email are confidential and may be subject to legal or professional privilege and copyright. No representation is made that this email is free of viruses or other defects. If you have received this communication in error, you may not copy or distribute any part of it or otherwise disclose its contents to anyone. Please advise the sender of your incorrect receipt of this correspondence.


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


The contents of this email are confidential and may be subject to legal or professional privilege and copyright. No representation is made that this email is free of viruses or other defects. If you have received this communication in error, you may not copy or distribute any part of it or otherwise disclose its contents to anyone. Please advise the sender of your incorrect receipt of this correspondence.

Attachment: user_188966.ezm (zipped)
Chris Pratt wrote:
> I proposed a method of enabling JSTL EL safely a while ago, but I
> haven't heard anything (or had any time to actually do anything about
> it myself).

But if they had to get rid of one of two ELs why did they decide to
keep OGNL?
Isn't JSTL more popular and more standard?

Oleg


Attachment: user_188971.ezm (zipped)
The Struts 2 Tag Libraries are completely written around OGNL and
FreeMarker, which makes it hard to remove either of those technologies
from the stack.

I have written some tags, not based on the Struts 2 component support,
that safely allow both JSTL and OGNL EL's and don't rely on
FreeMarker. They seem to work quite well and I've grown quite fond of
them (obviously).
(*Chris*)


On Tue, Jul 15, 2008 at 9:56 PM, Oleg Mikheev <mihel@(protected):
> Chris Pratt wrote:
>>
>> I proposed a method of enabling JSTL EL safely a while ago, but I
>> haven't heard anything (or had any time to actually do anything about
>> it myself).
>
> But if they had to get rid of one of two ELs why did they decide to
> keep OGNL?
> Isn't JSTL more popular and more standard?
>
> Oleg
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>

Attachment: user_188974.ezm (zipped)
Thanks Dave and Lukasz,

          i got the concept, and solved the issue.

Thank you very much.

On Tue, Jul 15, 2008 at 4:47 PM, Dave Newton <newton.dave@(protected):

> --- On Tue, 7/15/08, Narayana S <narayanasgs1@(protected):
> > I am new to struts 2. my page is having a list which
> > is dynamically generated by action, so while calling
> > the jsp page itself from a menu, I am calling URL
> > "/mymodule1/EditEmployee.action", which is mapped to
> > EditEmplyeeAction.java. first time when i am generating
> > the page I am generating list values dynamically and returning
> > *ActionSupport.INPUT*, if Save button is clicked on my page
> > i am again going to the EditEmployeeAction and this time i am
> > doing my process and returning *ActionSupport.SUCCESS*.
> >
> > but here the problem is, i have validation annotations
> > implemented for all the fields, which are executed and
> > reporting error messages when i am loading the page for
> > the first time itself. but it should not happen to my
> > page, first time it should be executed with out
> > validations, and when save button is clicked only
> > it should check for validations...
>
> In addition to the information provided by Lukasz I'd add that typically
> this would be handled by (a) separate actions, or (b) by using the input()
> and execute() methods in a single action, accessed via separate action
> configurations (or dynamic method invocation if enabled).
>
> Note that ActionSupport provides a default input() method that returns
> ActionSupport.INPUT, meaning (a) you write less code, and (b) the code you
> write is focused on a single task, rather than implementing a conditional
> that can be handled automatically by the framework.
>
> An action's input() method will skip validation by default ([1], [2]). The
> list values may be created in either both input() and execute() methods, or
> perhaps more cleanly by implementing the Prepareable interface [3] used by
> the "prepare" interceptor [4].
>
> Dave "Too much information" Newton
>
> [1] "validation" interceptor:
> http://struts.apache.org/2.x/docs/validation-interceptor.html
>
> [2] Default S2 config defining "validation"'s skipped methods:
> http://struts.apache.org/2.x/docs/struts-defaultxml.html
>
> [3] Preparable interface:
> http://struts.apache.org/2.1.2/struts2-core/apidocs/index.html
>
> [4] "prepare" interceptor:
> http://struts.apache.org/2.x/docs/prepare-interceptor.html
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>

Attachment: user_188979.ezm (zipped)
Apache Struts 2.0.11.2 is now available from
<http://struts.apache.org/download.cgi#struts20112>.

This release is a fast track security fix release, including a security
fixed version 2.0.5 of XWork, which corrects a serious vulnerability in
ParametersInterceptor allowing malicious users to remotely change server
side context objects. For more information about the exploit, visit our
security bulletins page at
<http://struts.apache.org/2.0.11.2/docs/s2-003.html>.

IMPORTANT ADDITIONAL NOTES:
There are two known issues with this release:
1. the integrated XWork 2.0.5 jar may cause problems when used in a
combination of WebSphere 6.1 runtime environments with validation
configuration via XML files.
Possible Workarounds:
- use annotation based validation definition instead XML based
- stay with Struts 2.0.11.1 including XWork 2.0.4, applying the
following exclude rule to your parameter interceptor refs in
struts.xml
<interceptor-ref name="params">
   <param name="excludeParams">.*[[^\\p{Graph}][\\\\#:=]].*</param>
</interceptor-ref>
2. the filtering mechanism implemeted in XWork's ParametersInterceptor
to fix the described security issue does not completely avoid any
possible malicious parameter name.
Possible Workaround:
- apply the following exclude rule to your parameter interceptor refs in
struts.xml to avoid the usage of backslash characters in parameter
names
<interceptor-ref name="params">
   <param name="excludeParams">.*\\.*</param>
</interceptor-ref>
Both issues will be addressed in a soon upcoming XWork 2.0.6 release,
followed by a new Struts 2.0 GA release including this new XWork version.

* All developers are advised to either update Struts 2 applications to
Struts 2.0.11.2 or manually exchange usages of xwork-2.0.x.jar with the
fixed xwork-2.0.5.jar to prevent remotety induced context manipulations.

For the complete release notes for Struts 2.0.11.2, see
<http://struts.apache.org/2.0.11.2/docs/release-notes-20112.html>.


- The Apache Struts Team.




©2008 gg3721.com - Jax Systems, LLC, U.S.A.