Re: issue with logic:present on JDK 1.4.2

2005-10-21 Thread Shyam Anand
I figured that it's not a JDK issue and it is an
application server issue. I use OC4J (Oracle IAS) and
I'm upgrading from a version that supports JSP 1.1 to
the one that is certified for JSP 1.2.
So, could this be a JSP 1.1 - 1.2 compatibility issue?

The JSP Compiler of the OC4J container doesn't seem to
recognize the bean:define tags embedded inside Struts
logic tags. 

See JSP code snippet below:

logic:present name=userRequest scope=session

bean:define id=userRequest name=userRequest
scope=session type=dsap.business.UserRequest/
bean:define id=employee name=userRequest
property=employee type=dsap.business.Employee /
bean:define id=userModuleList name=userRequest
property=userModuleList /

/logic:present

And I get an error message when I access the
userRequest bean's properties in my JSP:

eg.
html:text name=formBean property=reqType
value=%=userRequest.getReqType()% /

Error:
JspServlet: unable to dispatch to requested page:
oracle.jsp.provider.JspCompileException: Errors
compiling:[jsp src:line #:133] cannot resolve symbol:
variable userRequest 

Any idea on what could be wrong here? Is there any
workaround for this?

I would not want to use JSTL as I have some time
constraints.

Any help will be greatly appreciated.

Thanks,
Shyam


--- Dave Newton [EMAIL PROTECTED] wrote:

 Shyam Anand wrote:
 
 I have issues with struts-logic tags...I'm not
 using JSTL.
   
 
 Whoops.
 
 I'm running 1.4.2 w/o any struts tag issues
 (including 'logic'). 
 (Tomcat, WinXP, 1.4.2_08)
 
 Why not switch to JSTL anyway, though?
 
 Dave
 
 
 

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




__ 
Yahoo! FareChase: Search multiple travel sites in one click.
http://farechase.yahoo.com

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



Re: issue with logic:present on JDK 1.4.2

2005-10-21 Thread Shyam Anand
Laurie,

Thanks for your reply.I'm not sure if I understand you
clearly.I have used bean:define inside the
logic:present tag as seen in the code snippet.This is
supposed to define a scripting variable named by the
id attribute as described in the Struts docs:

Create a new attribute (in the scope specified by the
toScope property, if any), and a corresponding
scripting variable, both of which are named by the
value of the id attribute

http://struts.apache.org/struts-taglib/tagreference-struts-bean.html

The issue I have is that the scripting variable
userRequest is not created by the bean:define tag
inside the logic:present tag.

Instead userRequest is created as a pageContext
attribute. So, if I use the scriptlet below to access
the pageContext attributes, my code works:

-
% dsap.business.UserRequest userRequest =
(dsap.business.UserRequest)pageContext.getAttribute(userRequest);
%
% dsap.business.Employee employee =
(dsap.business.Employee)pageContext.getAttribute(employee);
%

html:text name=formBean property=reqType
 value=%=userRequest.getReqType()% /
--

Anyway, the same code (bean:define embedded inside
logic tags) used to work perfectly with the previous
version of my server (JSP 1.1).So, I'm puzzled why it
doesn't work with the latest version of my server -
OC4J 9.0.4 (JSP 1.2).

Could this be some JSP 1.1 - 1.2 compatibility issue?

Shyam

--- Laurie Harper [EMAIL PROTECTED] wrote:

 You're checking whether userRequest exists as a
 session attribute, then 
 trying to access it as a scripting variable. The one
 doesn't imply you 
 can do the other. If you need to access userRequest
 from scriptlets, 
 you'll need to use bean:define/ to create the
 scripting variable or 
 lookup the bean in the session in your scriptlet:
 
   

%=session.getAttribute(userRequest).getReqType()%
 
 L.
 
 Shyam Anand wrote:
  I figured that it's not a JDK issue and it is an
  application server issue. I use OC4J (Oracle IAS)
 and
  I'm upgrading from a version that supports JSP 1.1
 to
  the one that is certified for JSP 1.2.
  So, could this be a JSP 1.1 - 1.2 compatibility
 issue?
  
  The JSP Compiler of the OC4J container doesn't
 seem to
  recognize the bean:define tags embedded inside
 Struts
  logic tags. 
  
  See JSP code snippet below:
  
  logic:present name=userRequest scope=session
  
  bean:define id=userRequest name=userRequest
  scope=session type=dsap.business.UserRequest/
  bean:define id=employee name=userRequest
  property=employee type=dsap.business.Employee
 /
  bean:define id=userModuleList
 name=userRequest
  property=userModuleList /
  
  /logic:present
  
  And I get an error message when I access the
  userRequest bean's properties in my JSP:
  
  eg.
  html:text name=formBean property=reqType
  value=%=userRequest.getReqType()% /
  
  Error:
  JspServlet: unable to dispatch to requested page:
  oracle.jsp.provider.JspCompileException: Errors
  compiling:[jsp src:line #:133] cannot resolve
 symbol:
  variable userRequest 
  
  Any idea on what could be wrong here? Is there any
  workaround for this?
  
  I would not want to use JSTL as I have some time
  constraints.
  
  Any help will be greatly appreciated.
  
  Thanks,
  Shyam
  
  
  --- Dave Newton [EMAIL PROTECTED] wrote:
  
  
 Shyam Anand wrote:
 
 
 I have issues with struts-logic tags...I'm not
 
 using JSTL.
 
  
 
 
 Whoops.
 
 I'm running 1.4.2 w/o any struts tag issues
 (including 'logic'). 
 (Tomcat, WinXP, 1.4.2_08)
 
 Why not switch to JSTL anyway, though?
 
 Dave
 
 
 
 
  
 

-
  
 To unsubscribe, e-mail:
 [EMAIL PROTECTED]
 For additional commands, e-mail:
 [EMAIL PROTECTED]
 
 
  
  
  
  
  
  __ 
  Yahoo! FareChase: Search multiple travel sites in
 one click.
  http://farechase.yahoo.com
 
 

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




__ 
Yahoo! FareChase: Search multiple travel sites in one click.
http://farechase.yahoo.com

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



issue with logic:present on JDK 1.4.2

2005-10-19 Thread Shyam Anand
Hi,

I'm doing an upgrade from JDK 1.3.1 to JDK 1.4.2 for
my Struts 1.1 applications. I have an issue with the
logic:present tags. These don't seem to work with
JDK 1.4.2 version.
I'm using OC4J 9.0.4 as my application server.

For the JSP code snippet shown below , I get an error
message:

quote:
JspServlet: unable to dispatch to requested page:
oracle.jsp.provider.JspCompileException: H3Errors
compiling:[jsp src:line #:133]br cannot resolve
symbol: variable userRequest 

unquote:


###
logic:present name=userRequest scope=session

bean:define id=userRequest name=userRequest
scope=session type=dsap.business.UserRequest/
bean:define id=employee name=userRequest
property=employee type=dsap.business.Employee /
bean:define id=userModuleList name=userRequest
property=userModuleList /

/logic:present
###


This used to work well with JDK 1.3.1.

Could somebody suggest a solution or a workaround ? I
would not want to use JSTL.

Any help will be greatly appreciated.

Thanks,
Shyam



__ 
Yahoo! Music Unlimited 
Access over 1 million songs. Try it free.
http://music.yahoo.com/unlimited/

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



Re: issue with logic:present on JDK 1.4.2

2005-10-19 Thread Shyam Anand
I have issues with struts-logic tags...I'm not using
JSTL.

Shyam

--- Dave Newton [EMAIL PROTECTED] wrote:

 Shyam Anand wrote:
 
 These don't seem to work with JDK 1.4.2 version.
   
 
 I'm running 1.4.2 w/o any JSTL issues. (Tomcat,
 WinXP, 1.4.2_08)
 
 Dave
 
 
 

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




__ 
Start your day with Yahoo! - Make it your home page! 
http://www.yahoo.com/r/hs

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



Issue with indexed properties

2005-08-08 Thread Shyam Anand
Hi,

I'm using indexed properties to display an array of
radio buttons in my Struts 1.1 web application. 

I get an exception shown below when I use request
scope for my form bean but things work fine with
session scope. 

Could somebody tell me what I'm doing wrong. Is there
a way to make this work with request scope.

Any help will be greatly appreciated.

Thanks,
Shyam


java.lang.reflect.InvocationTargetException:
java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
at java.util.ArrayList.RangeCheck(ArrayList.java:486)
at java.util.ArrayList.get(ArrayList.java:302)
at
dsap.application.form.ReqNewAccessForm.getUserModList(ReqNewAccessForm.java:363)
at java.lang.reflect.Method.invoke(Native Method)
at
org.apache.commons.beanutils.PropertyUtils.getIndexedProperty(PropertyUtils.java:493)
at
org.apache.commons.beanutils.PropertyUtils.getIndexedProperty(PropertyUtils.java:428)
at
org.apache.commons.beanutils.PropertyUtils.getNestedProperty(PropertyUtils.java:770)
at
org.apache.commons.beanutils.PropertyUtils.getProperty(PropertyUtils.java:801)
at
org.apache.commons.beanutils.BeanUtils.setProperty(BeanUtils.java:881)
at
org.apache.commons.beanutils.BeanUtils.populate(BeanUtils.java:808)
at
org.apache.struts.util.RequestUtils.populate(RequestUtils.java:1097)
#

Given below are code snippets from my form bean and
JSP:

/**
* Access method for the userModList property.
* 
* @return   the current value of the userModList
property
*/
   public ArrayList getUserModList() 
   {
  return userModList;
   }
   
   /**
* Sets the value of the userModList property.
* 
* @param aUserModList the new value of the
userModList property
*/
   public void setUserModList(ArrayList aUserModList) 
   {  
  userModList = aUserModList;   
   }


/**
* Access method for the userModList property.
* 
*/
   public UserModule getUserModList(int index) 
   {
  return (UserModule)userModList.get(index);
   }


/**
* Sets the value of the userModList property.
* 
*/
   public void setUserModList(int index,UserModule
userModule) 
   {  
  userModList.set(index,userModule);
   }

#
JSP:


logic:iterate name=usrModList 
scope=session
id=userModList 
tr
td align=centerbean:write 
name=userModList
property=id//td


td
html:radio name=userModList
property=odbcAccess value=Y indexed=true /Yes 
nbsp
html:radio name=userModList
property=odbcAccess value=N indexed=true /No 
/td

td
html:radio name=userModList
property=wfAccess value=Y indexed=true /Yes 
nbsp
html:radio name=userModList
property=wfAccess value=N indexed=true /No   
/td

/tr
/logic:iterate



__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

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



problem with retaining form bean values - Struts 1.1

2005-08-05 Thread Shyam Anand
Hi,

I'm using Struts 1.1 for my web application. I have a
problem with retaining my form bean values in the
following scenario:
I have a JSP page with portions displayed in sequence
based on user action. I have 3 buttons on the page and
parts of the JSP page are displayed when the user
clicks on each button.I use DispatchAction for this
purpose and a single form bean for the JSP.

The following is the sequence of user interactions on
the page.

1.Initially the user clicks a link to get to the JSP -
get method of DispatchAction is called, and the
first part of the JSP page is displayed.

2. The user enters some values and clicks a button to
look up information. This invokes the lookup method
of the DispatchAction class, and subsequently, the
results are displayed on the JSP, along with other
input fields.

3. The user enters some more details on the JSP and
clicks a Continue button, which invokes the
continue method of the DispatchAction class. Based
on the data entered, some more information/input
fields are displayed on the JSP.

4. Finally, the user enters the remaining fields and
submits the form.

The issue I'm having is that the values entered in
steps 1 and 2 are not retained in the form bean when
the page is submitted or if there is a validation
error.I have used session scope for my form bean and
it didn't help.

Could somebody tell me what I'm doing wrong. Has
anybody come across such a scenario ? If so, what is
the best way to accomplish this task?

Any help would be greatly appreciated.

Thanks,
Shyam




Start your day with Yahoo! - make it your home page 
http://www.yahoo.com/r/hs 
 

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



Re: NullPointerException

2004-12-16 Thread Shyam Anand
Hi,

I have not fully understood the context in which you
get this error. However, I noticed that in your action
mapping in struts-config.xml,

quote
  action
path=/InsertArticle
type=articles.ArticleAction
name=articleForm
scope=request
validate=false
input=/Template.jsp
forward name=success
path=/articles/preview.jsp/
forward name=failure
path=/articles/Template.jsp/
/action

unquote

you do not specify the complete path for your input
JSP - input=/Template.jsp. I guess it should be: 
path=/articles/Template.jsp/.
Wonder if this might be causing the error.

HTH,
Shyam



--- uma.k [EMAIL PROTECTED] wrote:

 I get NullPointerException when I access this
 index.jsp page. I also have
 ApplicationResources.properties file in
 web-inf/classes folder
 
 %@ taglib uri=/WEB-INF/struts-bean.tld
 prefix=bean %
 %@ taglib uri=/WEB-INF/struts-html.tld
 prefix=html %
 html
 head
 titlebean:message
 key=title.employeeApp//title
 /head
 body
 h1bean:message key=title.employeeApp//h1
 br
 html:link page=/articleForm.doAdd An
 Article/html:link
 /body
 /html
 
 This is my struts-config.xml file
 
 ?xml version=1.0 encoding=ISO-8859-1 ?
 
 !DOCTYPE struts-config PUBLIC
   -//Apache Software Foundation//DTD Struts
 Configuration 1.2//EN
  

http://jakarta.apache.org/struts/dtds/struts-config_1_2.dtd;
 
 
 struts-config
 
 form-beans
 form-bean name=articleForm
 type=articles.ArticleForm/
 /form-beans
 
 action-mappings
 
   action path=/articleForm
   forward=/articles/Template.jsp /
 
 action
   path=/InsertArticle
   type=articles.ArticleAction
   name=articleForm
   scope=request
   validate=false
   input=/Template.jsp
   forward name=success
 path=/articles/preview.jsp/
   forward name=failure
 path=/articles/Template.jsp/
   /action
 
 /action-mappings
 
   message-resources
   parameter=ApplicationResources
   null=false /
 
 
 /struts-config
 
 
 This is my complete exception
 
 java.lang.NullPointerException
   at

org.apache.struts.taglib.TagUtils.retrieveMessageResources(TagUtils.java:121
 9)
   at

org.apache.struts.taglib.TagUtils.message(TagUtils.java:1082)
   at

org.apache.struts.taglib.bean.MessageTag.doStartTag(MessageTag.java:226)
   at

org.apache.jsp.index$jsp._jspService(index$jsp.java:68)
   at

org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107)
   at

javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
   at

org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.ja
 va:201)
   at

