Re: [S2] Getting the AJAX Form Validations to work

2007-03-13 Thread Binil Thomas

Hi all,

I got it working!

I had to add a validate=true attribute on the s:form/. With that added,
the form was trying to make an AJAX request onblur. But I got a JS error in
FB:
element.form.attributes['name'] is undefined.
Debugging a bit, I figured that the JS figures out the validation action to
invoke on the server from the name attribute of the form. I gave the form a
name (name=myform). Now the AJAX request was made, but DWR was throwing up
some errors on the server-side.
SEVERE: Error while trying to validate
There is no Action mapped for action name myform. - [unknown location]
True, there is no action with the name 'myform'. I changed the name of the
form to the action name as it all started working as expected!
s:form method=post theme=ajax validate=true name=show
s:textfield label=Name name=name/
s:textfield label=Age name=age/
s:submit value=Submit/
/s:form

I copied the evaluated JSP into an HTML page, and debugged it. I was able to
remove all JS errors in FB by:
1) Commenting out a script language=JavaScript type=text/javascript
src=/validations/struts/simple/dojoRequire.js/script added by
thes:head theme=ajax/ tag.
2) Commenting out a dojo.require(dojo.widget.html.Tooltip) line added
by, I think, the s:form/ tag. I think Dojo guys have renamed the widget to
dojo.widget.Tooltip since 0.3.

With these changes, I was able to remove every JS error in FB. I now get
some Dojo deprection warnings though.
DEBUG: DEPRECATED: dojo.style replaced by dojo.html.style -- will be
removed in version: 0.5
DEBUG: DEPRECATED: dojo.animation.AnimationEvent is slated for removal
in 0.5; use dojo.lfx.* instead. 0.5
DEBUG: DEPRECATED: dojo.animation.Animation is slated for removal in
0.5; use dojo.lfx.* instead. 0.5
DEBUG: DEPRECATED: dojo.animation.AnimationSequence is slated for
removal in 0.5; use dojo.lfx.* instead. 0.5
DEBUG: DEPRECATED: dojo.Animation.* is slated for removal in 0.5; use
dojo.lfx.* instead. 0.5
DEBUG: DEPRECATED: dojo.graphics.color.Color is now
dojo.gfx.color.Color. 0.5

Thanks,
Binil


Binil Thomas wrote:
 
 Hi Musachy,
 
 Thanks for replying!
 
 On FB I see HTTP 404s on:
 1) http://localhost:8080/validations/stuts/dojo/src/widget/html/Tooltip.js
 2) http://localhost:8080/validations/stuts/dojo/src/widget/html.js
 3) http://localhost:8080/validations/stuts/dojo/src/widget.js
 4) http://localhost:8080/validations/stuts/dojo/src/__package__.js
 5) http://localhost:8080/validations/stuts/dojo/src.js
 6) http://localhost:8080/validations/stuts/dojo/__package__.js
 
 Also, on both FB and the page, I see the error:
 Could not load 'dojo.widget.html.Tooltip'; last tried '__package__.js'
 (I have enabled Dojo debug now). I think the Dojo widget is called
 dojo.widget.Tooltip.
 
 When the form first shows up I see the field error message for 'name'
 field. When I fill out the field and tab out of it, no AJAX request is
 send to the server (I am assuming that the expectation is that the form
 gets validated at the server via an AJAX call onBlur).
 
 When I click submit, an AJAX request is send and the server responds with
 the HTML page for the action; but nothing happens to the page.
 

-- 
View this message in context: 
http://www.nabble.com/Getting-the-AJAX-Form-Validations-to-work-tf3390223.html#a9449588
Sent from the Struts - User mailing list archive at Nabble.com.


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



DispachAction - does not contain specified method

2007-03-13 Thread Nitin Ahuja

Hi,

I am using DispatchAction as my base action class.

when submit url http://.../myAction.do?action=view; and there is no
view method defined in my action class, then it throws following
exception.

Is there any way to call a default method  when the method view does
not exists ?
Or how can I redirect or forward the request to a default page ?

javax.servlet.ServletException: Action[/myAction] does not contain
specified method (check logs)
at 
org.apache.struts.action.RequestProcessor.processException(RequestProcessor.java:535)
at 
org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:433)
at 
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236)
at 
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:414)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at 
org.apache.catalina.core.StandardWrapperValve.invokeServletService(StandardWrapperValve.java:720)
at 
org.apache.catalina.core.StandardWrapperValve.access$000(StandardWrapperValve.java:118)
at 
org.apache.catalina.core.StandardWrapperValve$1.run(StandardWrapperValve.java:278)
at java.security.AccessController.doPrivileged(Native Method)
at 
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:274)
at 
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:505)
at 
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:212)
at 
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:505)
at 
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:203)
at 
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:505)
at 
com.iplanet.ias.web.connector.nsapi.NSAPIProcessor.process(NSAPIProcessor.java:157)
at com.iplanet.ias.web.WebContainer.service(WebContainer.java:598)


Thanks,
-Nitin

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



[s2] newbie - setting multiple values in an action

2007-03-13 Thread Martin Fanta
Hi all,

I started playing around with Struts 2.0.6 on Saturday. All went well until
I've run into the need to call an Action setter for a list of strings
submitted from an html form (will switch to dates later, but I want to solve
the multiple aspect first).

I have a jsp with this body:

s:form action=Process
  s:iterator value=dates status=day
s:textfield label=%{top} labelposition=left 
name=days[%{#day.index}]/
  /s:iterator
  s:submit/
/s:form

It is meant to display a label and an edit box for each of the dates from the
'dates' list. The 'dates' is a list set in the prepare action and it is
displayed correctly - here's the rendered html (re-formatted to make it
readable):

form id=Process name=Process onsubmit=return true;
action=/wp/Process.action method=POST
  table class=wwFormTable
tr
  td class=tdLabellabel for=Process_days_0_
class=label13.3.07:/label/td
  tdinput type=text name=days[0] value= id=Process_days_0_//td
/tr
tr
  td class=tdLabellabel for=Process_days_1_
class=label14.3.07:/label/td
  tdinput type=text name=days[1] value= id=Process_days_1_//td
/tr
tr
  td colspan=2div align=rightinput type=submit id=Process_0
value=Submit//div/td
/tr
  /table
/form

The ProcessAction code:

public class ProcessAction extends ActionSupport {

  private ListString days;

  @Override
  public String execute() throws Exception {
System.out.println(ProcessAction.execute());
return SUCCESS;
  }

  public ListString getDays() {
return days;
  }

  public void setDays(ListString days) {
System.out.println(ProcessWeightsAction.setDays());
System.out.println(days.size());
  }
}

What I want to achieve is let Struts call the setDays() with a List of two
values filled in by the user in the html form.

The reality is the setDays() is called twice, but in both cases, the days list
is empty (The user has filled in both text values).

What am I doing wrong? Also, I have browsed through the docs on the struts
website, but did not find anything explaining how this can be done. Can you
please point me to the right document if it exists?

Thanks in advance.
Martin


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



[struts faces] How do i set default values?

2007-03-13 Thread David Delbecq
Hello,

i am trying to convert some struts form to be JSf compatible using
struts faces. However, there are a few problems with initialization for
form.

I have this:
html:form action=/search.do acceptCharset=UTF-8 styleClass=search
html:hidden property=scope value=${param.searchScope}/
html:hidden property=requestedNodeResults value=15/



According to struts faces docs, i need to use the corresponding JSF tag:
h:inputHidden id=scope value=#{myForm.scope}/
h:inputHidden id=requestedNodeResultas
value=#{myForm.requestedNodeResults}/

However, you all can guess my problem, where do i put the 2 default
values for form: '${param.searchScope}' and '15'

According to myfaces mailing list, i should do this in the managed bean
definition. However, there is no managed bean definition in struts faces.

Any suggestion? What am trying to do is incorporate existing struts
forms inside a JSF page. We would like to avoind a immediate complete
rewrite and have a temporary migration solution...

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



Re: DispachAction - does not contain specified method

2007-03-13 Thread Mark Shifman

You should look at the source
http://svn.apache.org/viewvc/struts/struts1/trunk/extras/src/main/java/org/apache/struts/actions/DispatchAction.java?view=markup
and the javadoc
Method which is dispatched to when there is no value for specified 
request parameter included in the request. Subclasses of 
DispatchAction should override this method if they wish to provide 
default behavior different than throwing a ServletException.


overriding unspecified should do the trick

*protected* ActionForward unspecified(ActionMapping mapping, ActionForm 
form,
HttpServletRequest request, HttpServletResponse response)
*throws* Exception {
String message =
messages.getMessage(*dispatch.parameter*, mapping.getPath(),
mapping.getParameter());

log.error(message);

*throw* *new* ServletException(message);
}

mas
Nitin Ahuja wrote:

Hi,

I am using DispatchAction as my base action class.

when submit url http://.../myAction.do?action=view; and there is no
view method defined in my action class, then it throws following
exception.

Is there any way to call a default method  when the method view does
not exists ?
Or how can I redirect or forward the request to a default page ?

javax.servlet.ServletException: Action[/myAction] does not contain
specified method (check logs)
at 
org.apache.struts.action.RequestProcessor.processException(RequestProcessor.java:535) 

at 
org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:433) 

at 
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236) 

at 
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
at 
org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:414)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at 
org.apache.catalina.core.StandardWrapperValve.invokeServletService(StandardWrapperValve.java:720) 

at 
org.apache.catalina.core.StandardWrapperValve.access$000(StandardWrapperValve.java:118) 

at 
org.apache.catalina.core.StandardWrapperValve$1.run(StandardWrapperValve.java:278) 


at java.security.AccessController.doPrivileged(Native Method)
at 
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:274) 

at 
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:505) 

at 
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:212) 

at 
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:505) 

at 
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:203) 

at 
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:505) 

at 
com.iplanet.ias.web.connector.nsapi.NSAPIProcessor.process(NSAPIProcessor.java:157) 


at com.iplanet.ias.web.WebContainer.service(WebContainer.java:598)


