Upgrading to struts 1.3.5, nested tags are broken

2007-03-07 Thread Lance Semmens
We are in the process of upgrading to struts 1.3.5, I have followed the upgrade 
guide at http://wiki.apache.org/struts/StrutsUpgradeNotes12to13. Most of the 
nested tags now seem to be broken.

For example:
nested:form action=/someAction
  nested:iterate property=records id=record type=example.com.Record
nested:write property=investor.name /
  /nested:iterate
/nested:form

The following exception is thrown:
javax.servlet.jsp.JspException: No getter method for property: investor.name 
of bean: someForm
at org.apache.struts.taglib.TagUtils.lookup(TagUtils.java:903)
at org.apache.struts.taglib.bean.WriteTag.doStartTag(WriteTag.java:230)
at 
org.apache.struts.taglib.nested.bean.NestedWriteTag.doStartTag(NestedWriteTag.java:60)


It seems as if nested:write / is going to the nested:form / to get 
investor.name instead of record in nested:iterate / as I would expect. If 
I change my nested:write / tags to nested:writeNesting / it fixes them. I 
have looked at the code and writeNesting uses 
NestedPropertyHelper.getAdjustedProperty() whereas write uses 
NestedPropertyHelper.setNestedProperties().

nested:define / is broken too, looking at the similarities in all of the 
nested tags I get the they're all broken in this way. 

Cheers,
Lance.


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



RE: Upgrading to struts 1.3.5, nested tags are broken

2007-03-07 Thread Lance Semmens
I want record.getInvestor().getName() to be called. My understanding of nested 
is that nested:write / does not need to mention record as it implicitly 
knows about it.