org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:381)
   at

org.apache.jasper.servlet.JspServlet.service(JspServlet.java:473)
   at

javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
   at

org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application
 FilterChain.java:247)
   at

org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh
 ain.java:193)
   at

org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.ja
 va:243)
   at

org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
 66)
   at

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

org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
   at

org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.ja
 va:190)
   at

org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
 66)
   at

org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java:2
 46)
   at

org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
 64)
   at

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

org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
   at

org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2347)
   at

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

org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
 66)
   at

org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.
 java:170)
   at

org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
 64)
   at

org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:170
 )
   at

org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
 64)
   at

org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:468)
   at

org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
 64)
   at

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


Re: Struts training

2004-11-28 Thread Shyam Anand
James,

Thanks for the info...Look forward to your training
course.

Shyam

--- James Mitchell [EMAIL PROTECTED] wrote:

 Was your question ever answered?
 
 There was talk about this among the Struts-Atlanta
 (Struts users group) 
 members and I have considered putting something like
 this together, but like 
 everything else, it has taken a back seat to other
 plans.
 
 If there is enough real interest in this, I will
 bump it up on my priority 
 list.
 
 
 --
 James Mitchell
 Software Engineer / Open Source Evangelist
 EdgeTech, Inc.
 678.910.8017
 AIM: jmitchtx
 
 - Original Message - 
 From: Shyam Anand [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Tuesday, November 23, 2004 12:17 PM
 Subject: Struts training
 
 
  Hi,
  Could somebody recommend a good, advanced Struts
  classroom training course in the US,that covers
 topics
  like Tiles/JSTL, JSF et al?
 
  Thanks,
  Shyam
 
  __
  Do You Yahoo!?
  Tired of spam?  Yahoo! Mail has the best spam
 protection around
  http://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]
 
 




__ 
Do you Yahoo!? 
Take Yahoo! Mail with you! Get it on your mobile phone. 
http://mobile.yahoo.com/maildemo 

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



Struts training

2004-11-23 Thread Shyam Anand
Hi,
Could somebody recommend a good, advanced Struts
classroom training course in the US,that covers topics
like Tiles/JSTL, JSF et al?

Thanks,
Shyam

__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

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



Re: problem with table of radio buttons on Unix

2004-10-15 Thread Shyam Anand
Hello,

Could somebody help me out with this? Any insights on
what could be causing this problem would be greatly
appreciated.

Thanks,
Shyam

--- Shyam Anand [EMAIL PROTECTED] wrote:

 Hi,
 
 I have a scenario where I have a table of radio
 buttons for a set of questions (Yes/No) on a page.
 I'm
 using indexed properties for the same.
 
 Each question on my JSP is represented by an object
 called YesNoQuestion, and my ActionForm uses an
 ArrayList of YesNoQuestions called yesNoList. 
 
 In my ActionForm I have:
 
 
  /**
 * Access method for the yesNoList property.
 * 
 * @return   the current value of the yesNoList
 property
 */
public ArrayList getYesNoList() 
{
   return yesNoList;
}

/**
 * Sets the value of the yesNoList property.
 * 
 * @param aYesNoList the new value of the
 yesNoList
 property
 */
public void setYesNoList(ArrayList aYesNoList) 
{
   yesNoList = aYesNoList; 
}
 
 
 /**
 * Access method for the yesNoList property.
 * 
 */
public YesNoQuestion getYesNoList(int index) 
{
   return (YesNoQuestion)yesNoList.get(index);
}
 
 
 /**
 * Sets the value of the yesNoList property.
 * 
 */
public void setYesNoList(int index,YesNoQuestion
 yesNoQuestion) 
{
   yesNoList.set(index,yesNoQuestion); 
}
 
 --
 
 In my JSP, I have:
 
 
 logic:iterate name=castYesNoBallotForm
 property=yesNoList id=yesNoList scope=session
 
   tr
   td align=centerbean:write name=yesNoList
 property=qno//td 
   td align=centerbean:write name=yesNoList
 property=question//td
   
   td colspan=2   
  
   html:radio name=yesNoList
 property=yesNoFlag
 value=Y indexed=true /Yes 
   nbsp
   html:radio name=yesNoList
 property=yesNoFlag
 value=N indexed=true /No
   nbsp
   html:radio name=yesNoList
 property=yesNoFlag
 value=A indexed=true/Abstain
   /td   
   /tr
   /logic:iterate
 
 
 
 The above code works fine when I deploy it on a
 Windows machine. But, on a Unix machine (Sun
 Solaris),
 I get the following error when I try to access my
 JSP:
 
 No getter method for property yesNoList of bean
 castYesNoBallotForm 
 
 Could somebody tell me what I'm doing wrong?
 
 Any help will be greatly appreciated.
 
 Thanks,
 Shyam
 
 
 
 __
 Do You Yahoo!?
 Tired of spam?  Yahoo! Mail has the best spam
 protection around 
 http://mail.yahoo.com 
 

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




___
Do you Yahoo!?
Declare Yourself - Register online to vote today!
http://vote.yahoo.com

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



problem with table of radio buttons on Unix

2004-10-14 Thread Shyam Anand
Hi,

I have a scenario where I have a table of radio
buttons for a set of questions (Yes/No) on a page. I'm
using indexed properties for the same.

Each question on my JSP is represented by an object
called YesNoQuestion, and my ActionForm uses an
ArrayList of YesNoQuestions called yesNoList. 

In my ActionForm I have:


 /**
* Access method for the yesNoList property.
* 
* @return   the current value of the yesNoList
property
*/
   public ArrayList getYesNoList() 
   {
  return yesNoList;
   }
   
   /**
* Sets the value of the yesNoList property.
* 
* @param aYesNoList the new value of the yesNoList
property
*/
   public void setYesNoList(ArrayList aYesNoList) 
   {  
  yesNoList = aYesNoList;   
   }


/**
* Access method for the yesNoList property.
* 
*/
   public YesNoQuestion getYesNoList(int index) 
   {
  return (YesNoQuestion)yesNoList.get(index);
   }


/**
* Sets the value of the yesNoList property.
* 
*/
   public void setYesNoList(int index,YesNoQuestion
yesNoQuestion) 
   {  
  yesNoList.set(index,yesNoQuestion);   
   }

--

In my JSP, I have:


logic:iterate name=castYesNoBallotForm
property=yesNoList id=yesNoList scope=session
tr
td align=centerbean:write name=yesNoList
property=qno//td   
td align=centerbean:write name=yesNoList
property=question//td

td colspan=2   
 
html:radio name=yesNoList 
property=yesNoFlag
value=Y indexed=true /Yes 
nbsp
html:radio name=yesNoList 
property=yesNoFlag
value=N indexed=true /No
nbsp
html:radio name=yesNoList 
property=yesNoFlag
value=A indexed=true/Abstain
/td   
/tr
/logic:iterate



The above code works fine when I deploy it on a
Windows machine. But, on a Unix machine (Sun Solaris),
I get the following error when I try to access my JSP:

No getter method for property yesNoList of bean
castYesNoBallotForm 

Could somebody tell me what I'm doing wrong?

Any help will be greatly appreciated.

Thanks,
Shyam



__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

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



Re: input form

2004-10-04 Thread Shyam Anand

Hello,

Your CreateMessageAction class should extend
DispatchAction class, and then you should be able to
accomplish your requirement.

See this link:
http://struts.apache.org/api/org/apache/struts/actions/DispatchAction.html

You can have different methods in your DispatchAction
class like get, submit etc.

So, you might have something like this:

public final ActionForward get(
ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response)
throws Exception {
{

// retrieve collection for JSP and store it in the
request.

}

public final ActionForward submit(
ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response)
throws Exception {
{

// do stuff that you do now in your
CreateMessageAction
}

You would also need to configure your
struts-config.xml accordingly.

eg. you might have:

actionpath=/createMessage
   type=CreateMessageAction
   name=createMessageForm
   scope=request
  input=create.jsp
   validate=true parameter=method
   
 forward name=get
path=/WEB-INF/pages/create.jsp/  
forward name=submit
path=/WEB-INF/pages/result.jsp/

/action

HTH,
Shyam


 Hello,
  
 I have a jsp (create.jsp), a form-bean
 (CreateMessageForm.java), and an action
 (CreateMessageAction.java).
  
 Currently, the user inputs their info into
 create.jsp, hits 'submit', and the action gets the
 info from the form-bean
 and does stuff with it.  Instead, I would like to
 get some information( collections) from a database
 and populate create.jsp with them. So I would like
 to:
  
 - get a collection from the database
 - put this collection into the request
 - populate create.jsp from the request object
 -  let the user edit the form (including the
 pre-populated parts)
 - hit submit
 - CreateMessageAction gets info from form-bean and
 does stuff...
  
 Do I have to write a separate Action class for
 putting the collection (from database) into the
 request object?  Or can I somehow incorporate this
 into my current CreateMessageAction class ?
  
 please help,
 Anna Kerekes
 

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


__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

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



group of radio buttons generated dynamically

2004-09-29 Thread Shyam Anand
Hi,

I know this question has been asked before. I searched
the archives and found mails describing the problem I
have.However, I wasn't able to find any code example ,
which would make my life easier.

Well, I have a scenario in which I need to generate a
group of radio buttons dynamically eg.

question 1: 0 Yes 0 No
question 2: 0 Yes 0 No
...
question n: 0 Yes 0 No


The Yes/No radio buttons correspond to the same
property in my ActionForm, and each Yes/No set in a
row should be in a different radio button group.

The suggested solution(from the archives) is to use
Indexed properties. Does anybody have any code example
for this scenario ?

Any help/pointers will be greatly appreciated.

Thanks,
Shyam






___
Do you Yahoo!?
Declare Yourself - Register online to vote today!
http://vote.yahoo.com

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



Re: How to stop the first validation when a web page first displays?

2004-08-26 Thread Shyam Anand
Hi,

If you are doing validation in the validate() method
of your Action Form, just check for submit action
inside the method. i.e,

 public ActionErrors validate(ActionMapping mapping,
 HttpServletRequest
request) 

{
if( method.equals(submit))
{
//do validation
}

}

I guess this should take care of your problem.

HTH,
Shyam

--- PC Leung [EMAIL PROTECTED] wrote:

 Can I set validation on or off in ValidatorForm
 dynamically?
 In the first place, set it off.
 Later on, set it on.
 
 
 On Thu, 26 Aug 2004 11:05:30 -0400, Erik Weber
 [EMAIL PROTECTED] wrote:
  Well, that looks fine -- /addUserProfile is the
 path the user will
  access to submit the form, but what path does your
 user access to view
  the blank form in the first place?
  
  Erik
  
  
  
  
  PC Leung wrote:
  
  How can I define it in struts-config.xml as you
 suggest.
  
  my current fragment of struts-config.xml is the
 following.
  
  actionpath=/addUserProfile

 type=com.erp.quotation.AddUserProfileAction
 name=addUserProfileForm
scope=request
validate=true
parameter=method
 input=/AddUserProfile.jsp
forward name=success
 path=/AddUserProfile.jsp/
forward name=failure
 path=/AddUserProfile.jsp/
forward name=cancel
 path=/UserMaint.jsp/
  /action
  
  
  On Thu, 26 Aug 2004 10:55:13 -0400, Erik Weber
 [EMAIL PROTECTED] wrote:
  
  
  Is validation turned on in the action mapping
 for your setup action? If
  you are using the same form bean for both setup
 and save actions, the
  action mappings should have validation turned
 off for the former and on
  for the latter.
  
  Erik
  
  
  
  
  PC Leung wrote:
  
  
  
  The web page displays at the first time with
 the following error.
  
  java.lang.NullPointerException
   

java.text.SimpleDateFormat.parse(SimpleDateFormat.java:1108)
   
 java.text.DateFormat.parse(DateFormat.java:333)
   

com.erp.quotation.AddUserProfileForm.getSqlJoinDate(AddUserProfileForm.java:68)
   

com.erp.quotation.AddUserProfileForm.validate(AddUserProfileForm.java:80)
   

org.apache.struts.action.RequestProcessor.processValidate(RequestProcessor.java:942)
  
  
  When it first displays, I want it to show with
 a token.
  Then I make a setup DispatchAction like the
 following.
  
  public final class AddUserProfileAction extends
 DispatchAction {
 public ActionForward setup (ActionMapping
 mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response)
  throws Exception {
  saveToken(request);
  return mapping.findForward(success);
}
  
  How it get a validation error message?
  Actually submit button has not been clicked.
  
 

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




___
Do you Yahoo!?
Win 1 of 4,000 free domain names from Yahoo! Enter now.
http://promotions.yahoo.com/goldrush

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