Thanks,
-Nitin

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




--
Mark Shifman MD. Ph.D.
Yale Center for Medical Informatics
Phone (203)737-5219
[EMAIL PROTECTED]


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



Re: [s1] handle exception in processPopulate?

2007-03-13 Thread Niall Pemberton

On 3/13/07, Paul Benedict [EMAIL PROTECTED] wrote:

Strachan, Paul wrote:
  I resolved this myself by simply overriding the set(String, Object)
  method in my form, to ignore certain request parameter names that are
  not of type String in my LazyValidatorForm.
 

If you feel strongly about this, please create a JIRA issue for possible
enhancement. You may have a good idea worth investigating :)


Part of the problem with the population is that most of the code is
burried in static RequestUtils methods - making providing different
behaviours difficult. I did some work for Struts 1.3 to refactor that
back into the Commands - with the BeanUtils populate being called from
the Command rather than a static request utils method. I think that
would be a first step for solutions to these kind of issues

https://issues.apache.org/struts/browse/STR-2772

Although that issue talks about multipart handling - it also
introduces a populate() method in AbstractPopulateActionForm that
calls BeanUtils populate() directly

Niall

Niall


Paul


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



Re: [s1] Filters: distinguishing between user-requests and redirects

2007-03-13 Thread Tamas Szabo

Yes, setting the dispatcher will work just for ignoring the forwards,
it won't work for redirects.
You can check for attributes as Paul suggests, but setting the
dispatcher seems to be easier if you have a servlet container
supporting 2.4.

You'll have to handle redirects in another way though.
A simple solution would be to remove the time of the last request from
your list if you return a redirect to the user.

HTH,

Tamas


On 3/13/07, Paul Benedict [EMAIL PROTECTED] wrote:

There is no technical difference between a user request and a redirect,
because the redirect causes a second user request.

If you're interested in knowing whether the action is being called as a
forward, there are standard request attributes which the Container sets.
For a forward it is javax.servlet.forward.request_uri and for an
include it is javax.servlet.include.request_uri

Paul

Tamas Szabo wrote:
 Have a look at the documentation of the dispatcherType at
 http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd.

 Then you can use dispatcher elements in your filter mappings
 (filter-mappingType in the same xsd) to fire your filter just for
 requests but not for forwards.

 I pressume that by internal redirects in your initial mail you mean
 forwards. Is this true?

 Hope this helps,

 Tamas


 On 3/13/07, Pierre Thibaudeau [EMAIL PROTECTED] wrote:
 Yes, I believe it is 2.4.

 Also:
 Struts 1.3.5
 Tomcat 6.0.9

 2007/3/12, Tamas Szabo [EMAIL PROTECTED]:
 
  Hi,
 
  What servlet api are you using?
  Is it at least 2.4?
 
  Tamas
 
 
  On 3/13/07, Pierre Thibaudeau [EMAIL PROTECTED] wrote:
   I am trying to implement a flood control mechanism to prevent robots
   requesting pages after pages at an inhuman rate.
  
   My basic idea is this:
   * A FirstInFirstOut List stored in the HttpSession, that records the
  time of
   the user's last 10 requests.
   * On each new request, a filter compares the current time with the
 time
  of
   the 10th previous request.  If not enough time went by, redirect to a
  delay
   page that requires the user to press a Continue button. Pipe
 the new
   request and its time, and pipe out the 10th previous request.
  
   The problem with that design:  in some cases, one single request from
  the
   user will go through the filters several times because of various
  possible
   internal redirects.  But I only want to record the times of the
 requests
   coming directly from the user.
  
   Therefore my question:  Is there a simple straightforward way,
 from the
   filter's point of view, to distinguish between a request that came
 from
   outside (from the user), from an internal request (one that came
 through
  a
   redirection from ActionMapping to ActionMapping)?
  
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 


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



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




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



Validation Framework

2007-03-13 Thread Balazs Michnay
Dear Struts Users,
 
I'm relatively new to Struts and am trying to get the Validation Framework 
working without success. I've read several tutorials and articles on using it, 
but it just doesn't want to work. I'm using NetBeans 5.5, so that I can use 
Struts 1.2.9.
Having set everything, I get no error messages from the Sun Java Application 
Server 9, it just simply does not do any validation. It skips the validating my 
form and forwards me to the JSP page that should open only on successful 
validation.
I don't attach the sources, because the zip file is too big, but I share it 
with you:
 
http://www.inf.u-szeged.hu/~michnay/struts/SZTGKR.ZIP
 
My form should only validate a textarea html control.
Do I need to do any special settings in NetBeans or do I miss some settings?
 
Since it's been about 4 days I'm trying to get it working I'd be grateful if 
someone would please take a look at my form and my validation settings.
 
Thanks for your reply,
 
Regards,
 
  michnay


 

TV dinner still cooling? 
Check out Tonight's Picks on Yahoo! TV.
http://tv.yahoo.com/

Re: Validation Framework

2007-03-13 Thread Mike Baroukh
I'm still using struts 1.1 and your struts config/form is really 
different from what I used to do.

But, in struts 1.1, we had to add
validate=true
in the struts-config on the action ...

your struts-config doesn't have any.

Maybe ...

Mike

Balazs Michnay a écrit :

Dear Struts Users,
 
I'm relatively new to Struts and am trying to get the Validation Framework working without success. I've read several tutorials and articles on using it, but it just doesn't want to work. I'm using NetBeans 5.5, so that I can use Struts 1.2.9.

Having set everything, I get no error messages from the Sun Java Application 
Server 9, it just simply does not do any validation. It skips the validating my 
form and forwards me to the JSP page that should open only on successful 
validation.
I don't attach the sources, because the zip file is too big, but I share it 
with you:
 
http://www.inf.u-szeged.hu/~michnay/struts/SZTGKR.ZIP
 
My form should only validate a textarea html control.

Do I need to do any special settings in NetBeans or do I miss some settings?
 
Since it's been about 4 days I'm trying to get it working I'd be grateful if someone would please take a look at my form and my validation settings.
 
Thanks for your reply,
 
Regards,
 
  michnay



 

TV dinner still cooling? 
Check out Tonight's Picks on Yahoo! TV.

http://tv.yahoo.com/
  



--

Mike Baroukh

---
Cardiweb  - 31 Rue de Mogador Paris IXeme
06 63 57 27 22 - 01 53 21 82 63 - Jabber: [EMAIL PROTECTED]
http://www.cardiweb.com
---


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

Re: Validation Framework

2007-03-13 Thread Dave Newton
--- Balazs Michnay [EMAIL PROTECTED] wrote:
 I'm relatively new to Struts and am trying to get
 the Validation Framework working without success.

You neither set validate='true' on your Action (in the
struts-config action-mapping configuration element)
nor call the form bean's 'validate' method (from, say,
your Action).

FWIW, it's usually sufficient to simply post the
relevent portions of the config and source files
rather than providing a ZIP file of your entire
project.

To answer your next question, you can either create an
action-mapping with validate=false to forward to the
form's JSP page or you can set validate=false and
call validate manually from within your Action based
on whether or not it's a GET or POST request (assuming
you submit with a POST; personally I have this
behavior in an Action base class and never use the
automagic validation, but this has been discussed to
death in the past :)

d.



 

Be a PS3 game guru.
Get your game face on with the latest PS3 news and previews at Yahoo! Games.
http://videogames.yahoo.com/platform?platform=120121

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



Struts Question - multiple instances of an actionForm

2007-03-13 Thread xyz

Hi all, 
  
Is there any standard ways to manage multiple instances of one form with
Struts? Say,I have application 
which is supposed to take theorerically unlimited number of person's
descriptions. Every time user 
clicks add one more person he/she gets exactly the same form (with the
same validation rules) to fill. He should be able to save individual details
and validate it seperately.So lets say there is a 'save' button which will
help us save individual details in session and a delete button which will
help us delete the saved details from session.At the end user clicks
finish and all saved data from session along with some common information
is to be handled for further processing. Is there any mechanism in Struts
supporting multiple instances. 
Any hints/ideas on achieving this? 
  
Thanks 
-- 
View this message in context: 
http://www.nabble.com/Struts-Question---multiple-instances-of-an-actionForm-tf3396668.html#a9456868
Sent from the Struts - User mailing list archive at Nabble.com.


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



Re: Session values getting lost

2007-03-13 Thread Dilip Ladhani

Well I figured it out. When I accessed the index.jsp, I accesses it
with a different context root (In tomcat, it was the project name).
Tomvat is somehow allowing me to do that.

Since the history page had no context root, it woked, but after that
when I use the correctcontext root, a new session gets created.

Three hours wasted for nothing. Thanks for all you inputs

On 3/12/07, Dave Newton [EMAIL PROTECTED] wrote:

--- Dilip Ladhani [EMAIL PROTECTED] wrote:
 Index Page
 a href/viewHistoryDefault.doHome Page/a

 header,jsp
 a href=/TrnTracker/viewSchedule.doSchedule
 Page/a

 Is the context root (present in header, missing in
 index) making a difference??

Do both ways of making links work?! If you're creating
absolute URLs then aren't the above two links pointing
at separate webapps?

(As an aside, why aren't you building the struts links
with the struts tags?)

d.





No need to miss a message. Get email on-the-go
with Yahoo! Mail for Mobile. Get started.
http://mobile.yahoo.com/mail

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




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



Re: [s2] newbie - setting multiple values in an action