-Original Message-
From: nagesh.kumar [mailto:[EMAIL PROTECTED] 
Sent: 07 March 2007 09:25
To: 'Struts Users Mailing List'
Subject: RE: Upgrading to struts 1.3.5, nested tags are broken

Instead of using  investor.name use record.name 

Try  this will work

-Original Message-
From: Lance Semmens [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, March 07, 2007 2:54 PM
To: 'user@struts.apache.org'
Subject: Upgrading to struts 1.3.5, nested tags are broken

We are in the process of upgrading to struts 1.3.5, I have followed the
upgrade guide at http://wiki.apache.org/struts/StrutsUpgradeNotes12to13.
Most of the nested tags now seem to be broken.

For example:
nested:form action=/someAction
  nested:iterate property=records id=record
type=example.com.Record
nested:write property=investor.name /
  /nested:iterate
/nested:form

The following exception is thrown:
javax.servlet.jsp.JspException: No getter method for property:
investor.name of bean: someForm
at org.apache.struts.taglib.TagUtils.lookup(TagUtils.java:903)
at org.apache.struts.taglib.bean.WriteTag.doStartTag(WriteTag.java:230)
at
org.apache.struts.taglib.nested.bean.NestedWriteTag.doStartTag(NestedWriteTa
g.java:60)


It seems as if nested:write / is going to the nested:form / to get
investor.name instead of record in nested:iterate / as I would expect.
If I change my nested:write / tags to nested:writeNesting / it fixes
them. I have looked at the code and writeNesting uses
NestedPropertyHelper.getAdjustedProperty() whereas write uses
NestedPropertyHelper.setNestedProperties().

nested:define / is broken too, looking at the similarities in all of the
nested tags I get the they're all broken in this way. 

Cheers,
Lance.


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


DISCLAIMER:
The information in this e-mail is the property of InterGlobe and is 
confidential and privileged. It is intended solely for the addressee. Access to 
this email by anyone else is unauthorized. If you are not the intended 
recipient, any disclosure, copying, distribution or any action taken in 
reliance on it is prohibited and will be unlawful. If you receive this message 
in error, please notify the sender immediately and delete all copies of this 
message



-
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: Upgrading to struts 1.3.5, nested tags are broken

2007-03-07 Thread Lance Semmens
Problem solved... it ended up being one of our own custom tags that wasn't 
cleaning up after itself. Have changed the tag to mimic the behavior in the 
standard nested tags.

Cheers,
Lance.

-Original Message-
From: Niall Pemberton [mailto:[EMAIL PROTECTED] 
Sent: 07 March 2007 14:22
To: Struts Users Mailing List
Subject: Re: Upgrading to struts 1.3.5, nested tags are broken

On 3/7/07, Lance Semmens [EMAIL PROTECTED] wrote:
 We are in the process of upgrading to struts 1.3.5, I have followed the 
 upgrade guide at http://wiki.apache.org/struts/StrutsUpgradeNotes12to13. Most 
 of the nested tags now seem to be broken.

 For example:
 nested:form action=/someAction
   nested:iterate property=records id=record 
 type=example.com.Record
 nested:write property=investor.name /
   /nested:iterate
 /nested:form

 The following exception is thrown:
 javax.servlet.jsp.JspException: No getter method for property: 
 investor.name of bean: someForm
 at org.apache.struts.taglib.TagUtils.lookup(TagUtils.java:903)
 at org.apache.struts.taglib.bean.WriteTag.doStartTag(WriteTag.java:230)
 at 
 org.apache.struts.taglib.nested.bean.NestedWriteTag.doStartTag(NestedWriteTag.java:60)


 It seems as if nested:write / is going to the nested:form / to get 
 investor.name instead of record in nested:iterate / as I would expect. 
 If I change my nested:write / tags to nested:writeNesting / it fixes 
 them. I have looked at the code and writeNesting uses 
 NestedPropertyHelper.getAdjustedProperty() whereas write uses 
 NestedPropertyHelper.setNestedProperties().

 nested:define / is broken too, looking at the similarities in all of the 
 nested tags I get the they're all broken in this way.

I'm not that familiar with the nested tags - are you saying that you
have pages that used these tags and worked in Struts 1.2.x and they no
longer do so when upgrading to Struts 1.3.5?

Niall

 Cheers,
 Lance.

-
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: session maintenance in struts webapp

2006-11-21 Thread Lance Semmens
You could either do it client side in javascript
setTimeout(confirmSessionExpire(), timeoutPeriod);

Or you could have a serverside thread and use DWR's amazing reverse ajax to 
push alerts to the client(s) that are about to expire. Reverse ajax is part of 
DWR2.0 and is not yet production stable but it's pretty close.
 
http://getahead.ltd.uk/dwr/changelog/dwr20m1 

Lance.
-Original Message-
From: robin bajaj [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, November 21, 2006 2:41 PM
To: Struts Users Mailing List
Subject: session maintenance in struts webapp

Hi Folks,
In my Struts 1.2.x based webapp, I intend to maintain a session for
every logged in user.
-- More details --
Say after 'n' seconds of inactivity I want to pop up a message
saying the session will expire in another 'm' seconds. The user can
click on 'refresh' button to get some more grace time else the session
will expire and the next time user tries to do something on the page, he
gets redirected to the 'login' page with a message - 'your last session
has expired, please login again'

I have already implemented SSL using SSLext tag-library (release 0 for
Struts 1.2.x) in my webApp. Can it help me in this case,

What other alternatives can I consider in this case,
Any tips/ideas will be much appreciated,
Regards,
robin



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


__
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email 
__

*** Disclaimer *** 

This electronic communication is confidential and for the exclusive use of the 
addressee. It may contain private and confidential information. The 
information, attachments and opinions contained in this E-mail are those of its 
author only and do not necessarily represent those of London Scottish Bank PLC 
or any other members of the London Scottish Group. 

If you are not the intended addressee, you are prohibited from any disclosure, 
distribution or further copying or use of this communication or the information 
in it or taking any action in reliance on it. If you have received this 
communication in error please notify the Information Security Manager at [EMAIL 
PROTECTED] as soon as possible and delete the message from all places in your 
computer where it is stored. 

We utilise virus scanning software but we cannot guarantee the security of 
electronic communications and you are advised to check any attachments for 
viruses. We do not accept liability for any loss resulting from any corruption 
or alteration of data or importation of any virus as a result of receiving this 
electronic communication. 

Replies to this E-mail may be monitored for operational or business reasons. 
London Scottish Bank PLC is regulated by the Financial Services Authority.
__
This email has been scanned by the MessageLabs Email Security System.

-
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: Logging to db

2006-11-21 Thread Lance Semmens
It would be easy enough to do by writing a custom javax.servlet.Filter. You 
would map your Filter to *.do in web.xml.

Alternatively you could configure a JDBC appender in log4j for 
org.apache.struts.action.RequestProcessor at level debug although you might 
find a bit too much junk is being logged. 
(http://logging.apache.org/log4j/docs/api/org/apache/log4j/jdbc/JDBCAppender.html)


-Original Message-
From: Søren Blidorf [mailto:[EMAIL PROTECTED] 
Sent: 21 November 2006 13:19
To: user@struts.apache.org
Subject: Logging to db

Hi.

I what to log every user action on my application and save it in my sql
db.

Is there a build in function in STRUTS for that?

BR

Soren, DK



-
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: RE: RE: [HELP] struts 1.2.9 multibox/checkbox in session scoped form

2006-11-17 Thread Lance Semmens
RequestProcessor is doing it's job by resetting the form. What should then 
happen is that your checkboxes should be set after reset() is called which 
doesn't seem to be happening.

Somethings not right here, esp since when you comment out reset, it works. Can 
you post your code? pls. include the relevant parts of struts-config.xml, your 
action and your form.

-Original Message-
From: Garner Shawn [mailto:[EMAIL PROTECTED] 
Sent: 14 November 2006 17:36
To: user@struts.apache.org
Subject: RE: RE: RE: [HELP] struts 1.2.9 multibox/checkbox in session scoped 
form

I am not explicitly calling the reset anywhere.
I've also debugged it and can not find anything out of the ordinary.
From I can tell it is the request processor that is resetting my form
prior to the page displaying that ends up with the checkboxes not
checked.

Any help?


Shawn

--
From: Lance Semmens [EMAIL PROTECTED]
To: 'Struts Users Mailing List' user@struts.apache.org
Date: Tue, 14 Nov 2006 09:51:00 +
Subject: RE: RE: [HELP] struts 1.2.9 multibox/checkbox in session scoped form
The only thing I can think is maybe you're explicitly calling reset()
in your action (instead of letting struts do it automatically). If
not, I suggest putting a debug breakpoint on the setters for your
checkboxes and see what's going on.

-
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: custom tag for localization

2006-11-17 Thread Lance Semmens
Not exactly what you asked for but LocaleAction can set the locale then 
redirect to a page.

http://struts.apache.org/1.x/struts-extras/apidocs/

-Original Message-
From: Mahmoud Saeed(RSW) [mailto:[EMAIL PROTECTED] 
Sent: 14 November 2006 23:30
To: user@struts.apache.org
Subject: custom tag for localization

 

Hi, 

I want an open-source custom tag for localizing struts-based application
using dispatch Action.

thanx




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



RE: can not reach the jsp file

2006-11-17 Thread Lance Semmens
hmm... are you using IE?
You may need to turn off show friendly error messages in the options 
somewhere. I'm thinking you've got a server error that IE is hiding from you. 
Any errors in the log?

 -Original Message-
From: Ken Hu [mailto:[EMAIL PROTECTED] 
Sent: 17 November 2006 01:39
To: Struts Users Mailing List
Subject: RE: can not reach the jsp file

well ... sorry for that , this is a wrong typing when I post this
question.
In my struts-config.xml , the slash is not missing.

I add log4J in my app to trace my code :

public class ShowDocsAct extends org.apache.struts.action.Action{
private Category _cat = Category.getInstance(this.getClass());
public ActionForward execute(ActionMapping mapping,
ActionForm form,
ServletRequest request,
ServletResponse response)
throws Exception{

   //print out this line in log file to prove the process has come
into this class
_cat.info(come into Action);

return mapping.findForward(success);
}
}

But I can not find the evidence that the process has come into this
Action class.
My struts-config.xml is as following :

action-mappings
action path=/Welcome forward=/welcomeStruts.jsp/
action path=/ShowDocs
type=com.kenhu.cdms.servlet.ShowDocsAct
forward name=success path=/showDocs.jsp /
/action
 /action-mappings

The URL that I ask my browser to browse is :
http://localhost:8080/cdms/ShowDocs.do

Help  !  what do I go wrong ?

Ken


於 四,2006-11-16 於 15:16 +,Lance Semmens 提到:
 I think you're missing a '/'
 forward name=success path=/showDocs.jsp /
 
 To keep your webapp a bit cleaner, perhaps consider
 forward name=success path=/WEB-INF/jsps/showDocs.jsp /
 
 -Original Message-
 From: Ken Hu [mailto:[EMAIL PROTECTED] 
 Sent: 16 November 2006 09:03
 To: user@struts.apache.org
 Subject: can not reach the jsp file
 
 Dear All:
 
 I'm doing a simple strus test, but all I can see after I try to visit
 ShowDocs.do is a blank page.
 
 struts-config.xml:
 action-mappings
 action path=/Welcome forward=/welcomeStruts.jsp/
 action path=/ShowDocs
 type=com.kenhu.cdms.servlet.ShowDocsAct
 forward name=success path=showDocs.jsp /
 /action
 /action-mappings
 
 My Action class:
 public ActionForward execute(ActionMapping mapping,
 ActionForm form,
 ServletRequest request,
 ServletResponse response)
 throws Exception{
 return mapping.findForward(success);
 }
 
 I can not find anything wrong , could someone please tell me what's
 going on here ?
 
 Thanks
-- 
研發部 胡重威 Ken Hu  [EMAIL PROTECTED]

孟華科技股份有限公司
http://www.mmti.com.tw

地址: 高雄市802苓雅區中正一路120號4F-7
電話: 07-7279337 分機: 120
傳真: 07-7279377
行動: 0937083880


-
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: can not reach the jsp file

2006-11-17 Thread Lance Semmens
 The URL that I ask my browser to browse is:
 http://localhost:8080/cdms/ShowDocs.do

Try hitting http://localhost:8080/ShowDocs.do
Or change your action mapping to
action path=/cdms/ShowDocs


think I might have it.
try action path=/ShowDocs

-Original Message-
From: Ken Hu [mailto:[EMAIL PROTECTED] 
Sent: 17 November 2006 10:40
To: Struts Users Mailing List
Subject: RE: can not reach the jsp file

No , I am using firefox.
I can see no exception or warning in log file(tomcat's log).
My platform is Tomcat 5.5 on Debian Linux, I develope and test my code
in Netbeans IDE.

Ken

於 五,2006-11-17 於 10:22 +,Lance Semmens 提到:
 hmm... are you using IE?
 You may need to turn off show friendly error messages in the options 
 somewhere. I'm thinking you've got a server error that IE is hiding from you. 
 Any errors in the log?
 
  -Original Message-
 From: Ken Hu [mailto:[EMAIL PROTECTED] 
 Sent: 17 November 2006 01:39
 To: Struts Users Mailing List
 Subject: RE: can not reach the jsp file
 
 well ... sorry for that , this is a wrong typing when I post this
 question.
 In my struts-config.xml , the slash is not missing.
 
 I add log4J in my app to trace my code :
 
 public class ShowDocsAct extends org.apache.struts.action.Action{
 private Category _cat = Category.getInstance(this.getClass());
 public ActionForward execute(ActionMapping mapping,
 ActionForm form,
 ServletRequest request,
 ServletResponse response)
 throws Exception{
 
//print out this line in log file to prove the process has come
 into this class
 _cat.info(come into Action);
 
 return mapping.findForward(success);
 }
 }
 
 But I can not find the evidence that the process has come into this
 Action class.
 My struts-config.xml is as following :
 
 action-mappings
 action path=/Welcome forward=/welcomeStruts.jsp/
 action path=/ShowDocs
 type=com.kenhu.cdms.servlet.ShowDocsAct
 forward name=success path=/showDocs.jsp /
 /action
  /action-mappings
 
 The URL that I ask my browser to browse is :
 http://localhost:8080/cdms/ShowDocs.do
 
 Help  !  what do I go wrong ?
 
 Ken
 
 
 於 四,2006-11-16 於 15:16 +,Lance Semmens 提到:
  I think you're missing a '/'
  forward name=success path=/showDocs.jsp /
  
  To keep your webapp a bit cleaner, perhaps consider
  forward name=success path=/WEB-INF/jsps/showDocs.jsp /
  
  -Original Message-
  From: Ken Hu [mailto:[EMAIL PROTECTED] 
  Sent: 16 November 2006 09:03
  To: user@struts.apache.org
  Subject: can not reach the jsp file
  
  Dear All:
  
  I'm doing a simple strus test, but all I can see after I try to visit
  ShowDocs.do is a blank page.
  
  struts-config.xml:
  action-mappings
  action path=/Welcome forward=/welcomeStruts.jsp/
  action path=/ShowDocs
  type=com.kenhu.cdms.servlet.ShowDocsAct
  forward name=success path=showDocs.jsp /
  /action
  /action-mappings
  
  My Action class:
  public ActionForward execute(ActionMapping mapping,
  ActionForm form,
  ServletRequest request,
  ServletResponse response)
  throws Exception{
  return mapping.findForward(success);
  }
  
  I can not find anything wrong , could someone please tell me what's
  going on here ?
  
  Thanks
-- 
研發部 胡重威 Ken Hu  [EMAIL PROTECTED]

孟華科技股份有限公司
http://www.mmti.com.tw

地址: 高雄市802苓雅區中正一路120號4F-7
電話: 07-7279337 分機: 120
傳真: 07-7279377
行動: 0937083880


-
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: can not reach the jsp file

2006-11-17 Thread Lance Semmens
scrap that idea... I was being a stupid head. cdms is your context path which 
it ok.

-Original Message-
From: Lance Semmens [mailto:[EMAIL PROTECTED] 
Sent: 17 November 2006 13:01
To: 'Struts Users Mailing List'
Subject: RE: can not reach the jsp file

 The URL that I ask my browser to browse is:
 http://localhost:8080/cdms/ShowDocs.do

Try hitting http://localhost:8080/ShowDocs.do
Or change your action mapping to
action path=/cdms/ShowDocs


think I might have it.
try action path=/ShowDocs

-Original Message-
From: Ken Hu [mailto:[EMAIL PROTECTED] 
Sent: 17 November 2006 10:40
To: Struts Users Mailing List
Subject: RE: can not reach the jsp file

No , I am using firefox.
I can see no exception or warning in log file(tomcat's log).
My platform is Tomcat 5.5 on Debian Linux, I develope and test my code
in Netbeans IDE.

Ken

於 五,2006-11-17 於 10:22 +,Lance Semmens 提到:
 hmm... are you using IE?
 You may need to turn off show friendly error messages in the options 
 somewhere. I'm thinking you've got a server error that IE is hiding from you. 
 Any errors in the log?
 
  -Original Message-
 From: Ken Hu [mailto:[EMAIL PROTECTED] 
 Sent: 17 November 2006 01:39
 To: Struts Users Mailing List
 Subject: RE: can not reach the jsp file
 
 well ... sorry for that , this is a wrong typing when I post this
 question.
 In my struts-config.xml , the slash is not missing.
 
 I add log4J in my app to trace my code :
 
 public class ShowDocsAct extends org.apache.struts.action.Action{
 private Category _cat = Category.getInstance(this.getClass());
 public ActionForward execute(ActionMapping mapping,
 ActionForm form,
 ServletRequest request,
 ServletResponse response)
 throws Exception{
 
//print out this line in log file to prove the process has come
 into this class
 _cat.info(come into Action);
 
 return mapping.findForward(success);
 }
 }
 
 But I can not find the evidence that the process has come into this
 Action class.
 My struts-config.xml is as following :
 
 action-mappings
 action path=/Welcome forward=/welcomeStruts.jsp/
 action path=/ShowDocs
 type=com.kenhu.cdms.servlet.ShowDocsAct
 forward name=success path=/showDocs.jsp /
 /action
  /action-mappings
 
 The URL that I ask my browser to browse is :
 http://localhost:8080/cdms/ShowDocs.do
 
 Help  !  what do I go wrong ?
 
 Ken
 
 
 於 四,2006-11-16 於 15:16 +,Lance Semmens 提到:
  I think you're missing a '/'
  forward name=success path=/showDocs.jsp /
  
  To keep your webapp a bit cleaner, perhaps consider
  forward name=success path=/WEB-INF/jsps/showDocs.jsp /
  
  -Original Message-
  From: Ken Hu [mailto:[EMAIL PROTECTED] 
  Sent: 16 November 2006 09:03
  To: user@struts.apache.org
  Subject: can not reach the jsp file
  
  Dear All:
  
  I'm doing a simple strus test, but all I can see after I try to visit
  ShowDocs.do is a blank page.
  
  struts-config.xml:
  action-mappings
  action path=/Welcome forward=/welcomeStruts.jsp/
  action path=/ShowDocs
  type=com.kenhu.cdms.servlet.ShowDocsAct
  forward name=success path=showDocs.jsp /
  /action
  /action-mappings
  
  My Action class:
  public ActionForward execute(ActionMapping mapping,
  ActionForm form,
  ServletRequest request,
  ServletResponse response)
  throws Exception{
  return mapping.findForward(success);
  }
  
  I can not find anything wrong , could someone please tell me what's
  going on here ?
  
  Thanks
-- 
研發部 胡重威 Ken Hu  [EMAIL PROTECTED]

孟華科技股份有限公司
http://www.mmti.com.tw

地址: 高雄市802苓雅區中正一路120號4F-7
電話: 07-7279337 分機: 120
傳真: 07-7279377
行動: 0937083880


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




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




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



RE: can not reach the jsp file

2006-11-16 Thread Lance Semmens
I think you're missing a '/'
forward name=success path=/showDocs.jsp /

To keep your webapp a bit cleaner, perhaps consider
forward name=success path=/WEB-INF/jsps/showDocs.jsp /

-Original Message-
From: Ken Hu [mailto:[EMAIL PROTECTED] 
Sent: 16 November 2006 09:03
To: user@struts.apache.org
Subject: can not reach the jsp file

Dear All:

I'm doing a simple strus test, but all I can see after I try to visit
ShowDocs.do is a blank page.

struts-config.xml:
action-mappings
action path=/Welcome forward=/welcomeStruts.jsp/
action path=/ShowDocs
type=com.kenhu.cdms.servlet.ShowDocsAct
forward name=success path=showDocs.jsp /
/action
/action-mappings

My Action class:
public ActionForward execute(ActionMapping mapping,
ActionForm form,
ServletRequest request,
ServletResponse response)
throws Exception{
return mapping.findForward(success);
}

I can not find anything wrong , could someone please tell me what's
going on here ?

Thanks
-- 
研發部 胡重威 Ken Hu  [EMAIL PROTECTED]

孟華科技股份有限公司
http://www.mmti.com.tw

地址: 高雄市802苓雅區中正一路120號4F-7
電話: 07-7279337 分機: 120
傳真: 07-7279377
行動: 0937083880


-
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: Dynamically adding row!

2006-11-15 Thread Lance Semmens
I realize your field names have to comply with the struts naming (ie so that 
BeanUtils.setProperty() will work. But if your form has a collection that you 
are adding a record to, struts will not create a new record, add it to your 
form's collection then set the properties on it. 

Once you do the create and add, struts will then do the populate. That's why I 
suggested the ajax call to add the record to the server side struts form so 
that the subsequent post will populate the fields.

-Original Message-
From: Ed Griebel [mailto:[EMAIL PROTECTED] 
Sent: 14 November 2006 14:24
To: Struts Users Mailing List
Subject: Re: Dynamically adding row!

You can have a form auto-populate from the javascript-generated
fields, you just need to be careful what you call the generated field
names. It will be hard-coded and none too attractive, but it will
work. Look at the rendered HTML to see what format the field names are
as an example.

HTH,
-ed

On 11/14/06, Lance Semmens [EMAIL PROTECTED] wrote:
 The least messy way is to post to an addRecord action which adds a blank 
 record to your form. Form must be in session scope. This requires a page 
 redraw so is less responsive but this is the approach I often use.

 If you add a row to your table using javascript, struts will not 
 automatically populate your form with the new record(s) upon save so you will 
 need to handle this in your action. Unless of course you use ajax (which you 
 have said you don't want to do) to add the record to your struts form on the 
 server.

 Display tags will work for both suggestions. The javascript option usually 
 involves cloning an existing row and blanking out the fields.

 Lance.

 -Original Message-
 From: Balwinder [mailto:[EMAIL PROTECTED]
 Sent: 14 November 2006 10:05
 To: Struts Users Mailing List
 Subject: Dynamically adding row!

 Hi All!

 I am trying to add a row in a table dynamically to add new record in
 Struts web application.

 Iam using struts 1.1 and need to implement non-Ajax solution.

 Will display tags has solution to this situation?

 Any help  will be appreciated.

 Thanks and Regards,
 Balwinder Kumar

 -
 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]



RE: Dynamically adding row!

2006-11-15 Thread Lance Semmens
I realize your field names have to comply with the struts naming (ie so that 
BeanUtils.setProperty() will work. But if your form has a collection that you 
are adding a record to, struts will not create a new record, add it to your 
form's collection then set the properties on it. 

Once you do the create and add, struts will then do the populate. That's why I 
suggested the ajax call to add the record to the server side struts form so 
that the subsequent post will populate the fields.

-Original Message-
From: Ed Griebel [mailto:[EMAIL PROTECTED] 
Sent: 14 November 2006 14:24
To: Struts Users Mailing List
Subject: Re: Dynamically adding row!

You can have a form auto-populate from the javascript-generated
fields, you just need to be careful what you call the generated field
names. It will be hard-coded and none too attractive, but it will
work. Look at the rendered HTML to see what format the field names are
as an example.

HTH,
-ed

On 11/14/06, Lance Semmens [EMAIL PROTECTED] wrote:
 The least messy way is to post to an addRecord action which adds a blank 
 record to your form. Form must be in session scope. This requires a page 
 redraw so is less responsive but this is the approach I often use.

 If you add a row to your table using javascript, struts will not 
 automatically populate your form with the new record(s) upon save so you will 
 need to handle this in your action. Unless of course you use ajax (which you 
 have said you don't want to do) to add the record to your struts form on the 
 server.

 Display tags will work for both suggestions. The javascript option usually 
 involves cloning an existing row and blanking out the fields.

 Lance.

 -Original Message-
 From: Balwinder [mailto:[EMAIL PROTECTED]
 Sent: 14 November 2006 10:05
 To: Struts Users Mailing List
 Subject: Dynamically adding row!

 Hi All!

 I am trying to add a row in a table dynamically to add new record in
 Struts web application.

 Iam using struts 1.1 and need to implement non-Ajax solution.

 Will display tags has solution to this situation?

 Any help  will be appreciated.

 Thanks and Regards,
 Balwinder Kumar

 -
 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]



RE: Dynamically adding row!

2006-11-15 Thread Lance Semmens
Ah. gotcha. I use my own custom formBeans so don't get this nifty little trick.

-Original Message-
From: Ed Griebel [mailto:[EMAIL PROTECTED] 
Sent: 15 November 2006 14:48
To: Struts Users Mailing List
Subject: Re: Dynamically adding row!

It's worked for me using a LazyDynaBean as the formbean and
java.util.Map as the contained object for a given property, and the
framework does populate new records into the contained map for me.

-ed

On 11/15/06, Lance Semmens [EMAIL PROTECTED] wrote:
 I realize your field names have to comply with the struts naming (ie so that 
 BeanUtils.setProperty() will work. But if your form has a collection that you 
 are adding a record to, struts will not create a new record, add it to your 
 form's collection then set the properties on it.

 Once you do the create and add, struts will then do the populate. That's why 
 I suggested the ajax call to add the record to the server side struts form so 
 that the subsequent post will populate the fields.

 -Original Message-
 From: Ed Griebel [mailto:[EMAIL PROTECTED]
 Sent: 14 November 2006 14:24
 To: Struts Users Mailing List
 Subject: Re: Dynamically adding row!

 You can have a form auto-populate from the javascript-generated
 fields, you just need to be careful what you call the generated field
 names. It will be hard-coded and none too attractive, but it will
 work. Look at the rendered HTML to see what format the field names are
 as an example.

 HTH,
 -ed

 On 11/14/06, Lance Semmens [EMAIL PROTECTED] wrote:
  The least messy way is to post to an addRecord action which adds a blank 
  record to your form. Form must be in session scope. This requires a page 
  redraw so is less responsive but this is the approach I often use.
 
  If you add a row to your table using javascript, struts will not 
  automatically populate your form with the new record(s) upon save so you 
  will need to handle this in your action. Unless of course you use ajax 
  (which you have said you don't want to do) to add the record to your struts 
  form on the server.
 
  Display tags will work for both suggestions. The javascript option usually 
  involves cloning an existing row and blanking out the fields.
 
  Lance.
 
  -Original Message-
  From: Balwinder [mailto:[EMAIL PROTECTED]
  Sent: 14 November 2006 10:05
  To: Struts Users Mailing List
  Subject: Dynamically adding row!
 
  Hi All!
 
  I am trying to add a row in a table dynamically to add new record in
  Struts web application.
 
  Iam using struts 1.1 and need to implement non-Ajax solution.
 
  Will display tags has solution to this situation?
 
  Any help  will be appreciated.
 
  Thanks and Regards,
  Balwinder Kumar
 
  -
  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]



-
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: Dynamically adding row!

2006-11-14 Thread Lance Semmens
The least messy way is to post to an addRecord action which adds a blank record 
to your form. Form must be in session scope. This requires a page redraw so is 
less responsive but this is the approach I often use.

If you add a row to your table using javascript, struts will not automatically 
populate your form with the new record(s) upon save so you will need to handle 
this in your action. Unless of course you use ajax (which you have said you 
don't want to do) to add the record to your struts form on the server. 

Display tags will work for both suggestions. The javascript option usually 
involves cloning an existing row and blanking out the fields. 

Lance.

-Original Message-
From: Balwinder [mailto:[EMAIL PROTECTED] 
Sent: 14 November 2006 10:05
To: Struts Users Mailing List
Subject: Dynamically adding row!

Hi All!

I am trying to add a row in a table dynamically to add new record in 
Struts web application.

Iam using struts 1.1 and need to implement non-Ajax solution.

Will display tags has solution to this situation?

Any help  will be appreciated.

Thanks and Regards,
Balwinder Kumar

-
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: RE: [HELP] struts 1.2.9 multibox/checkbox in session scoped form

2006-11-14 Thread Lance Semmens
The only thing I can think is maybe you're explicitly calling reset() in your 
action (instead of letting struts do it automatically). If not, I suggest 
putting a debug breakpoint on the setters for your checkboxes and see what's 
going on.
 
-Original Message-
From: Garner Shawn [mailto:[EMAIL PROTECTED] 
Sent: 13 November 2006 20:19
To: user@struts.apache.org
Subject: RE: RE: [HELP] struts 1.2.9 multibox/checkbox in session scoped form

1. Yes
2. Yes
3  In ActionForm.reset

If I comment out my reset method then it populates the checkboxes
based on the form values like I want however I then loose the ability
to only get the checked value put into my action form after the page
is submitted.



From: Lance Semmens [EMAIL PROTECTED]
To: 'Struts Users Mailing List' user@struts.apache.org
Date: Mon, 13 Nov 2006 17:08:00 +
Subject: RE: [HELP] struts 1.2.9 multibox/checkbox in session scoped form
A couple of things to check
1. Is your get action using the same form as your post action?
2. Do the names of the checkboxes in the html match your form?
3. Where are you resetting the checkboxes? I'm hoping you're doing it
by overriding ActionForm.reset().

-
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: how to add edit/add/delete functionality

2006-11-14 Thread Lance Semmens
I found this by googling struts crud
http://www.learntechnology.net/struts-crud.do 

-Original Message-
From: santas [mailto:[EMAIL PROTECTED] 
Sent: 14 November 2006 12:03
To: user@struts.apache.org
Subject: how to add edit/add/delete functionality


Hi all
i am new to struts
can anybody give me any idea for addind 
add/edit/delete functionality in a struts application

it will be great if i can get the flow 


thank you

-- 
View this message in context: 
http://www.nabble.com/how-to-add-edit-add-delete-functionality-tf2629040.html#a7336292
Sent from the Struts - User mailing list archive at Nabble.com.


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




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



RE: setInput method of ActionMapping

2006-11-14 Thread Lance Semmens
A possible solution might be to 
1. Set validate=false for your action.
2. Configure forwards for each of your error pages
2. Explicitly call form.validate() in your action 
3. Call saveErrors() if validation fails
4. Redirect to the appropriate forward

Lance.

-Original Message-
From: Nuwan Chandrasoma [mailto:[EMAIL PROTECTED] 
Sent: 14 November 2006 11:41
To: Struts Users Mailing List
Subject: Re: setInput method of ActionMapping

As for my understanding this cantnot be set after the struts-config is 
loaded.,


- Original Message - 
From: chamal desilva [EMAIL PROTECTED]
To: user@struts.apache.org
Sent: Tuesday, November 14, 2006 7:37 AM
Subject: setInput method of ActionMapping


 Hi,


 I want to call

 mapping .setInput() method inside my validate method
 of a form bean.

 But it throws an Exception.

 
 java.lang.IllegalStateException: Configuration is
 frozen at
 org.apache.struts.config.ActionConfig.setInput(ActionC
 

 Please help me to correct this issue.

 Thanking You,
 Chamal.



 
 Do you Yahoo!?
 Everyone is raving about the all-new Yahoo! Mail beta.
 http://new.mail.yahoo.com

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


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




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



RE: Validation + multiple Submit buttons

2006-11-14 Thread Lance Semmens
A JS free application? You can assume today's browsers have javascript, the web 
would break otherwise. Sure there are some cross platform issues but to go JS 
free is a tall order and will limit you to a clunky UI.

If JS free is your direction, you could wrap your back button in a html:form 
that posts to a different action to your save.

Lance.

-Original Message-
From: Andrew Martin [mailto:[EMAIL PROTECTED] 
Sent: 14 November 2006 13:36
To: Struts Users Mailing List
Subject: Validation + multiple Submit buttons

Hi,

I have just begun to add validation to my forms using struts validator, which 
is quite nice. I have however a problem when I have more than one submit button 
on a form.

For example I have a Save button and a Back button.
The Back button is also a submit (instead of a standard button - basically 
because we are creating a JS free applciation!)

Within the struts configuration the validate is set to true for this action 
with an input page defined.
The validation is set to check certain fields are not empty.

As both buttons call the same action the validation is called on both, but I do 
not want validation to occur on certain submit actions (namely the Back button)

Ideally I would like to configure this in the XML Struts-config.xml or 
validation.xml but I am not sure if this is actually possible (I fear the worst)

If anyone has any tips, much appreciated.

Andrew



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



RE: [HELP] struts 1.2.9 multibox/checkbox in session scoped form

2006-11-13 Thread Lance Semmens
A couple of things to check
1. Is your get action using the same form as your post action?
2. Do the names of the checkboxes in the html match your form?
3. Where are you resetting the checkboxes? I'm hoping you're doing it by 
overriding ActionForm.reset().

-Original Message-
From: Garner Shawn [mailto:[EMAIL PROTECTED] 
Sent: 13 November 2006 16:47
To: user@struts.apache.org
Subject: [HELP] struts 1.2.9 multibox/checkbox in session scoped form

I reset my checkboxes and a multibox in a form reset method but then
when I come back to the page the values arn't checked.
If I don't reset them then it won't register them as not checked anymore.

How do I fix this?

Shawn

-
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]



html:form without writing a form in the resultant HTML

2006-11-10 Thread Lance Semmens
Hi, I'm wanting to use the struts tags to render my inputs. The only problem is 
that my JSP page only draws a small section of the form (perhaps a single 
select) and is called via AJAX. So, I have 2 questions:

1. Can I use struts tags (eg html:select) without wrapping them in an 
html:form (I'm pretty sure the answer is no).

2. Can I wrap my tags in html:form but somehow not output form to the 
resultant HTML.

I was hoping for a render=false or similar. eg:

html:form action=/myAction render=false
html:select property=year
html:options collection=years /
/html:select
/html:form

Any other suggestions welcome.

Thanks,
Lance.




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



RE: html:form without writing a form in the resultant HTML

2006-11-10 Thread Lance Semmens
That worked a treat... thanks for the quick response.
I did a quick check with html:text / and html:checkbox / and the *hack* 
seems to work there too.

-Original Message-
From: Wendy Smoak [mailto:[EMAIL PROTECTED] 
Sent: 10 November 2006 17:08
To: Struts Users Mailing List
Subject: Re: html:form without writing a form in the resultant HTML

On 11/10/06, Lance Semmens [EMAIL PROTECTED] wrote:
 1. Can I use struts tags (eg html:select) without wrapping them in an 
 html:form (I'm pretty sure the answer is no).

 2. Can I wrap my tags in html:form but somehow not output form to the 
 resultant HTML.

 I was hoping for a render=false or similar. eg:

 html:form action=/myAction render=false
 html:select property=year
 html:options collection=years /
 /html:select
 /html:form

 Any other suggestions welcome.

Officially... http://struts.apache.org/1.x/struts-taglib/tlddoc/html/select.html

This tag is only valid when nested inside a form tag body.

What happens if you leave off html:form and use the 'name' attribute
of the select tag?  If the form bean (or some other bean) is in scope,
it might work.  I'd also review the code for the select tag and see
what else it expects to get from the enclosing form tag.

'name' - The attribute name of the bean whose properties are consulted
to determine which option should be pre-selected when rendering this
input field. If not specified, the bean associated with the enclosing
html:form tag is utilized.

-- 
Wendy

-
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: How to make dropdown box editable.

2006-11-06 Thread Lance Semmens
Dojo has a control that sounds like what you're after.

http://dojotoolkit.org/

go to:
see it in action -- form widgets -- form tour and look at the state field.

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
Sent: 26 October 2006 14:30
To: user@struts.apache.org
Subject: How to make dropdown box editable.


Hi all,


I have requirement where in I want drop down box to be editable. Is this
possible using struts html tag lib.
Please let me know how to go about making drop down box editable.


Regards,
Vinodh













The information contained in this electronic message and any attachments to 
this message are intended for the exclusive use of the addressee(s) and may 
contain proprietary, confidential or privileged information. If you are not the 
intended recipient, you should not disseminate, distribute or copy this e-mail. 
Please notify the sender immediately and destroy all copies of this message and 
any attachments.


WARNING: Computer viruses can be transmitted via email. The recipient should 
check this email and any attachments for the presence of viruses. The company 
accepts no liability for any damage caused by any virus transmitted by this 
email.


www.wipro.com



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



RE: [OT] Identify file type

2006-11-03 Thread Lance Semmens
On your upload form, your property that maps to your file upload input should 
be of type org.apache.struts.upload.FormFile. Then save the FormFile 
.getFileData() and FormFile.getContentType() to the database.

-Original Message-
From: Vijay Venkataraman [mailto:[EMAIL PROTECTED] 
Sent: 03 November 2006 09:11
To: Struts Users Mailing List
Subject: [OT] Identify file type

Hi,
I have requirement where uploaded files exists in database as blobs. Now 
i need to retrieve the file and push this to the browser.
I have no clue as to what the file type is. So i am not in a position to 
set the content type clearly. Does any one know of a utility which can 
identify the file type?

Thanks,
Vijay Venkataraman

-
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: [OT] Identify file type

2006-11-03 Thread Lance Semmens
On your upload form, your property that maps to your file upload input should 
be of type org.apache.struts.upload.FormFile. Then save the FormFile 
.getFileData() and FormFile.getContentType() to the database.

-Original Message-
From: Vijay Venkataraman [mailto:[EMAIL PROTECTED] 
Sent: 03 November 2006 09:11
To: Struts Users Mailing List
Subject: [OT] Identify file type

Hi,
I have requirement where uploaded files exists in database as blobs. Now 
i need to retrieve the file and push this to the browser.
I have no clue as to what the file type is. So i am not in a position to 
set the content type clearly. Does any one know of a utility which can 
identify the file type?

Thanks,
Vijay Venkataraman

-
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: Accessing LazyValidatorForm properties with EL

2006-06-23 Thread Lance Semmens

Use LazyDynaForm.getMap()
eg ${myForm.map.myProperty}

Scott Van Wart wrote:
I have a class MyForm extends LazyValidatorForm, mapped with name 
myForm to myAction:


html:form action=/myAction

 ${myForm.myProperty}

/html:form

The EL fails with a complaint about accessing myProperty of bean 
myForm (since there's no getMyProperty() accessor).  How can I access 
properties with EL?


I have

jsp:useBean id=myBean class=mypkg.MyBean scope=request
 jsp:setProperty name=myBean property=myProperty 
value=${myForm.myProperty} /

/jsp:useBean

But naturally, this fails as well.

Thanks,
 Scott

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




--
Lance Semmens
Marketpipe Limited
a. 7 Soho Square, London W1D 3QB, UK
t. +44 20 7297 8401
f. +44 20 7297 8427
e. [EMAIL PROTECTED]
w. www.marketpipe.com 




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



Re: Accessing LazyValidatorForm properties with EL

2006-06-23 Thread Lance Semmens

Here's a better solution:
Extend LazyValidatorForm to implement java.util.Map (perhaps  
/docs/api/org/apache/struts/validator/index.htmlBeanValidatorForm, 
which LazyValidatorForm extends from, should do this?)

Then you could access ${myForm.myProperty} in the JSTL.

Lance Semmens wrote:

Use LazyDynaForm.getMap()
eg ${myForm.map.myProperty}

Scott Van Wart wrote:
I have a class MyForm extends LazyValidatorForm, mapped with name 
myForm to myAction:


html:form action=/myAction

 ${myForm.myProperty}

/html:form

The EL fails with a complaint about accessing myProperty of bean 
myForm (since there's no getMyProperty() accessor).  How can I access 
properties with EL?


I have

jsp:useBean id=myBean class=mypkg.MyBean scope=request
 jsp:setProperty name=myBean property=myProperty 
value=${myForm.myProperty} /

/jsp:useBean

But naturally, this fails as well.

Thanks,
 Scott

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







--
Lance Semmens
Marketpipe Limited
a. 7 Soho Square, London W1D 3QB, UK
t. +44 20 7297 8401
f. +44 20 7297 8427
e. [EMAIL PROTECTED]
w. www.marketpipe.com 



Re: How to call a method from struts tag

2006-06-23 Thread Lance Semmens
Can you do this in you action then have an isEnabled() method on your 
component?


Pankaj Gupta wrote:

Hi All,

I want to call a method of an object in session scope that would check 
whether the component I wish to display on my JSP should be enabled or 
disabled. Can you please suggest how I can do that without using java 
scriptlets in my JSP.


regards,
Pankaj

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




--
Lance Semmens
Marketpipe Limited
a. 7 Soho Square, London W1D 3QB, UK
t. +44 20 7297 8401
f. +44 20 7297 8427
e. [EMAIL PROTECTED]
w. www.marketpipe.com 




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



Re: Request parameters in action forward

2006-06-21 Thread Lance Semmens

You can use an org.apache.struts.action.ActionRedirect

ActionForward forward = mapping.findForward(reload);
ActionRedirect redirect = new ActionRedirect(forward);
redirect.addParameter(id, idValue);
return redirect;


Antonis Lebesis wrote:

Hi,
 I do have a SelectFooAction (actually it's called ChooseFooAction
:)). There is another problem though:
 This action is used in more than one places so I have to add a
parameter called action in it's url (action=display for a simple user,
action=edit for the admin etc). Since I have a lot of foo's, I have a
form in this page to select which category of Foo's to display. When
the user selects  a category, the page is reloaded (through another
reload mapping) which leads us from selectFoo.do?action=display to
selectFoo.do.
 Do you see a pattern here ;)?

Antonis

On 6/21/06, Monkeyden [EMAIL PROTECTED] wrote:

The only thing that I
can think of is to redirect the user to a different (perhaps error)

exactly, send them back to wherever they go to select the foo they 
want to

look at.  Do you have a SelectFooAction?


On 6/20/06, Antonis Lebesis [EMAIL PROTECTED] wrote:

 Thank you Don.
 I have done that and the session expiry problem is solved. The
 bookmark problem still exists though...
 There is a way to overcome this as well:

   ActionForward forward = new ActionForward();
   forward.setPath(mapping.findForward(reload).getPath() + id=23);

 which redirects to http://my.foo.site/loadFoo.doid=23 , but this is
 a hack I wouldn't like to use (plus I would have to change the code
 for ~60 classes many of which are DispatchActions: a lot of work
 :))...

 Antonis


 On 6/20/06, Don Vawter [EMAIL PROTECTED] wrote:
  Can you take the request parameter and populate a hidden form field
  with it? Mixing request params with form fields
  has caused me grief more than once.
 
  On Jun 19, 2006, at 7:34 PM, Antonis Lebesis wrote:
 
   Hello,
I have a jsp (foo.jsp) that displays information about a certain
   foo. I have defined a LoadFooAction, that prepares the foo 
object and

   the SubmitFooAction, that is called when I want to change the
   appearance of foo in foo.jsp [suppose that foo is a list of 
bars and

   that I want to change the order of bars (by name, by date etc)].
  
In struts-config.xml I have defined the following:
action path=/loadFoo type=LoadFooAction name=FooForm
  forward name=success path=/foo.jsp/
/action
action path=/submitFoo type=SubmitFoo name=FooForm
  forward name=reload path=/loadFoo.do redirect=true/
/action
  
In order to identify which foo to load, I have added a 
parameter in

   loadFoo, called id, ie
  http://my.foo.site/loadFoo.doid=23
  
The problem is that when I press submit in foo.jsp, the execute
   method in SubmitFooAction redirects the browser to
   http://my.foo.site/loadFoo.do, loosing the id parameter from 
the url.
   I can store either foo or id=23 to session and retrieve them 
from
   there when the id parameter is not present, but what happens 
when the
   session expires and the user presses refresh or if the user 
decides to
   bookmark the page? I end up with a loadFoo.do without any 
information

   about which foo to display.
  
Has any of you dealt with this problem before? The only thing 
that I
   can think of is to redirect the user to a different (perhaps 
error)
   page when no info is available, but I would really like to be 
able to

   do something better than that.
  
   Thanks in advance,
   Antonis
  
   PS. I know it's long, but it's 4:30 in the morning (EEST)...
  
   
-

   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]




--
Lance Semmens
Marketpipe Limited
a. 7 Soho Square, London W1D 3QB, UK
t. +44 20 7297 8401
f. +44 20 7297 8427
e. [EMAIL PROTECTED]
w. www.marketpipe.com 



Validator rules not loaded

2006-05-02 Thread Lance Semmens
Struts is not loading validator rules if the validator dtd can not be 
retrieved.

On app server startup, the following is reported:

2006-04-29 16:18:23,420 ERROR 
[org.apache.struts.validator.ValidatorPlugIn] jakarta.apache.org

java.net.UnknownHostException: jakarta.apache.org
   at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:177)
   at java.net.Socket.connect(Socket.java:507)
   at java.net.Socket.connect(Socket.java:457)*
   :
   :

*Im assuming that this is exception occurs trying to retrieve 
http://jakarta.apache.org/commons/dtds/validator_1_1.dtd
After this, my app works fine except there are now no rules being 
applied to my forms which poses a *slight* security issue.

**

--
Lance Semmens
Marketpipe Limited
a. 7 Soho Square, London W1D 3QB, UK
t. +44 20 7297 8401
f. +44 20 7297 8427
e. [EMAIL PROTECTED]
w. www.marketpipe.com 



Re: Validator rules not loaded

2006-05-02 Thread Lance Semmens
Thanks, I had thought of this workaround too. I just wanted to highlight 
the potential security issue when the validator rules fail to load.


Vinit Sharma wrote:

Hi,

You can store the dtd file on you local dir and refer its path from the
rules xml file.

HTH

On 5/2/06, Lance Semmens [EMAIL PROTECTED] wrote:


Struts is not loading validator rules if the validator dtd can not be
retrieved.
On app server startup, the following is reported:

2006-04-29 16:18:23,420 ERROR
[org.apache.struts.validator.ValidatorPlugIn] jakarta.apache.org
java.net.UnknownHostException: jakarta.apache.org
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:177)
at java.net.Socket.connect(Socket.java:507)
at java.net.Socket.connect(Socket.java:457)*
:
:

*Im assuming that this is exception occurs trying to retrieve
http://jakarta.apache.org/commons/dtds/validator_1_1.dtd
After this, my app works fine except there are now no rules being
applied to my forms which poses a *slight* security issue.
**

--
Lance Semmens
Marketpipe Limited
a. 7 Soho Square, London W1D 3QB, UK
t. +44 20 7297 8401
f. +44 20 7297 8427
e. [EMAIL PROTECTED]
w. www.marketpipe.com






--
Vinit Sharma
IBM




--
Lance Semmens
Marketpipe Limited
a. 7 Soho Square, London W1D 3QB, UK
t. +44 20 7297 8401
f. +44 20 7297 8427
e. [EMAIL PROTECTED]
w. www.marketpipe.com 




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



Collection display / save

2005-08-15 Thread Lance Semmens
I'm wanting to display a page with rows (1 for each bean in a
collection) with input fields that are saved on submit.

I'm pretty new to struts but have a rough idea of what should happen:
Display Action
  1. Create the ActionForm
  2. Populate form collection (database)
  3. Save form on session
  4. JSP displays form (any advice here would be nice)

Save Action
  1. Lookup ActionForm from session
  2. Struts magic overrides properties with user input
  3. Save rows (database)

Since I want to start with a fresh form in my display action, how should
I configure the scope of the ActionForm (struts-config.xml)?
Should I have my scope set to session for both actions or should I use
a request scope in my display action and explicitly put the form on
the session here?
Does anyone have any good tutorials for displaying / populating
collections?

Thanks in advance,
Lance.




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



Modularizing struts-config.xml

2005-08-12 Thread Lance Semmens
Is there any way to break up struts-config.xml into multiple xml files?
I'd like to be able to logically group my form and action mappings in
separate files.


Lance Semmens
Software Engineer

Swebtec
12 Hurlingham Business Park
Sulivan Road
London SW6 3DU
Tel: 0207 471 8121
www.swebtec.com http://www.swebtec.com/  




Actions forwarding to actions

2005-07-26 Thread Lance Semmens
I'm a newbie to struts and I'm maintaining what I consider to be
spaghetti code.
There actions which forward to other actions and I'm getting lost a bit
lost at times.
As a rule, should an action be all encompassing and therefore not need
to forward to another action?

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



Invalid dates / numbers etc on forms

2005-07-13 Thread Lance Semmens
Is there a standard way of handling invalid user input in date / number
fields etc. I can forsee 2 possible solutions.
1. Declare date properties on your form as java.lang.Strings and
validate / parse them explicitely.
2. Declare date properties as java.util.Dates, have struts parse dates,
check for null form properties and use request.getParameter() to see if
an invalid date was entered.
 
I prefer option 2. Are there any libraries around to do this generically
or another way that I haven't thought of? (NB i'm a newbie).
 
Thanks,
Lance.