2007-03-13 Thread Mark Menard
On 3/13/07 3:45 AM, Martin Fanta [EMAIL PROTECTED] wrote:

 I have a jsp with this body:
 
 s:form action=Process
 s:iterator value=dates status=day
   s:textfield label=%{top} labelposition=left
 name=days[%{#day.index}]/
 /s:iterator
 s:submit/
 /s:form
 
 It is meant to display a label and an edit box for each of the dates from the
 'dates' list. The 'dates' is a list set in the prepare action and it is
 displayed correctly - here's the rendered html (re-formatted to make it
 readable):

 [SNIP] 
 
 The ProcessAction code:
 
 public class ProcessAction extends ActionSupport {
 
 private ListString days;
 
 @Override
 public String execute() throws Exception {
   System.out.println(ProcessAction.execute());
   return SUCCESS;
 }
 
 public ListString getDays() {
   return days;
 }
 
 public void setDays(ListString days) {
   System.out.println(ProcessWeightsAction.setDays());
   System.out.println(days.size());
 }
 }
 
 What I want to achieve is let Struts call the setDays() with a List of two
 values filled in by the user in the html form.

I don't think Struts 2 will do that, at least not without using the type
conversion system. (Which I'm not familiar with.)

The issue as I see it is that you have no list for Struts 2 to set the input
against. You need to do something like the list before Struts 2 populate the
parameters from the HttpRequest:

public class ProcessAction extends ActionSupport implements Preparable {

  private ListString days;

  public void prepare () {
this.days = new ArrayListString ();
for (int ii = 0; ii  10; ii++) {
  this.days.add ();
}
  } 

  @Override
  public String execute() throws Exception {
System.out.println(ProcessAction.execute());
return SUCCESS;
  }

  public ListString getDays() {
return days;
  }

  public void setDays(ListString days) {
System.out.println(ProcessWeightsAction.setDays());
System.out.println(days.size());
  }
}

What this does is create the list ListString ahead of time. Then OGNL can
populate it using your name expression from your textfield tag,
name=days[%{#day.index}], which results in days[0]. I believe OGNL will do
the following with that expression:

days will call getDays on your action.
[0] will call the set(0, value from httprequest) method on the List.

For a version of this technique using Maps take a look at:

http://www.vitarara.org/cms/node/81

Later,

Mark

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



Re: DynaValidatorForm with java.util.Date

2007-03-13 Thread Gareth Evans

You register the converter using:

ConvertUtils.register( new DateConverter( dd/MM/ , java.util.Date.class ) 
);

Gareth

[EMAIL PROTECTED] wrote:
I can't see how that can solve my problem?  


The ArrayList is actually gone.  When I want to display the arraylist with c:forEach 
items=${ModifyCivilServantForm.map} var=formField
li${formField.key}: ${formField.value}/li
/c:forEach
Everything is gone.

The problem is, that list contains a few values, which need to be maintained 
after submitting.

This is the situation:
I have a Date-object and an arraylist containing a few objects.

What we do now is the following:  before the form is displayed, we have an 
action which fills the formfields with the corresponding values.  Say that you 
have a record you want to change, before the change-form is displayed, an 
action retrieves the album and fills the form with the right values.

Up till now, we didn't have any problems, because we only used java.lang.String 
or java.lang.Integer as types.  Now I have a Date-field and an ArrayList-field.

Prefilling those fields is not a problem.  The right values are displayed and 
everything is ok.  When I submit the form, those two fields are gone.  First I 
got that ERROR org.apache.struts.util.RequestUtils  - 
javax.servlet.ServletException: BeanUtils.populate
javax.servlet.ServletException: BeanUtils.populate error, but removing those 
input fields (whom are hidden) from the form solved the problem.  But when I 
submit, those values are gone.

Does anybody know how to fix this?

I tried writing that customconverter, but I don't know how or where to register 
it.  Simply adding that code to an Action-class doesn't solve it

-Original Message-
From: Niall Pemberton [mailto:[EMAIL PROTECTED] 
Sent: maandag 12 maart 2007 16:46

To: Struts Users Mailing List
Subject: Re: DynaValidatorForm with java.util.Date

On 3/12/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:

Where do I register such a convertor?  Simply add this code to my Action or do 
I have to add this somewhere else?

I've figured out what my problem was, but now sth else pops up.  I have a field 
with type java.util.ArrayList.  When I enter the form, the precedent Action 
fills the form.  On screen, the ArrayList is correctly processed.  Now, when I 
submit the form, all those values are gone.

I added html:hidden property=txtFieldForArrayList / to my JSP, but it turns 
out that was the problem for the previous error.  When I remove that field from my JSP, 
everything works correctly for the first time, but the second time I enter the page, this 
ArrayList is gone.

What am I doing wrong here?


Is the ArrayList gone or empty? Presumably just empty - since
DynaActionForm's should re-create the list even in request scope. You
could change the form to be session scope - or you need to add some
lazy list type behaviour

  http://wiki.apache.org/struts/StrutsCatalogLazyList
  http://wiki.apache.org/struts/LazyList

If you use one of the lazy ActionForm flavours it does this for you:

  
http://struts.apache.org/1.x/userGuide/building_controller.html#lazy_action_form_classes

Niall


-Original Message-
From: Niall Pemberton [mailto:[EMAIL PROTECTED]
Sent: maandag 12 maart 2007 14:49
To: Struts Users Mailing List
Subject: Re: DynaValidatorForm with java.util.Date

On 3/12/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:

Why does sql.Date work?

Because BeanUtils (at the moment) comes with a registered converter
for jav.sql.Date - but not for java.util.Date. If you want it to
handle String--java.util.Date you need to register a Converter for
it:

  Converter dateConverter = new MyDateConverter();
  ConvertUtils.register(dateConverter, java.util.Date.class);

Your date converter will need to implement the following interface:

  http://tinyurl.com/2h459j

The section 4.3.1 you refer to below tells you which types are
supported out of the box.

Niall


And the apache-site states that it's actually possible to use for instance 
java.util.ArrayList.  How do you do that? 
http://struts.apache.org/1.3.5/userGuide/building_controller.html, see section 
4.3.1.
-Original Message-
From: Hubert Rabago [mailto:[EMAIL PROTECTED]
Sent: maandag 12 maart 2007 14:06
To: Struts Users Mailing List
Subject: Re: DynaValidatorForm with java.util.Date

The fields of action forms, including DynaValidatorForms are populated
from request parameters, and these values are all in String variables.
 I suggest using a String variable for the dyna validator form field
as well, and just parsing it to get the java.util.Date equivalent when
you use it in your Action classes.

Hubert

On 3/12/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:

And the 3rd mail.  Is it possible to use an object that's different from 
java.lang.* as type for the dynavalidatorform?  I think that's what causing the 
issue here.  If it's not possible, then I'm in deep  :)

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL 

Re: [s1] Filters: distinguishing between user-requests and redirects

2007-03-13 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Pierre,

 I am trying to implement a flood control mechanism to prevent robots
 requesting pages after pages at an inhuman rate.

I know you've gotten lots of feedback already, but there's a
super-simple way to do this: put a marker in the request attributes the
first time your filter sees it. Check for it each time. When you place
the marker in the request, perform all your magic: check the queue, add
the current request + timestamp, etc. If the marker is already there,
skip everything.

For redirects, the request should be re-used, so the marker should
remain until your final response.

- -chris

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

iD8DBQFF9shh9CaO5/Lv0PARAu44AJ4hIVOFv/mtsYZeJBD4lVf28hpYJgCfVVzx
XmwRPjAbuG9qfUgvIO4hkTs=
=KOGU
-END PGP SIGNATURE-

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



Re: Struts Question - multiple instances of an actionForm

2007-03-13 Thread Dave Newton
--- xyz [EMAIL PROTECTED] wrote:
 Any hints/ideas on achieving this? 

Have you considered using indexed properties?

d.



 

TV dinner still cooling? 
Check out Tonight's Picks on Yahoo! TV.
http://tv.yahoo.com/

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



Re: Validation Framework

2007-03-13 Thread Balazs Michnay
Hi Dave,

Thanks a lot for your help! It really does work! What I missed was the 
validate=true attribute of the action tag, however, this was not mentioned by 
any of the articles I read.

The other thing is that now, the validation error message DID show up, but it 
is displayed on destination-page that should only show up when the validation 
was successful.What I want to do is to show the same for until valid values are 
not entered and when all the necessary fields are filled with valid values, 
forward the user to the destination-page.

Again, I'm missing some settings in my config files.
You told me to use the validate() method but now it's completely removed 
because all the articles told me to remove it...

Here are some parts of my files:

--
Action mapping of struts-config.xml:
--
action-mappings

action input=/LP/JSP_L01_1.jsp name=BEAN_L01 path=/L01FormAction 
scope=request type=com.myapp.struts.ACT_L01 validate=true
set-property property=cancellable value=true/
forward name=cancel path=/index.jsp/
forward name=success path=/LP/JSP_L01_1.jsp/
/action

action forward=/LP/JSP_L01.jsp path=/L01/

action path=/Welcome forward=/welcomeStruts.jsp/
--
The form that should be validated (the textarea only)
--
html:form action=L01FormAction
table border=1
tbody
tr
tdbean:message key=MSG_JSP_L01_01//td
tdhtml:select property=ev
html:option value=2007/
html:option value=2009/
html:option value=2008/
html:option value=2010/
html:option value=2011/
html:option value=2012/
/html:select

html:select property=honap
html:option 
value=1Január/html:optionhtml:option 
value=2Február/html:optionhtml:option 
value=3Március/html:optionhtml:option 
value=4Április/html:optionhtml:option 
value=5Május/html:optionhtml:option 
value=6Június/html:optionhtml:option 
value=6Július/html:optionhtml:option 
value=7Augusztus/html:optionhtml:option 
value=9Szeptember/html:optionhtml:option 
value=10Október/html:optionhtml:option 
value=11November/html:optionhtml:option value=12December/html:option 
   
/html:select

html:select property=nap
html:option value=01/html:option 
value=02/html:option value=03/html:option value=04/html:option 
value=05/html:option value=06/html:option value=07/html:option 
value=08/html:option value=09/html:option value=10/html:option 
value=11/html:option value=12/html:option value=13/html:option 
value=14/html:option value=15/html:option value=16/html:option 
value=17/html:option value=18/html:option value=19/html:option 
value=20/html:option value=21/html:option value=22/html:option 
value=23/html:option value=24/html:option value=25/html:option 
value=26/html:option value=27/html:option value=28/html:option 
value=29/html:option value=30/html:option value=31/
/html:select


/td
/tr
tr
tdbean:message key=MSG_JSP_L01_02//td
tdhtml:textarea property=leletSzoveg rows=6 
cols=30/html:textarea/td
/tr
tr
tdbean:message key=MSG_JSP_L01_03//td
tdhtml:checkbox property=fileChk value=1 
onclick=javascript:leletChkClick();/nbsp;
html:file property=fileURL size=30 
disabled=true/
/td
/tr
tr
td colspan=2
html:submit value=Submit/   
 
html:reset value=Reset/
html:cancel /
/td
/tr
tr
td/td
td/td
/tr
/tbody
/table
!-- Begin Validator Javascript Function--
%-- html:javascript formName=BEAN_L01/ --%
!-- End of Validator Javascript Function--

[S2] Setting up actions

2007-03-13 Thread Skip Hollowell
I have spent a few weeks getting my hands dirty with Struts 2 now, and I 
have come to a crossroads of sorts, in my app design and layout of my 
actions. 


A good example of where I am looking for direction is the following:

A user logs in and wants to add a transaction for an account.  I have an 
AccountAction that is setup to work with, ultimately, my AccountBean.  
But here is where I need to know the right way to do things in Struts2 
land.  When I want to search for a particular account, I of course use 
the AccountAction, sending in an account.acctNumber via my _input.  So 
far so good no?  If the account is not found, great, I just send them 
back to the same page, with a nift actionError telling them what went 
wrong. 

But if the Account is indeed found, then what?  I know I need to get the 
Account object onto the stack for displaying.   But where should I send 
the app next?  Do I have an _enterPayment method in my AccountAction?  
And then reference that in the same way as I did _input, as a new result 
in my ActionCrud_* in my .xml file?  Or is it more recommended to create 
a new action in the .xml file with a new result just for this particular 
scenario?  1 action per functional part of the app, or 1 action per data 
type, with many results corresponding to each method that I call inside 
that partuclar action?


The more I think of it, the more questions I have. 



   action name=AccountCrud_* 
class=com.its.irmc.action.AccountAction method={1}
   !-- this one I get...I bring up my search form... 
ActionCrud_input.do brings up my search form
   which has an action of ??? (Assuming 
ActionCrud_Search for now, if we stay in the 1 action idea-

   result name=input/WEB-INF/jsp/UC01-EnterPayment.jsp/result

   !-- This one I get, my search page asks for an account 
number, it calls getAccount(acctNumber)
   and the appropriate account is found.  But if I have 
a result that goes to a page...I can't
   for some reason see the information in the Account 
object on the stack, only the account
   number from the Account object created at submit 
from the input page. --
   result 
name=success-acctfound/WEB-INF/jsp/UC01a-EnterPayment.jsp/result


  !-- Should I instead be redirecting to an action in stead of 
havnig the result load a page? 
 Am I missing a base idea of how the stack operates and 
when it is available to me?  --
   result name=success-acctfound 
type=redirect-actionAccountCrud_search/result


   /action

From my search page:
 s:form namespace=/irmc action=AccountCrud_search validate=true
   s:textfield name=account.acctNumber value=%{account.acctNumber} 
label=%{getText('acctNumber')} size=40/

   s:submit key=button.label.submit/
   s:reset/
 /s:form


From my result page after the search:
Account Number: [s:property value=account.acctNumber/]br
Name: s:property value=account.firstName/ s:property 
value=account.lastName/br

Address: s:property value=account.address1/br
Address: s:property value=account.address2/br
Debtor Phone: s:property value=account.phone/br
s:actionmessage /



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



Re: [S2] Setting up actions

2007-03-13 Thread Dave Newton
--- Skip Hollowell [EMAIL PROTECTED] wrote:
 1 action per functional part of the app, or 1 action

 per data type, with many results corresponding to 
 each method that I call inside that partuclar
action?

I think this is mostly a matter of preference, isn't
it? I find it more concise (overall) to use an Action
per datatype (when appropriate).

The Actions are still short because much of the work
is done via injected services.

 !-- [...]
  have a result that goes to a page...I can't
  for some reason see the information in the 
  Account object on the stack, only the account
  number from the Account object created at
submit
  from the input page. 

Are you setting the Action's account property with the
one you retrieved? If you aren't redirecting there
shouldn't be any issues with things like this.

d.



 

It's here! Your new message!  
Get new email alerts with the free Yahoo! Toolbar.
http://tools.search.yahoo.com/toolbar/features/mail/

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



Validation framework question

2007-03-13 Thread Chaudhary, Harsh
I am having an arguement with a co-worker here and here is how it goes.

We have a JSP which has about 100 input fields. These fields have custom
validators on them. When we try to run the JSP, it throws an exception
something to the tune of Maximum try/catch size reached or something
like that. He says that this is because of the validations and when we
remove the validations, everything is fine.

I say that the validation framework has absolutely nothing to do with
the JSP's. It deals with the struts forms exclusively. So, the exception
could not have been because of the validators. He says that when the JSP
is compiled to a servlet, all the validation code is added to the
compiled version of the JSP, something I do not agree with.

Any inputs?

Thanks,
Harsh.

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



Re: Validation framework question

2007-03-13 Thread Mike Baroukh


Hi.

This is only a problem with javac and depending on wich java version you 
use.

jdk5 should not have the problem.
You may also try to use jikes for compiler.

There may be or may be no code added for the validation.
But this is not the problem ...

Mike

Chaudhary, Harsh a écrit :

I am having an arguement with a co-worker here and here is how it goes.

We have a JSP which has about 100 input fields. These fields have custom
validators on them. When we try to run the JSP, it throws an exception
something to the tune of Maximum try/catch size reached or something
like that. He says that this is because of the validations and when we
remove the validations, everything is fine.

I say that the validation framework has absolutely nothing to do with
the JSP's. It deals with the struts forms exclusively. So, the exception
could not have been because of the validators. He says that when the JSP
is compiled to a servlet, all the validation code is added to the
compiled version of the JSP, something I do not agree with.

Any inputs?

Thanks,
Harsh.

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

  



--

Mike Baroukh

---
Cardiweb  - 31 Rue de Mogador Paris IXeme
06 63 57 27 22 - 01 53 21 82 63 - Jabber: [EMAIL PROTECTED]
http://www.cardiweb.com
---


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

RE: Validation framework question

2007-03-13 Thread Chaudhary, Harsh
I know that the exception Maximum try/catch size reached has something to do 
with the compiler but what I would likt to know is that whether or not any 
validation code is added to the compiled JSP file itself.

Harsh.

-Original Message-
From: Mike Baroukh [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, March 13, 2007 11:51 AM
To: Struts Users Mailing List
Subject: Re: Validation framework question



Hi.

This is only a problem with javac and depending on wich java version you 
use.
jdk5 should not have the problem.
You may also try to use jikes for compiler.

There may be or may be no code added for the validation.
But this is not the problem ...

Mike

Chaudhary, Harsh a écrit :
 I am having an arguement with a co-worker here and here is how it goes.

 We have a JSP which has about 100 input fields. These fields have custom
 validators on them. When we try to run the JSP, it throws an exception
 something to the tune of Maximum try/catch size reached or something
 like that. He says that this is because of the validations and when we
 remove the validations, everything is fine.

 I say that the validation framework has absolutely nothing to do with
 the JSP's. It deals with the struts forms exclusively. So, the exception
 could not have been because of the validators. He says that when the JSP
 is compiled to a servlet, all the validation code is added to the
 compiled version of the JSP, something I do not agree with.

 Any inputs?

 Thanks,
 Harsh.

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

   


-- 

Mike Baroukh

---
Cardiweb  - 31 Rue de Mogador Paris IXeme
06 63 57 27 22 - 01 53 21 82 63 - Jabber: [EMAIL PROTECTED]
http://www.cardiweb.com
---


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



Re: Validation framework question

2007-03-13 Thread Mike Baroukh


then, you may try to look at the compiled jsp ?


Chaudhary, Harsh a écrit :

I know that the exception Maximum try/catch size reached has something to do 
with the compiler but what I would likt to know is that whether or not any validation 
code is added to the compiled JSP file itself.

Harsh.

-Original Message-
From: Mike Baroukh [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, March 13, 2007 11:51 AM

To: Struts Users Mailing List
Subject: Re: Validation framework question



Hi.

This is only a problem with javac and depending on wich java version you 
use.

jdk5 should not have the problem.
You may also try to use jikes for compiler.

There may be or may be no code added for the validation.
But this is not the problem ...

Mike

Chaudhary, Harsh a écrit :
  

I am having an arguement with a co-worker here and here is how it goes.

We have a JSP which has about 100 input fields. These fields have custom
validators on them. When we try to run the JSP, it throws an exception
something to the tune of Maximum try/catch size reached or something
like that. He says that this is because of the validations and when we
remove the validations, everything is fine.

I say that the validation framework has absolutely nothing to do with
the JSP's. It deals with the struts forms exclusively. So, the exception
could not have been because of the validators. He says that when the JSP
is compiled to a servlet, all the validation code is added to the
compiled version of the JSP, something I do not agree with.

Any inputs?

Thanks,
Harsh.

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

  




  



--

Mike Baroukh

---
Cardiweb  - 31 Rue de Mogador Paris IXeme
06 63 57 27 22 - 01 53 21 82 63 - Jabber: [EMAIL PROTECTED]
http://www.cardiweb.com
---


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

Re: Setting up actions

2007-03-13 Thread Skip Hollowell

Dave Newton-4 wrote:
--- Skip Hollowell [EMAIL PROTECTED] 
http://www.nabble.com/user/SendEmail.jtp?type=postpost=9458130i=0 
wrote:

 1 action per functional part of the app, or 1 action

 per data type, with many results corresponding to
 each method that I call inside that partuclar
action?

I think this is mostly a matter of preference, isn't
it? I find it more concise (overall) to use an Action
per datatype (when appropriate).

The Actions are still short because much of the work
is done via injected services.

 !-- [...]
  have a result that goes to a page...I can't
  for some reason see the information in the
  Account object on the stack, only the account
  number from the Account object created at
submit
  from the input page.

Are you setting the Action's account property with the
one you retrieved? If you aren't redirecting there
shouldn't be any issues with things like this.

There is where I am finally making some headway.  But in my 
_submitPayment, inside my form, I have to send the hidden 
account.acctNumber, so my prepare method can grab the account (again).  
I shouldn't have to do this, should I?  Since I was able to grab the 
account off the stack, what means do I have to submit this 
_submitPayment to my AccountAction, and have it still now which Account 
I am working with.  Am I running into issues because of the the 
paramsPrepareParamsStack that is being used for my 
AuthenticatcationInterceptor on each page? 

I appreciate all of the help so far.  For every time that the lightbulb 
turns on for me on this, another dark door opens.


Skip Hollowell

   interceptors
   !--
   This AuthenticationInterceptor checks to make sure the that 
user is logged in
   before allowing a page/action to be displayed.  If the user 
is not logged in
   then the interceptor redirects all requests to the 
Login_input action

--
   interceptor name=authentication
 
class=com.its.irmc.interceptor.AuthenticationInterceptor/

   interceptor-stack name=loginuser 
   interceptor-ref name=authentication /
interceptor-ref name=paramsPrepareParamsStack/
   interceptor-ref name=defaultStack /
   /interceptor-stack
   interceptor-stack name=guest 
   interceptor-ref name=defaultStack/
   /interceptor-stack
   /interceptors
   !-- Default interceptor stack. --
   default-interceptor-ref name=loginuser /


d.



 
 

It's here! Your new message!  
Get new email alerts with the free Yahoo! Toolbar.

http://tools.search.yahoo.com/toolbar/features/mail/

-
To unsubscribe, e-mail: [EMAIL PROTECTED] 
http://www.nabble.com/user/SendEmail.jtp?type=postpost=9458130i=1
For additional commands, e-mail: [EMAIL PROTECTED] 
http://www.nabble.com/user/SendEmail.jtp?type=postpost=9458130i=2






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



Re: Validation framework question

2007-03-13 Thread Dave Newton
--- Mike Baroukh [EMAIL PROTECTED] wrote:
 jdk5 should not have the problem.

Did 1.5+ remove the 64K limitation?

 There may be or may be no code added for the
 validation. But this is not the problem ...

Technically, no, but it's the gating issue in this
case.

Try breaking up the JSP into dynamic includes (which
will be easier to manage anyway, because 100 fields on
a form is *way* too many, and must make
editing/modifying a nightmare).

d.



 

Now that's room service!  Choose from over 150,000 hotels
in 45,000 destinations on Yahoo! Travel to find your fit.
http://farechase.yahoo.com/promo-generic-14795097

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



RE: Validation framework question

2007-03-13 Thread Chaudhary, Harsh
I tried to do that but I could not find where my IDE stores those files. I am 
using WSAD 5.1.1 with WebSphere. Any suggestions would be appreciated.

Harsh.

-Original Message-
From: Mike Baroukh [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, March 13, 2007 11:56 AM
To: Struts Users Mailing List
Subject: Re: Validation framework question



then, you may try to look at the compiled jsp ?


Chaudhary, Harsh a écrit :
 I know that the exception Maximum try/catch size reached has something to 
 do with the compiler but what I would likt to know is that whether or not any 
 validation code is added to the compiled JSP file itself.

 Harsh.

 -Original Message-
 From: Mike Baroukh [mailto:[EMAIL PROTECTED] 
 Sent: Tuesday, March 13, 2007 11:51 AM
 To: Struts Users Mailing List
 Subject: Re: Validation framework question



 Hi.

 This is only a problem with javac and depending on wich java version you 
 use.
 jdk5 should not have the problem.
 You may also try to use jikes for compiler.

 There may be or may be no code added for the validation.
 But this is not the problem ...

 Mike

 Chaudhary, Harsh a écrit :
   
 I am having an arguement with a co-worker here and here is how it goes.

 We have a JSP which has about 100 input fields. These fields have custom
 validators on them. When we try to run the JSP, it throws an exception
 something to the tune of Maximum try/catch size reached or something
 like that. He says that this is because of the validations and when we
 remove the validations, everything is fine.

 I say that the validation framework has absolutely nothing to do with
 the JSP's. It deals with the struts forms exclusively. So, the exception
 could not have been because of the validators. He says that when the JSP
 is compiled to a servlet, all the validation code is added to the
 compiled version of the JSP, something I do not agree with.

 Any inputs?

 Thanks,
 Harsh.

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

   
 


   


-- 

Mike Baroukh

---
Cardiweb  - 31 Rue de Mogador Paris IXeme
06 63 57 27 22 - 01 53 21 82 63 - Jabber: [EMAIL PROTECTED]
http://www.cardiweb.com
---


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



Re: Validation framework question

2007-03-13 Thread Mike Baroukh

Did 1.5+ remove the 64K limitation?

I'm not absolutly sure, but  think.
I read this once and it's been a long time since I didn't saw this 
exception ...


Mike

Dave Newton a écrit :

--- Mike Baroukh [EMAIL PROTECTED] wrote:
  

jdk5 should not have the problem.



Did 1.5+ remove the 64K limitation?

  

There may be or may be no code added for the
validation. But this is not the problem ...



Technically, no, but it's the gating issue in this
case.

Try breaking up the JSP into dynamic includes (which
will be easier to manage anyway, because 100 fields on
a form is *way* too many, and must make
editing/modifying a nightmare).

d.



 


Now that's room service!  Choose from over 150,000 hotels
in 45,000 destinations on Yahoo! Travel to find your fit.
http://farechase.yahoo.com/promo-generic-14795097

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

  



--

Mike Baroukh

---
Cardiweb  - 31 Rue de Mogador Paris IXeme
06 63 57 27 22 - 01 53 21 82 63 - Jabber: [EMAIL PROTECTED]
http://www.cardiweb.com
---


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

Re: Validation Framework

2007-03-13 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Balazs,

Balazs Michnay wrote:
 Thanks a lot for your help! It really does work! What I missed was
 the validate=true attribute of the action tag, however, this was
 not mentioned by any of the articles I read.

If it's not mentioned, you should point that out to the authors. I'm
sure they would want to know about any oversights.

 The other thing is that now, the validation error message DID show
 up, but it is displayed on destination-page that should only show
 up when the validation was successful.What I want to do is to show
 the same for until valid values are not entered and when all the
 necessary fields are filled with valid values, forward the user to
 the destination-page.

If validation actually fails, it should be redirecting the user to the
page mentioned in the input attribute of the action currently being
executed.

If validation has passes, but some other error has occurred, perhaps you
are handling that situation incorrectly in your code.

 Again, I'm missing some settings in my config files. You told me to
 use the validate() method but now it's completely removed because all
 the articles told me to remove it.

Right. Under most circumstances, you should set validate=true in your
action definition, and /not/ call form.validate() in your own action.
You /are/ free to call validation by hand, but it's generally more
convenient to allow Struts to handle the validate/fail/redirect logic
for you -- if only to simplify the code in your own actions.

 action input=/LP/JSP_L01_1.jsp name=BEAN_L01
 path=/L01FormAction scope=request type=com.myapp.struts.ACT_L01
 validate=true set-property property=cancellable value=true/ 
 forward name=cancel path=/index.jsp/ forward name=success
 path=/LP/JSP_L01_1.jsp/ /action

I see the problem: input and success are set to the same page. Is
that what you meant to do?

I hope that helps,
- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.7 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFF9tly9CaO5/Lv0PARAm5yAJ9etlGCzbBFWnEK/oJCjZEcWhDZhACgvRXT
W5VsZyEawBx79bfMgy4+qag=
=V3DS
-END PGP SIGNATURE-

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



Re: Validation Framework

2007-03-13 Thread Dave Newton
--- Christopher Schultz wrote:
 Right. Under most circumstances, you should set
 validate=true in your action definition, and 
 /not/ call form.validate() in your own action.
 You /are/ free to call validation by hand, but it's
 generally more convenient to allow Struts to handle 
 the validate/fail/redirect logic for you -- if only 
 to simplify the code in your own actions.

Bah. That still doesn't make any sense to me; my base
class handles all of the work and I don't have to
define another action with a different URL just to
display a form without running validation.

d.



 

We won't tell. Get more on shows you hate to love 
(and love to hate): Yahoo! TV's Guilty Pleasures list.
http://tv.yahoo.com/collections/265 

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



Previous action's property file being accessed incorrectly

2007-03-13 Thread David Harland
 Hi,
 
 We have a problem. Our home page is made up of three actions etc.
 
 s:action name=Home1 executeResult=true /
 s:action name=Home2 executeResult=true /
 s:action name=Home3 executeResult=true /
 
 When a link is clicked on the home page to the User page via the User
 action the User pages properties can't be found. It appears to be
 looking at the action Home3 properties file...
 
 The home pages properties are held in package.properties whereas the
 User Action properties are held in User.properties
 
 com 
   home
   Home1   
   Home2
   Home3
   package.properties
   user
   User
   User.properties
   
 
 Does anyone know why this might be.

__
Ufi Limited 
Registered in England No.  3980770 
Registered Office:  Dearing House, 1 Young Street, Sheffield, S1 4UP 

learndirect Solutions Ltd 
Registered in England No. 5081669 
Registered Office:  Dearing House, 1 Young Street, Sheffield, S1 4UP 

UFI Charitable Trust 
Registered in England No.  3658378 
Registered Charity No.  1081028 
Registered Office:  Dearing House, 1 Young Street, Sheffield, S1 4UP 

This email has been scanned by the MessageLabs Email Security System.

__

Re: Validation framework question

2007-03-13 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Dave,

Dave Newton wrote:
 --- Mike Baroukh [EMAIL PROTECTED] wrote:
 jdk5 should not have the problem.
 
 Did 1.5+ remove the 64K limitation?

The 64k is a limit for method bodies, not try/catch. It should still be
very much in force:
http://java.sun.com/docs/books/jvms/second_edition/html/ClassFile.doc.html#88659

I must admit that I've never heard of this try/catch too big problem
before.

Since the code and exceptions attributes of a method in a Java
.class file have the same limitations (64k), and the compiler checks the
try/catch limits before the code limits, then they really are the same
thing.

In either case, those limits are still in force (i.e. you cann't exceed
64k of code, try/catch or not).

This is one of those irritating issues that breaks down the facade that
JSP operates behind. JSP authors shouldn't have to worry about the
limitations of Java when authoring their pages, but they do :(

 There may be or may be no code added for the validation. But this
 is not the problem ...
 
 Technically, no, but it's the gating issue in this case.
 
 Try breaking up the JSP into dynamic includes (which will be easier
 to manage anyway, because 100 fields on a form is *way* too many, and
 must make editing/modifying a nightmare).

This might not help, depending in which type of include you use. Static
includes, for example, will just import the code from the included JSP,
solving nothing.

Simplifying the page is definitely a good idea, though. If you use a lot
of taglibs (such as emitting 100 form fields using Struts tags), you'll
get a lot of generated code, causing you to run out of space.

The validation is not the problem, though. If you removed validation
entirely, you'd still get this error.

- -chris

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

iD8DBQFF9twQ9CaO5/Lv0PARAgX3AJ9CJTPbkAF7nQ5EJQ5bTjiGUPmtAACggJ+H
OvylAQkRLgU70hRGJUzcpXo=
=rObM
-END PGP SIGNATURE-

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



Re: Validation framework question

2007-03-13 Thread Mike Baroukh


for Websphere, in a subdirectory of AppServer/temp/ you should find 
_*java or, at least _*class if it doesn't keep generated files.
There is a checkbox to check on the console to keep generated files but 
I never remember where ...

(I hate WebSphere !).


If you use the integrated instance of WebSphere in WSAD, I think there 
is a subfolder in eclipse/.plugins that is used for this ...

try again to search for _*class 

google with websphere keepgenerated returns a lot of results
(or WSAD keepgenerated ...)

Mike

Chaudhary, Harsh a écrit :

I tried to do that but I could not find where my IDE stores those files. I am 
using WSAD 5.1.1 with WebSphere. Any suggestions would be appreciated.

Harsh.

-Original Message-
From: Mike Baroukh [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, March 13, 2007 11:56 AM

To: Struts Users Mailing List
Subject: Re: Validation framework question



then, you may try to look at the compiled jsp ?


Chaudhary, Harsh a écrit :
  

I know that the exception Maximum try/catch size reached has something to do 
with the compiler but what I would likt to know is that whether or not any validation 
code is added to the compiled JSP file itself.

Harsh.

-Original Message-
From: Mike Baroukh [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, March 13, 2007 11:51 AM

To: Struts Users Mailing List
Subject: Re: Validation framework question



Hi.

This is only a problem with javac and depending on wich java version you 
use.

jdk5 should not have the problem.
You may also try to use jikes for compiler.

There may be or may be no code added for the validation.
But this is not the problem ...

Mike

Chaudhary, Harsh a écrit :
  


I am having an arguement with a co-worker here and here is how it goes.

We have a JSP which has about 100 input fields. These fields have custom
validators on them. When we try to run the JSP, it throws an exception
something to the tune of Maximum try/catch size reached or something
like that. He says that this is because of the validations and when we
remove the validations, everything is fine.

I say that the validation framework has absolutely nothing to do with
the JSP's. It deals with the struts forms exclusively. So, the exception
could not have been because of the validators. He says that when the JSP
is compiled to a servlet, all the validation code is added to the
compiled version of the JSP, something I do not agree with.

Any inputs?

Thanks,
Harsh.

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

  

  
  




  



--

Mike Baroukh

---
Cardiweb  - 31 Rue de Mogador Paris IXeme
06 63 57 27 22 - 01 53 21 82 63 - Jabber: [EMAIL PROTECTED]
http://www.cardiweb.com
---


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

Re: Validation framework question

2007-03-13 Thread Dave Newton
--- Christopher Schultz wrote:
 I wrote:
 Try breaking up the JSP into dynamic includes
 This might not help, depending in which type of
 include you use. Static includes, for example, [...]

...

d.



 

Looking for earth-friendly autos? 
Browse Top Cars by Green Rating at Yahoo! Autos' Green Center.
http://autos.yahoo.com/green_center/

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



Re: Validation Framework

2007-03-13 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Dave,

Dave Newton wrote:
 --- Christopher Schultz wrote:
 Right. Under most circumstances, you should set
 validate=true in your action definition, and 
 /not/ call form.validate() in your own action.
 You /are/ free to call validation by hand, but it's
 generally more convenient to allow Struts to handle 
 the validate/fail/redirect logic for you -- if only 
 to simplify the code in your own actions.
 
 Bah. That still doesn't make any sense to me; my base
 class handles all of the work and I don't have to
 define another action with a different URL just to
 display a form without running validation.

I didn't say that you need another URL that doesn't perform validation.
I'm just suggesting that calling form.validate( ) by hand doesn't buy
you much (unless you are doing something complex). Since the OT is just
starting out, I'm guessing his validations are relatively simple.

- -chris

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

iD8DBQFF9t0V9CaO5/Lv0PARAnDKAJ97njyUOTxekxwoEJAi7+OY7qLcnwCgno4C
GYNRNQMEWRpZk4RLss0W7S0=
=IlSV
-END PGP SIGNATURE-

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



S:SUBMIT action usage

2007-03-13 Thread King, Leon C
Hi All,

How do you utilize the s:submit tag in conjunction with
'Action Wildcards'.  On my form I have 3 buttions:

one to display tabular results, and the other 2 to display
graphs.  Here is my code excerpt.

 

 

  td

s:submit type=button action=%{'queryResult'}

 templateDir=mytemplates label=Query Result
/

  /td

  td width=10nbsp;/td

  td

s:submit type=button action=%{'asrTrend'}

 templateDir=mytemplates label=ASR Trend /

  /td

  td width=10nbsp;/td

  td

s:submit type=button value=%{'mhtTrend'}

   templateDir=mytemplateslabel=MHT Trend /

  /td 

 

 

  I want to have the abilty to define a *Action in the struts.xml
file that will allow these three submissions to use separate methods.

 

Thanks,

 

Leon



Re: [s1] Filters: distinguishing between user-requests and redirects

2007-03-13 Thread Michael Jouravlev

On 3/13/07, Christopher Schultz [EMAIL PROTECTED] wrote:

Pierre,

 I am trying to implement a flood control mechanism to prevent robots
 requesting pages after pages at an inhuman rate.

I know you've gotten lots of feedback already, but there's a
super-simple way to do this: put a marker in the request attributes the
first time your filter sees it. Check for it each time. When you place
the marker in the request, perform all your magic: check the queue, add
the current request + timestamp, etc. If the marker is already there,
skip everything.

For redirects, the request should be re-used, so the marker should
remain until your final response.


You are confusing redirection with forwarding.

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



Re: Validation framework question

2007-03-13 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Dave,

Dave Newton wrote:
 --- Christopher Schultz wrote:
 I wrote:
 Try breaking up the JSP into dynamic includes
 This might not help, depending in which type of
 include you use. Static includes, for example, [...]
 
 ...

Heh. Missed dynamic. Sorry 'bout that.

- -chris

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

iD8DBQFF9t3M9CaO5/Lv0PARAsrHAKCoeSdUyv4cH4wjTH7nmX16NPjXogCdEQ76
fc9Lms259ldMHMRCUPSpeWk=
=ZHid
-END PGP SIGNATURE-

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



Re: Validation Framework

2007-03-13 Thread Dave Newton
--- Christopher Schultz wrote:
 I didn't say that you need another URL that doesn't
 perform validation. 

Oh. I guess I don't know another way to show a form
via an Action without running validation except by
defining an Action.

d.



 

Bored stiff? Loosen up... 
Download and play hundreds of games for free on Yahoo! Games.
http://games.yahoo.com/games/front

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



Re: S:SUBMIT action usage

2007-03-13 Thread Dave Newton
--- King, Leon C wrote:
 How do you utilize the s:submit tag in
 conjunction with 'Action Wildcards'.
 [...]
 s:submit type=button action=%{'queryResult'}...

s:submit action=theAction!theMethod.../ will work
and you don't need to do anything with wildcards.

d.



 

Get your own web address.  
Have a HUGE year through Yahoo! Small Business.
http://smallbusiness.yahoo.com/domains/?p=BESTDEAL

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



RE: S:SUBMIT action usage

2007-03-13 Thread King, Leon C
Like this?  s:submit type=button
action=CityCountryLevelQueryAction!getMhtTrend


Getting a 'Could not find action or result' error...   

Code Snippet
public String getMhtTrend() throws Exception 
{
System.out.println(  getMhtTrend here  );

return SUCCESS;
}



Struts.xml snippet
action name=CityCountryLevelQueryAction
class=icisweb.query.web.QueryAction
result name=SQLException
type=chainSQLExceptionAction/result
resultjsp/query_city_countrylevel.jsp/result
/action

-Original Message-
From: Dave Newton [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, March 13, 2007 1:26 PM
To: Struts Users Mailing List
Subject: Re: S:SUBMIT action usage

--- King, Leon C wrote:
 How do you utilize the s:submit tag in
 conjunction with 'Action Wildcards'.
 [...]
 s:submit type=button action=%{'queryResult'}...

s:submit action=theAction!theMethod.../ will work
and you don't need to do anything with wildcards.

d.



 


Get your own web address.  
Have a HUGE year through Yahoo! Small Business.
http://smallbusiness.yahoo.com/domains/?p=BESTDEAL

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


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



RE: S:SUBMIT action usage

2007-03-13 Thread Dave Newton
--- King, Leon C wrote:
 Like this?  s:submit type=button
 action=CityCountryLevelQueryAction!getMhtTrend

Er... I thought so :/

Do you have struts.enable.DynamicMethodInvocation set
to false? And you know that you are both returning a
valid result and that the result exists?

d.



 

The fish are biting. 
Get more visitors on your site using Yahoo! Search Marketing.
http://searchmarketing.yahoo.com/arp/sponsoredsearch_v2.php

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



RE: S:SUBMIT action usage

2007-03-13 Thread King, Leon C
struts.enable.DynamicMethodInvocation=true

Now almost working... I have 3 buttons on the form, it seems that only
the first action defined for the first button is being submitted.   I'm
using MS IE..   Is this a bug?

Thanks,

Leon

-Original Message-
From: Dave Newton [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, March 13, 2007 2:08 PM
To: Struts Users Mailing List
Subject: RE: S:SUBMIT action usage

--- King, Leon C wrote:
 Like this?  s:submit type=button
 action=CityCountryLevelQueryAction!getMhtTrend

Er... I thought so :/

Do you have struts.enable.DynamicMethodInvocation set
to false? And you know that you are both returning a
valid result and that the result exists?

d.



 


The fish are biting. 
Get more visitors on your site using Yahoo! Search Marketing.
http://searchmarketing.yahoo.com/arp/sponsoredsearch_v2.php

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


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



RE: S:SUBMIT action usage

2007-03-13 Thread Dave Newton
--- King, Leon C wrote:
 it seems that only the first action defined for the 
 first button is being submitted. I'm using MS IE..  

 Is this a bug?

http://cwiki.apache.org/WW/submit.html

What version of IE are you using? I'm running a
simplified version of multiple s:submit type=button
action=foo!meth1.../ using multiple methods under
IE... um... boy I hate the new IE. IE 7 and it works
okay.

d.



 

Don't get soaked.  Take a quick peek at the forecast
with the Yahoo! Search weather shortcut.
http://tools.search.yahoo.com/shortcuts/#loc_weather

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



RE: S:SUBMIT action usage

2007-03-13 Thread King, Leon C
IE 6.0I noticed a note 

'Please note that the button type has advantages by adding the
possibility to seperate the submitted value from the text shown on the
button face, but has issues with Microsoft Internet Explorer at least up
to 6.0'

I tried with Netscape, it all three buttons utilize the correct methods
assigned. Is there another way I can do this?

Leon

-Original Message-
From: Dave Newton [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, March 13, 2007 2:53 PM
To: Struts Users Mailing List
Subject: RE: S:SUBMIT action usage

--- King, Leon C wrote:
 it seems that only the first action defined for the 
 first button is being submitted. I'm using MS IE..  

 Is this a bug?

http://cwiki.apache.org/WW/submit.html

What version of IE are you using? I'm running a
simplified version of multiple s:submit type=button
action=foo!meth1.../ using multiple methods under
IE... um... boy I hate the new IE. IE 7 and it works
okay.

d.



 


Don't get soaked.  Take a quick peek at the forecast
with the Yahoo! Search weather shortcut.
http://tools.search.yahoo.com/shortcuts/#loc_weather

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


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



RE: S:SUBMIT action usage

2007-03-13 Thread King, Leon C
Sorry, here's my code.
s:submit type=button method=submitQueryResult
value=submitQueryResult
 theme=simple label=Query Result /
  /td
  td width=10nbsp;/td
  td
s:submit type=button  method=getAsrTrend
value=getAsrTrend
 templateDir=mytemplates label=ASR
Trend /
  /td
  td width=10nbsp;/td
  td
s:submit type=button method=getMhtTrend
value=getMhtTrend
 templateDir=mytemplates  label=MHT
Trend /

-Original Message-
From: Dave Newton [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, March 13, 2007 2:53 PM
To: Struts Users Mailing List
Subject: RE: S:SUBMIT action usage

--- King, Leon C wrote:
 it seems that only the first action defined for the 
 first button is being submitted. I'm using MS IE..  

 Is this a bug?

http://cwiki.apache.org/WW/submit.html

What version of IE are you using? I'm running a
simplified version of multiple s:submit type=button
action=foo!meth1.../ using multiple methods under
IE... um... boy I hate the new IE. IE 7 and it works
okay.

d.



 


Don't get soaked.  Take a quick peek at the forecast
with the Yahoo! Search weather shortcut.
http://tools.search.yahoo.com/shortcuts/#loc_weather

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


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



Dynamic parameter question - S2

2007-03-13 Thread Scott Nesbitt

I would like to have a url pass a parameter based on
the value of a field on the JSP.  My code looks like
this:


s:url id=historyUrl action=LineupHistory
includeParams=all
   s:param name=foo value=%{barbar}/
/s:url
s:a href=%{historyUrl}Lineup History/s:a

s:hidden name=barbar value=%{'baz'}/


Sadly, in my action class this:

log.debug(In execute, parameters size:  +
parameters.size());

says zero.

If I use the name of a select tag instead of a hidden
the parameter has the first selection so I know my
parameter map is working.  I just can't get it to use
a hidden tag.

Any suggestion?

Thanks for any tips or pointers,

Scott


 

Now that's room service!  Choose from over 150,000 hotels
in 45,000 destinations on Yahoo! Travel to find your fit.
http://farechase.yahoo.com/promo-generic-14795097

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



Re: Dynamic parameter question - S2

2007-03-13 Thread Dave Newton
--- Scott Nesbitt [EMAIL PROTECTED] wrote:
 I would like to have a url pass a parameter based on
 the value of a field on the JSP.  My code looks like
 this:

Unless the field is set by the Action before
displaying the JSP the parameter won't hold a value
until it's submitted.

 s:url id=historyUrl 
action=LineupHistory
includeParams=all
   s:param name=foo value=%{barbar}/
 /s:url

If the action that displays this JSP fragment has a
'barbar' property (that is set/initialized) everthing
is fine. If it doesn't, then you're actually trying to
build up a URL from form values on the same page,
which generally implies JavaScript.

You may be able to do similar functionality by using
one of the ajax-y S2 tags (haven't thought about it),
by submitting to a different action (but would keep
the form value of whatever it is you're talking
about), or a few other ways.

d.



 

Expecting? Get great news right away with email Auto-Check. 
Try the Yahoo! Mail Beta.
http://advision.webevents.yahoo.com/mailbeta/newmail_tools.html 

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



Re: Dynamic parameter question - S2

2007-03-13 Thread Scott Nesbitt

Hmm, I see your point.  I do not really need to do any
fancy Ajax stuff here, I just want an action invoked
by a url link to have access to what was selected on
the page (which I was going to stuff into a hidden
field.)

I know I can do this with a form and submit button,
but surely there is a way to do this with a link,
correct?

Thanks for the response,

Scott

--- Dave Newton [EMAIL PROTECTED] wrote:

 --- Scott Nesbitt [EMAIL PROTECTED] wrote:
  I would like to have a url pass a parameter based
 on
  the value of a field on the JSP.  My code looks
 like
  this:
 
 Unless the field is set by the Action before
 displaying the JSP the parameter won't hold a value
 until it's submitted.
 
  s:url id=historyUrl 
 action=LineupHistory
 includeParams=all
s:param name=foo value=%{barbar}/
  /s:url
 
 If the action that displays this JSP fragment has a
 'barbar' property (that is set/initialized)
 everthing
 is fine. If it doesn't, then you're actually trying
 to
 build up a URL from form values on the same page,
 which generally implies JavaScript.
 
 You may be able to do similar functionality by using
 one of the ajax-y S2 tags (haven't thought about
 it),
 by submitting to a different action (but would keep
 the form value of whatever it is you're talking
 about), or a few other ways.
 
 d.
 
 
 
  


 Expecting? Get great news right away with email
 Auto-Check. 
 Try the Yahoo! Mail Beta.

http://advision.webevents.yahoo.com/mailbeta/newmail_tools.html
 
 

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



 

TV dinner still cooling? 
Check out Tonight's Picks on Yahoo! TV.
http://tv.yahoo.com/

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



Validation on java.util.List

2007-03-13 Thread Alex Wibowo

Hi all...

I am using Struts 2.0. Has anyone ever done validation on individual item in
java.util.List before?

Say, I have a property
 ListCustomer customers
in my Action, and Customer is defined as:

public class Customer{
private String username;// must not be empty
private int  age;// must be  0
}

In the JSP I have the following:


c:forEach begin=0 end=10 var=i
   s:textfield key=customers[${i}].username /
   s:textfield key=customers[${i}].age /
/c:forEach


How can I enforce using struts validation (preferrably through annotation)
so that:
- both username and age are compulsory
- age must be an integer


Secondly, since age is of type int.. when user enter characters
(numbers) in the textfield, they get converted to 0 (somehow).
How can I prevent this?



Thanks in advance!



--
Best regards,


WiB
---


Re: Dynamic parameter question - S2

2007-03-13 Thread Laurie Harper
For your posted example, where that value you want to pass is the value 
you're rendering in the hidden field, you can just use the same OGNL 
expression in both places:


...
s:param name=foo value=%{baz}/
...

If that hidden input's field is being changed by client-side Javascript, 
though, or needs to come from a a user input/selection, then you'll have 
to use Javascript to build/modify the href for the link, too.


There's no way a server-side, render-time OGNL expression can ever 
reference dynamic user inputs/selections.


L.

Scott Nesbitt wrote:

Hmm, I see your point.  I do not really need to do any
fancy Ajax stuff here, I just want an action invoked
by a url link to have access to what was selected on
the page (which I was going to stuff into a hidden
field.)

I know I can do this with a form and submit button,
but surely there is a way to do this with a link,
correct?

Thanks for the response,

Scott

--- Dave Newton [EMAIL PROTECTED] wrote:


--- Scott Nesbitt [EMAIL PROTECTED] wrote:

I would like to have a url pass a parameter based

on

the value of a field on the JSP.  My code looks

like

this:

Unless the field is set by the Action before
displaying the JSP the parameter won't hold a value
until it's submitted.

s:url id=historyUrl 
   action=LineupHistory

   includeParams=all
  s:param name=foo value=%{barbar}/
/s:url

If the action that displays this JSP fragment has a
'barbar' property (that is set/initialized)
everthing
is fine. If it doesn't, then you're actually trying
to
build up a URL from form values on the same page,
which generally implies JavaScript.

You may be able to do similar functionality by using
one of the ajax-y S2 tags (haven't thought about
it),
by submitting to a different action (but would keep
the form value of whatever it is you're talking
about), or a few other ways.

d.



 




Expecting? Get great news right away with email
Auto-Check. 
Try the Yahoo! Mail Beta.



http://advision.webevents.yahoo.com/mailbeta/newmail_tools.html




-

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






 

TV dinner still cooling? 
Check out Tonight's Picks on Yahoo! TV.

http://tv.yahoo.com/



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



OGNL - invalid syntax. JSP EL?

2007-03-13 Thread Piero Sartini
Hello,

I get the following error when trying to create a list with ognl:

org.apache.jasper.JasperException: /jspx/users/completeProfile.jspx(27,48) 
#{'F':'Female','M':'Male'} 
contains invalid expression(s): javax.el.ELException: Error Parsing: 
#{'F':'Female','M':'Male'}

the code in jspx:
s:select label=%{getText('profile.gender')}
  name=gender
  headerKey=-1 
headerValue=%{getText('profile.selectgender')}
  list=#{'F':'Female','M':'Male'}
  value=gender
  required=true/

It seems it thinks it is JSP EL (what makes sense in a jsp file). I am using 
JSP 2.1 - is this a problem for s2?

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



Re: OGNL - invalid syntax. JSP EL?

2007-03-13 Thread Piero Sartini
Found the answer in the opensymphony forum:
http://forums.opensymphony.com/thread.jspa?messageID=100059

On glassfish, it seems you have to disable EL:
  !-- = Disable the JSP-EL, it messes up on pages with OGNL 
=== --
  jsp-config
jsp-property-group
  url-pattern*.jspx/url-pattern
  el-ignoredtrue/el-ignored
/jsp-property-group
  /jsp-config

Will this issue get resolved in the future?


Am Dienstag, 13. März 2007 schrieb Piero Sartini:
 Hello,

 I get the following error when trying to create a list with ognl:

 org.apache.jasper.JasperException: /jspx/users/completeProfile.jspx(27,48)
 #{'F':'Female','M':'Male'} contains invalid expression(s):
 javax.el.ELException: Error Parsing: #{'F':'Female','M':'Male'}

 the code in jspx:
 s:select label=%{getText('profile.gender')}
   name=gender
   headerKey=-1
 headerValue=%{getText('profile.selectgender')}
   list=#{'F':'Female','M':'Male'}
   value=gender
   required=true/

 It seems it thinks it is JSP EL (what makes sense in a jsp file). I am
 using JSP 2.1 - is this a problem for s2?

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

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



Re: OGNL - invalid syntax. JSP EL?

2007-03-13 Thread Dave Newton
--- Piero Sartini [EMAIL PROTECTED] wrote:
 On glassfish, it seems you have to disable EL:
   !-- = Disable the JSP-EL, it messes up on
 pages with OGNL 
 === --
   jsp-config
 jsp-property-group
   url-pattern*.jspx/url-pattern
   el-ignoredtrue/el-ignored
 /jsp-property-group
   /jsp-config
 
 Will this issue get resolved in the future?

That may have to do with the JSF EL, which also uses #
as its escape char.

If that's the case, probably not?

d.



 

Bored stiff? Loosen up... 
Download and play hundreds of games for free on Yahoo! Games.
http://games.yahoo.com/games/front

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



Re: OGNL - invalid syntax. JSP EL?

2007-03-13 Thread Piero Sartini
  Will this issue get resolved in the future?

 That may have to do with the JSF EL, which also uses #
 as its escape char.

 If that's the case, probably not?

That is the case. But why not? Its not JSF EL but JSP EL.
I don't think its good to be incompatible with JSP..

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



Re: OGNL - invalid syntax. JSP EL?

2007-03-13 Thread Dave Newton
Sorry, meant to include this link:

http://today.java.net/pub/a/today/2006/03/07/unified-jsp-jsf-expression-language.html

d.

--- Dave Newton [EMAIL PROTECTED] wrote:

 --- Piero Sartini [EMAIL PROTECTED] wrote:
  On glassfish, it seems you have to disable EL:
!-- = Disable the JSP-EL, it messes up
 on
  pages with OGNL 
  === --
jsp-config
  jsp-property-group
url-pattern*.jspx/url-pattern
el-ignoredtrue/el-ignored
  /jsp-property-group
/jsp-config
  
  Will this issue get resolved in the future?
 
 That may have to do with the JSF EL, which also uses
 #
 as its escape char.
 
 If that's the case, probably not?
 
 d.
 
 
 
  


 Bored stiff? Loosen up... 
 Download and play hundreds of games for free on
 Yahoo! Games.
 http://games.yahoo.com/games/front
 

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



 

Never miss an email again!
Yahoo! Toolbar alerts you the instant new Mail arrives.
http://tools.search.yahoo.com/toolbar/features/mail/

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



Re: OGNL - invalid syntax. JSP EL?

2007-03-13 Thread Dave Newton
--- Piero Sartini [EMAIL PROTECTED] wrote:
 I don't think its good to be incompatible with JSP..

It wasn't incompatible until 2.1, IIRC, and it was
JSF-only up until then, before the unification effort.

Maybe take it up w/ the OGNL folks? I agree that this
may cause a problem in some environments.

d.



 

Be a PS3 game guru.
Get your game face on with the latest PS3 news and previews at Yahoo! Games.
http://videogames.yahoo.com/platform?platform=120121

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



Struts 2.0.6 portlets

2007-03-13 Thread tom tom

We were alble to successfully deploy the struts 2.06
portlet sample on our portal container which is
uPortal.

What we want to know is Can we write the portlet
applications simillar to the Struts 2.0.6 web
applications(not portlets).

Does Struts 2.0.6 portlets got limitations compared to
the normal struts 2.0.6 application. Are there any DOs
and DONT'S

Please us know before we beging the work.

Thanks


 

Never miss an email again!
Yahoo! Toolbar alerts you the instant new Mail arrives.
http://tools.search.yahoo.com/toolbar/features/mail/

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



Re: Validation on java.util.List

2007-03-13 Thread Dave Newton
--- Alex Wibowo [EMAIL PROTECTED] wrote:
 I am using Struts 2.0. Has anyone ever done
 validation on individual item in java.util.List 
 before?

I'm drawing a blank on this one too after poking it
with a stick for about an hour now... I have a similar
requirement (but with fairly heavy inter-field
dependencies) so if you come up with something, please
follow up!

d.



 

No need to miss a message. Get email on-the-go 
with Yahoo! Mail for Mobile. Get started.
http://mobile.yahoo.com/mail 

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



Global messages.jsp file included in a SiteMesh decorator

2007-03-13 Thread mraible

I have a messages.jsp[1] that's included (using %@ include
file=/common/messages.jsp %) in my default decorator. This file has a
couple of calls to the valueStack - namely hasActionErrors() and
hasFieldErrors().  This worked fine in WebWork 2.1.x and Struts 2.0.1 - even
when pages where rendered that didn't go through Struts.  However, starting
with the 2.0.6 release, the s:if tag throws a NPE because the ValueStack
isn't in the request.  I believe it's a bug, but wanted to check with this
list first to confirm.

Thanks,

Matt

[1] messages.jsp:

% if (request.getAttribute(struts.valueStack) != null) { %
s:if test=hasActionErrors()
div class=error id=errorMessages
  s:iterator value=actionErrors
 c:url value= 
alt=fmt:message key=icon.warning/ class=icon /
s:property escape=false/br /
  /s:iterator
   /div
/s:if

s:if test=hasFieldErrors()
div class=error id=errorMessages
  s:iterator value=fieldErrors
  s:iterator value=value
 c:url value= 
alt=fmt:message key=icon.warning/ class=icon /
 s:property escape=false/br /
  /s:iterator
  /s:iterator
   /div
/s:if
% } %

%-- Success Messages --%
c:if test=${not empty messages}
div class=message id=successMessages
c:forEach var=msg items=${messages}
 c:url value= 
alt=fmt:message key=icon.information/ class=icon /
c:out value=${msg} escapeXml=false/br /
/c:forEach
/div
c:remove var=messages scope=session/
/c:if

-- 
View this message in context: 
http://www.nabble.com/Global-messages.jsp-file-included-in-a-SiteMesh-decorator-tf3400265.html#a9468706
Sent from the Struts - User mailing list archive at Nabble.com.


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



Re: Struts 2.0.6 portlets

2007-03-13 Thread Nils-Helge Garli

A couple of things you should be aware of is:

- You cannot use result types that require full control of the
response object (e.g. rendering PDFs, images, charts etc). To do that,
you must dispatch a request to a servlet instead.
- You should be aware of the lifecycle and the phases of a portlet,
and how they apply to links and forms in a Struts 2 portlet to avoid
weird state behaviour.
- You should be aware of portlet modes, and how they are mapped to
namespaces in the Struts 2 framework.
- You can't create your own links. You should only create links using
the form and url tags.
- Ajax have some limitations.
- You can't generate a complete HTML document, only what's between the
body tags of what would have been a regular web app.


Otherwise, you should be able to build it as a normal Struts 2 app.

Nils-H

On 3/14/07, tom tom [EMAIL PROTECTED] wrote:


We were alble to successfully deploy the struts 2.06
portlet sample on our portal container which is
uPortal.

What we want to know is Can we write the portlet
applications simillar to the Struts 2.0.6 web
applications(not portlets).

Does Struts 2.0.6 portlets got limitations compared to
the normal struts 2.0.6 application. Are there any DOs
and DONT'S

Please us know before we beging the work.

Thanks




Never miss an email again!
Yahoo! Toolbar alerts you the instant new Mail arrives.
http://tools.search.yahoo.com/toolbar/features/mail/

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




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