[OT] Problem stopping Tomcat 4.1.18

2003-09-11 Thread Suresh Addagalla

Hi,
 
I am running Tomcat 4.1.18 on RHL 7.x. When I execute shutdown.sh to
stop tomcat, a lot of java process still remain unterminated. If any one
knows how to troubleshoot this, please let me know. My web applications
have a DB interface as well as an RMI client. Can these cause the
processes to remain in some way?
 
Thanks,
Suresh

**Disclaimer

Information contained in this E-MAIL being proprietary to Wipro Limited is 
'privileged' and 'confidential' and intended for use only by the individual
 or entity to which it is addressed. You are notified that any use, copying 
or dissemination of the information contained in the E-MAIL in any manner 
whatsoever is strictly prohibited.

***


Message resource as a String variable

2003-09-05 Thread Suresh Addagalla

Hi,

Is it possible to create a String variable out of a message resource
defined in the resources files?

 doesn't seem to help.

Thanks,
Suresh


**Disclaimer

Information contained in this E-MAIL being proprietary to Wipro Limited is 
'privileged' and 'confidential' and intended for use only by the individual
 or entity to which it is addressed. You are notified that any use, copying 
or dissemination of the information contained in the E-MAIL in any manner 
whatsoever is strictly prohibited.

***

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



RE: Code of a method longer than 65535 bytes

2003-08-14 Thread Suresh Addagalla

Hello Criag,

> * Use a JSP page compiler that doesn't make page developers deal
>   with the 64k limit problem (like Tomcat 4.1 or 5.0).

I am using Tomcat 4.1.12 on Windows, and I got this problem. If any one
has a clear idea on the min version of Tomcat I should use to get rid of
this problem, please let me know.

Thanks,
Suresh

> -Original Message-
> From: Craig R. McClanahan [mailto:[EMAIL PROTECTED] 
> Sent: Thursday, August 14, 2003 10:21 AM
> To: Struts Users Mailing List
> Subject: Re: Code of a method longer than 65535 bytes
> 
> 
> On Wed, 13 Aug 2003, David Thielen wrote:
> 
> > Date: Wed, 13 Aug 2003 22:13:35 -0600
> > From: David Thielen <[EMAIL PROTECTED]>
> > Reply-To: Struts Users Mailing List <[EMAIL PROTECTED]>
> > To: Struts-Users <[EMAIL PROTECTED]>
> > Subject: Code of a method longer than 65535 bytes
> >
> > Hi;
> >
> > Inside a form I have 2 address blocks - each with a selection of 
> > countries. This is more that 64K chars inside the 
> >
> > Any ideas how to get around this?
> >
> 
> Two straightforward ideas:
> 
> * Use a single  tag instead of a bunch of 
>   tags to specify the options.  You can point at the same list of
>   label-value beans for both address blocks.
> 
> * Use a JSP page compiler that doesn't make page developers deal
>   with the 64k limit problem (like Tomcat 4.1 or 5.0).
> 
> > thanks - dave
> 
> Craig


**Disclaimer

Information contained in this E-MAIL being proprietary to Wipro Limited is 
'privileged' and 'confidential' and intended for use only by the individual
 or entity to which it is addressed. You are notified that any use, copying 
or dissemination of the information contained in the E-MAIL in any manner 
whatsoever is strictly prohibited.

***

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



Help in solving "Code of a method longer than 65535 bytes"

2003-08-14 Thread Suresh Addagalla

Hi,

I eventually got this error when I kept on adding features to my JSP.
javax.servlet.ServletException: org/apache/jsp/services_jsp (Code of a
method longer than 65535 bytes)

I am finding it difficult to break my JSP into multiple JSPs. The JSP at
a very high level is like this:


// JSP code showing view1



// JSP code showing view2



// JSP code showing view3


All the views make heavy use of the big form bean object ("myform", an
instance of DynaValidatorForm). This form contains *NOT JUST* name-value
pairs, in which case I could have used jsp:include or bean:include and
pass the form data as parameter names and values. More over, I need to
access as well as *change* the data of this form bean in these views :(

Please suggest me a way to solve this problem. Is there anyway I can
pass my form to other JSPs and still be able to modify the form
elements??

Thanks,
Suresh


**Disclaimer

Information contained in this E-MAIL being proprietary to Wipro Limited is 
'privileged' and 'confidential' and intended for use only by the individual
 or entity to which it is addressed. You are notified that any use, copying 
or dissemination of the information contained in the E-MAIL in any manner 
whatsoever is strictly prohibited.

***

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



RE: Uploading a file to server using struts

2003-07-30 Thread Suresh Addagalla

You can use this code in your Action class after declaring a form
element of type FormFile.

FormFile file = (FormFile) theForm.get("theFile") ;

String fileName = file.getFileName() ;
int fileSize = file.getFileSize() ;

if ( (fileName != null) && (!fileName.equals("")) ) {

try {

if (fileSize != 0) {

File xmlFile = new File(uploadAreaTemp +
File.separator +
fileName) ;

FileOutputStream fos ;
fos = new FileOutputStream(xmlFile) ;
byte[] fileData = file.getFileData() ;
fos.write(fileData) ;
fos.close() ;

} catch (Exception e) {}

> -Original Message-
> From: bhanu sistla [mailto:[EMAIL PROTECTED] 
> Sent: Wednesday, July 30, 2003 5:41 PM
> To: [EMAIL PROTECTED]
> Subject: Uploading a file to server using struts
> 
> 
> Hi All,
>  
> I have an urgent requirement. Has any body have the code how 
> to upload a file to server using struts frame work.
>  
> Regards
> Bhanu
> 
> 
> -
> Want to chat instantly with your online friends? Get the FREE 
> Yahoo!Messenger
> 


**Disclaimer

Information contained in this E-MAIL being proprietary to Wipro Limited is 
'privileged' and 'confidential' and intended for use only by the individual
 or entity to which it is addressed. You are notified that any use, copying 
or dissemination of the information contained in the E-MAIL in any manner 
whatsoever is strictly prohibited.

***

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



[OT] Line numbers while parsing XML

2003-07-25 Thread Suresh Addagalla

Hi,

I am using struts-upload to upload an XML file and Xerces API to parse
the same.

I need to "compile" the XML file in the sense that I need to report any
errors back to the user along with the line numbers, like compilation
errors. These are not XML parsing errors, but application level errors;
for example, a "code" attribute of an element may be such that it is not
unique when a DB insertion is attempted.

Is this possible to implement with DOM? Or do I need to switch to SAX
and use the Locator handler to get the line number information?

Thanks,
Suresh


**Disclaimer

Information contained in this E-MAIL being proprietary to Wipro Limited is 
'privileged' and 'confidential' and intended for use only by the individual
 or entity to which it is addressed. You are notified that any use, copying 
or dissemination of the information contained in the E-MAIL in any manner 
whatsoever is strictly prohibited.

***

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



html:select validation

2003-02-05 Thread Suresh Addagalla
Hi,

I have an html:select with multiple option as follows.


  


My validator fails to validate the above one for "required". If I leave
the selection box without selecting and submit the form, Validator
doesn't complain. Pls let me know if anyone has a clue why this is
happening.

My validation.xml has:



 

Thanks,
Suresh


**Disclaimer** 
   
 
 Information contained in this E-MAIL being proprietary to Wipro Limited is 
'privileged' 
and 'confidential' and intended for use only by the individual or entity to which it 
is 
addressed. You are notified that any use, copying or dissemination of the information 
contained in the E-MAIL in any manner whatsoever is strictly prohibited.







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


Logging

2003-01-27 Thread Suresh Addagalla
Hi,

Please don't mind if my question is simplistic, but it's an area not
explored by me.

I need to implement logging in my Struts application. For now, I want to
keep it very very simple, may be just limit to printing debug/info
statements. But I am sure that in future I would need to provide a
sophisticated logging (with different logging levels and formats). So,
how should I design my logging now so that I would be able to seamlessly
extend it in future? Even better, I should be able to make use of
already existing free & open source logging APIs/frameworks. Pls guide
me on this aspect.

Thanks,
Suresh


**Disclaimer** 
   
 
 Information contained in this E-MAIL being proprietary to Wipro Limited is 
'privileged' 
and 'confidential' and intended for use only by the individual or entity to which it 
is 
addressed. You are notified that any use, copying or dissemination of the information 
contained in the E-MAIL in any manner whatsoever is strictly prohibited.







--
To unsubscribe, e-mail:   
For additional commands, e-mail: 


Tag as an attribute

2003-01-23 Thread Suresh Addagalla
Hi,

Is the following a valid struts tag?

"/>

I am getting an error. What's the way to achieve this without using a
scriptlet? I have a temporary fix:

<% String image=(String)pageContext.getAttribute("myImage",
pageContext.APPLICATION_SCOPE) ; %>


Thanks,
Suresh


**Disclaimer

Information contained in this E-MAIL being proprietary to Wipro Limited is 
'privileged' and 'confidential' and intended for use only by the individual
 or entity to which it is addressed. You are notified that any use, copying 
or dissemination of the information contained in the E-MAIL in any manner 
whatsoever is strictly prohibited.

***


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 


RE: Need help with html:select and html:options

2003-01-23 Thread Suresh Addagalla
Check if you have month & day properties defined in your form bean.

Suresh

>-Original Message-
>From: Scott Seong [mailto:[EMAIL PROTECTED]] 
>Sent: Friday, January 24, 2003 11:32 AM
>To: Struts Users Mailing List
>Subject: Need help with html:select and html:options
>
>
>Hello,
>
>I'm having trouble with html:select and html:options. Basically, I have
>three select/options pairs in a JSP page, and the result is complaining
>about "No getter method available for Property month for bean 
>name under
>org.apache...". Here is the code sample:
>
><%
>Vector states = new Vector();
>
>states.add(new LabelValueBean("Alabama", "AL"));
>
>states.add(new LabelValueBean("Alaska", "AK"));
>
>...
>
>pageContext.setAttribute( "states", states);
>
>Vector months = new Vector();
>
>months.add(new LabelValueBean("Month", "00"));
>
>months.add(new LabelValueBean("January", "01"));
>
>...
>
>pageContext.setAttribute( "months", months);
>
>
>
>Vector days = new Vector();
>
>days.add(new LabelValueBean("Day", "00"));
>
>days.add(new LabelValueBean("1", "01"));
>
>...
>
>pageContext.setAttribute( "days", days);
>
>%>
>
>
>Then, I have html:select and html:options tags as shown below:
>
>
>labelProperty="label" />
>
>
>
>
>
>labelProperty="mLabel"
>/>
>
>
>
>
>
>labelProperty="dLabel" />
>
>
>
>
>
>The JSP chokes at the 2nd select/options, and I don't know 
>why. If I remove
>2nd and third pair, the JSP seems to work fine. Can someone help?
>
>Thanks,
>Scott
>
>
>
>
>--
>To unsubscribe, e-mail:   
>[EMAIL PROTECTED]>
>For 
>additional commands, 
>e-mail: 
>


**Disclaimer** 
   
 
 Information contained in this E-MAIL being proprietary to Wipro Limited is 
'privileged' 
and 'confidential' and intended for use only by the individual or entity to which it 
is 
addressed. You are notified that any use, copying or dissemination of the information 
contained in the E-MAIL in any manner whatsoever is strictly prohibited.







--
To unsubscribe, e-mail:   
For additional commands, e-mail: 


pageContext beans

2003-01-22 Thread Suresh Addagalla
Hi,

Does Struts provide any tag to access attributes set in a
ServletContext?

Thanks,
Suresh


**Disclaimer

Information contained in this E-MAIL being proprietary to Wipro Limited is 
'privileged' and 'confidential' and intended for use only by the individual
 or entity to which it is addressed. You are notified that any use, copying 
or dissemination of the information contained in the E-MAIL in any manner 
whatsoever is strictly prohibited.

***


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 


RE: To check if user is logged in

2003-01-22 Thread Suresh Addagalla
Hi,

Are you talking about CheckLoginTag.java in struts-example.war?

This implements the check using a custom tag. But I need to forward to
login page even before I forward my request to the JSP, in my controller
itself.

Suresh

>-Original Message-
>From: julian green [mailto:[EMAIL PROTECTED]] 
>Sent: Wednesday, January 22, 2003 6:22 PM
>To: Struts Users Mailing List
>Subject: Re: To check if user is logged in
>
>
>have a look at the struts example that comes with struts.   It has an 
>example of what you are doing in there.
>
>
>
>
>--
>To unsubscribe, e-mail:   
>[EMAIL PROTECTED]>
>For 
>additional commands, 
>e-mail: 
>


**Disclaimer** 
   
 
 Information contained in this E-MAIL being proprietary to Wipro Limited is 
'privileged' 
and 'confidential' and intended for use only by the individual or entity to which it 
is 
addressed. You are notified that any use, copying or dissemination of the information 
contained in the E-MAIL in any manner whatsoever is strictly prohibited.







--
To unsubscribe, e-mail:   
For additional commands, e-mail: 


To check if user is logged in

2003-01-22 Thread Suresh Addagalla
Hi,

I think this is a commonly performed task, but I need your inputs to
implement it in the best possible way.

I have login page to authenticate the user. For subsequent requests, I
need to check that the user is logged in. If he is not logged in, I need
to display the login page.

Is extending ActionServlet a good way to do this? The process() method
can check for the existence of user's data in session to know if he is
logged in. But I see a problem. My login page itself is submitted to
login.do, so the login request goes through my ActionServlet subclass,
which means that he will never be able to login?? Or am I missing
something?

Any other approach, please let me know.

Thanks,
Suresh


**Disclaimer** 
   
 
 Information contained in this E-MAIL being proprietary to Wipro Limited is 
'privileged' 
and 'confidential' and intended for use only by the individual or entity to which it 
is 
addressed. You are notified that any use, copying or dissemination of the information 
contained in the E-MAIL in any manner whatsoever is strictly prohibited.







--
To unsubscribe, e-mail:   
For additional commands, e-mail: 


Date Validation: Help Required

2003-01-22 Thread Suresh Addagalla
Hi,

I haven't been able to successfully use the Validator for doing Date
validations with struts 1.1 b3.

I need to localize the date format. Since Validator would anyway take
the default locale and the SHORT form of the date from the system, I
have decided that I will use the short format in all Locales. But I am
facing the following problems.

1. If I don't specify the "dateFormat" and/or "dateFormatStrict", I am
getting JavaScript errors (msg: length is null or not defined..) in the
2nd line in the code below (from validator-rules.xml)


   var datePattern = oDate[x][2]("datePatternStrict");
   if ((form[oDate[x][0]].type == 'text' ||
form[oDate[x][0]].type == 'textarea') &&
   (value.length > 0) &&
   (datePattern.length > 0)) {
 var MONTH = "MM";
 var DAY = "dd";
 var YEAR = "";
 var orderMonth = datePattern.indexOf(MONTH);
 var orderDay = datePattern.indexOf(DAY);
 var orderYear = datePattern.indexOf(YEAR);

2. Validator seems to be using a fixed date format (last 6 lines in the
code above). How can the JavaScript take care of other locales/formats?
Do I need to change the JavaScript per installation basis or Do I need
to download a different version of struts jar? What exactly is required
to achieve localization.

IMP: As far as possible, I would like to avoid specifying the
"dateFormat"/"dateFormatStrict" in validator-rules.xml since I want to
use the default locale's SHORT form.

Thanks,
Suresh


**Disclaimer** 
   
 
 Information contained in this E-MAIL being proprietary to Wipro Limited is 
'privileged' 
and 'confidential' and intended for use only by the individual or entity to which it 
is 
addressed. You are notified that any use, copying or dissemination of the information 
contained in the E-MAIL in any manner whatsoever is strictly prohibited.







--
To unsubscribe, e-mail:   
For additional commands, e-mail: 


Validator and Form Field Population

2003-01-21 Thread Suresh Addagalla
Title: Message



Hi,
 
Though 
I don't see a link between Validator and pre-populating form fields, this weird 
thing is happening in my application.
 
I am 
pre-populating a Select component with a list of values. When I load this page, 
everything is fine. But when I add this form to Validator framework, this field 
is no more pre-populated - the select list is empty. This happens on any other 
page that I try.
 
Population:
 
    
    
 
Validation.xml:
 
    
        
    
property="name1"    
depends="required">    
 
    
    
 
JSP 
_javascript_:
 

 

 
Thanks,
Suresh
**Disclaimer** 
   
 
 Information contained in this E-MAIL being proprietary to Wipro Limited is 
'privileged' 
and 'confidential' and intended for use only by the individual or entity to which it 
is 
addressed. You are notified that any use, copying or dissemination of the information 
contained in the E-MAIL in any manner whatsoever is strictly prohibited.







--
To unsubscribe, e-mail:   
For additional commands, e-mail: 


RE: Validator and Form Bean

2003-01-17 Thread Suresh Addagalla
Yeah, I seem to be setting up struts-config correctly as it works fine
if I change the scope to "session". Here is the config:

Form-bean related config:










Action mapping related config:






 


Thanks,
Suresh

>-Original Message-
>From: Rick Reumann [mailto:[EMAIL PROTECTED]] 
>Sent: Friday, January 17, 2003 8:44 PM
>To: Struts Users Mailing List; [EMAIL PROTECTED]
>Subject: Re: Validator and Form Bean
>
>
>On Friday, January 17, 2003, 8:42:11 AM, Suresh wrote:
>
>SA> But now, my whole form is not getting displayed because I am not
>SA> getting the form bean back. Any thing I am missing? **Must the
>SA> form bean be in session scope if I want this functionality?**
>
>No, the FormBean can have request scope. How are you setting up the
>form bean into the page initially? Are you sure you are setting it up
>correctly in the struts-config.xml file? Maybe you could paste that
>part of the code here.
>
>
>-- 
>
>Rick
>mailto:[EMAIL PROTECTED]
>


**Disclaimer** 
   
 
 Information contained in this E-MAIL being proprietary to Wipro Limited is 
'privileged' 
and 'confidential' and intended for use only by the individual or entity to which it 
is 
addressed. You are notified that any use, copying or dissemination of the information 
contained in the E-MAIL in any manner whatsoever is strictly prohibited.







--
To unsubscribe, e-mail:   
For additional commands, e-mail: 


Struts Validator Problem

2003-01-17 Thread Suresh Addagalla
Hi,

I am facing a problem with Validator while doing client-side validation.

IE is throwing the following error dialog when I submit the form:

"type" is null or not an object

The corresponding source code (validator generated) line the *second*
line below:

for (x in oRequired) {
if ((form[oRequired[x][0]].type == 'text' ||
 form[oRequired[x][0]].type == 'textarea' ||
 form[oRequired[x][0]].type == 'select-one' ||
 form[oRequired[x][0]].type == 'radio' ||
 form[oRequired[x][0]].type == 'password') &&
(form[oRequired[x][0]].value == '')) {

Please let me know if anyone knows how to fix this problem.

Thanks,
Suresh


**Disclaimer** 
   
 
 Information contained in this E-MAIL being proprietary to Wipro Limited is 
'privileged' 
and 'confidential' and intended for use only by the individual or entity to which it 
is 
addressed. You are notified that any use, copying or dissemination of the information 
contained in the E-MAIL in any manner whatsoever is strictly prohibited.







--
To unsubscribe, e-mail:   
For additional commands, e-mail: 


Validator and Form Bean

2003-01-17 Thread Suresh Addagalla
Hi,

Does Struts Validator *pass back* the form bean object if a validation
fails? Or does it pass back only the errors?

My scenario is as follows. I have a page for creating a "Service". I
enter all the data and submit it. Assume that the validation fails. In
this case, along with the error message, I should display the submitted
values so that the user can correct them and re-submit. But now, my
whole form is not getting displayed because I am not getting the form
bean back. Any thing I am missing? **Must the form bean be in session
scope if I want this functionality?**

Thanks,
Suresh


**Disclaimer

Information contained in this E-MAIL being proprietary to Wipro Limited is 
'privileged' and 'confidential' and intended for use only by the individual
 or entity to which it is addressed. You are notified that any use, copying 
or dissemination of the information contained in the E-MAIL in any manner 
whatsoever is strictly prohibited.

***


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 


RE: [OT] Date format

2003-01-17 Thread Suresh Addagalla
Hi,

What I am looking for is how to display the *format*, and not how to
display a date in a given format. So, there doesn't seem to be anything
provided with the API.

I need a method like "toPattern()" of SimpleDateFormat in the DateFormat
class because getDateInstance() returns me DateFormat and not
SimpleDateFormat.

Suresh

>-Original Message-
>From: Andrew Hill [mailto:[EMAIL PROTECTED]] 
>Sent: Friday, January 17, 2003 9:11 AM
>To: Struts Users Mailing List
>Subject: RE: [OT] Date format
>
>
>Your best bet is to use the static factory methods in the 
>DateFormat class.
>
>ie:
>Locale locale = getLocale(request); //Use struts Action method 
>to get locale
>
>dateTimeFormat =
>ateFormat.getDateTimeInstance( 
>DateFormat.SHORT,DateFormat.SHORT, locale);
>dateFormat = DateFormat.getDateInstance( DateFormat.SHORT, locale);
>timeFormat = DateFormat.getTimeInstance( DateFormat.SHORT, locale);
>
>Its all in the javadocs you know. :-)
>
>
>In case you were wondering how the java.util.Date.toString() 
>works, heres
>its source code:
>
>public String toString() {
>   DateFormat formatter = null;
>   if (simpleFormatter != null) {
>   formatter = (DateFormat)simpleFormatter.get();
>   }
>   if (formatter == null) {
>   /* No cache yet, or cached formatter GC'd */
>   formatter = new SimpleDateFormat("EEE MMM dd 
>HH:mm:ss zzz ",
>Locale.US);
>   simpleFormatter = new SoftReference(formatter);
>   }
>synchronized (formatter) {
>    formatter.setTimeZone(TimeZone.getDefault());
>return formatter.format(this);
>}
>}
>
>
>-Original Message-
>From: Suresh Addagalla [mailto:[EMAIL PROTECTED]]
>Sent: Thursday, 16 January 2003 22:56
>To: [EMAIL PROTECTED]
>Subject: Date format
>
>
>Hi,
>
>Please excuse me for the off-topic question, I need this urgently, so
>posting it.
>
>How can I get the current date format? (style: 
>DateFormat.SHORT, locale:
>Default)
>
>I used:
>
>SimpleDateFormat formatter = new SimpleDateFormat() ;
>String format = formatter.toPattern() ;
>
>It gives:
>
>M/d/yy hh:mm a
>
>But what I want is *only* the date part, excluding the time part of it.
>
>Thanks,
>Suresh


**Disclaimer** 
   
 
 Information contained in this E-MAIL being proprietary to Wipro Limited is 
'privileged' 
and 'confidential' and intended for use only by the individual or entity to which it 
is 
addressed. You are notified that any use, copying or dissemination of the information 
contained in the E-MAIL in any manner whatsoever is strictly prohibited.







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


RE: Application scope variables

2003-01-17 Thread Suresh Addagalla
Hi,

Thanks for the suggestion. Can someone outline the procedure for storing
ServletContext attributes through a strust plug-in? I really couldn't
find much help on the web to start working on the plug-in related
things.

Thanks,
Suresh

>-Original Message-
>From: Craig R. McClanahan [mailto:[EMAIL PROTECTED]] 
>Sent: Thursday, January 09, 2003 12:36 PM
>To: Struts Users Mailing List; [EMAIL PROTECTED]
>Subject: Re: Application scope variables
>
>
>
>
>My recommendation is to set up shared stuff like this as servlet
context attributes, either in a PlugIn (Struts 1.1) or a
ServletContextListener (Servlet 2.3). Anything stored as servlet context
attributes is instantly available as application scope beans in a JSP
page, through standard JSP tags, through PageContext.APPLICATION_SCOPE,
or any other way you want to do it.
>
>Craig


**Disclaimer

Information contained in this E-MAIL being proprietary to Wipro Limited is 
'privileged' and 'confidential' and intended for use only by the individual
 or entity to which it is addressed. You are notified that any use, copying 
or dissemination of the information contained in the E-MAIL in any manner 
whatsoever is strictly prohibited.

***


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 


Validator and Form Bean

2003-01-17 Thread Suresh Addagalla
Hi,

Does Struts Validator *pass back* the form bean object if a validation
fails? Or does it pass back only the errors?

My scenario is as follows. I have a page for creating a "Service". I
enter all the data and submit it. Assume that the validation fails. In
this case, along with the error message, I should display the submitted
values so that the user can correct them and re-submit. But now, my
whole form is not getting displayed because I am not getting the form
bean back. Any thing I am missing? **Must the form bean be in session
scope if I want this functionality?**

Thanks,
Suresh


**Disclaimer** 
   
 
 Information contained in this E-MAIL being proprietary to Wipro Limited is 
'privileged' 
and 'confidential' and intended for use only by the individual or entity to which it 
is 
addressed. You are notified that any use, copying or dissemination of the information 
contained in the E-MAIL in any manner whatsoever is strictly prohibited.







--
To unsubscribe, e-mail:   
For additional commands, e-mail: 


Struts Validator Problem

2003-01-17 Thread Suresh Addagalla
Hi,

I am facing a problem with Validator while doing client-side validation.

IE is throwing the following error dialog when I submit the form:

"type" is null or not an object

The corresponding source code (validator generated) line the *second*
line below:

for (x in oRequired) {
if ((form[oRequired[x][0]].type == 'text' ||
 form[oRequired[x][0]].type == 'textarea' ||
 form[oRequired[x][0]].type == 'select-one' ||
 form[oRequired[x][0]].type == 'radio' ||
 form[oRequired[x][0]].type == 'password') &&
(form[oRequired[x][0]].value == '')) {

Please let me know if anyone knows how to fix this problem.

Thanks,
Suresh


**Disclaimer** 
   
 
 Information contained in this E-MAIL being proprietary to Wipro Limited is 
'privileged' 
and 'confidential' and intended for use only by the individual or entity to which it 
is 
addressed. You are notified that any use, copying or dissemination of the information 
contained in the E-MAIL in any manner whatsoever is strictly prohibited.







--
To unsubscribe, e-mail:   
For additional commands, e-mail: 


Date format

2003-01-16 Thread Suresh Addagalla
Hi,

Please excuse me for the off-topic question, I need this urgently, so
posting it.

How can I get the current date format? (style: DateFormat.SHORT, locale:
Default)

I used:

SimpleDateFormat formatter = new SimpleDateFormat() ;
String format = formatter.toPattern() ;

It gives:

M/d/yy hh:mm a

But what I want is *only* the date part, excluding the time part of it.

Thanks,
Suresh


**Disclaimer** 
   
 
 Information contained in this E-MAIL being proprietary to Wipro Limited is 
'privileged' 
and 'confidential' and intended for use only by the individual or entity to which it 
is 
addressed. You are notified that any use, copying or dissemination of the information 
contained in the E-MAIL in any manner whatsoever is strictly prohibited.







--
To unsubscribe, e-mail:   
For additional commands, e-mail: 


All values of html:select

2003-01-15 Thread Suresh Addagalla
Hi,

I need to display a set of values in an html:select control. User
adds/deletes certain values, so at the end I need to get the list of
"all" values in the combo box, not just the selected value(s). How can I
achieve this? Do I need to use JavaScript (and a hidden variable to
store all the values) or does the framework provide some built-in
support?

Thanks,
Suresh


**Disclaimer** 
   
 
 Information contained in this E-MAIL being proprietary to Wipro Limited is 
'privileged' 
and 'confidential' and intended for use only by the individual or entity to which it 
is 
addressed. You are notified that any use, copying or dissemination of the information 
contained in the E-MAIL in any manner whatsoever is strictly prohibited.







--
To unsubscribe, e-mail:   
For additional commands, e-mail: 


RE: Declarative Exception Handling(solved)

2003-01-12 Thread Suresh Addagalla
Thanks David. It worked this way:







Suresh

>-Original Message-
>From: David M. Karr [mailto:[EMAIL PROTECTED]] 
>Sent: Monday, January 13, 2003 12:15 AM
>To: [EMAIL PROTECTED]
>Subject: Re: Declarative Exception Handling
>
>
>>>>>> "Suresh" == Suresh Addagalla <[EMAIL PROTECTED]> writes:
>
>Suresh> Hi,
>Suresh> I still need some more help in this respect. If 
>any of you have managed
>Suresh> to extract messages from exception objects using 
>declarative exception
>Suresh> handling, please give me some inputs.
>
>Suresh> I have tried putting the following in my jsp.
>
>Suresh> 
>Suresh> property="message"/>
>Suresh> 
>
>Suresh> My action throws the InvalidLoginException and 
>sets the "message"
>Suresh> attribute to some text.
>
>Suresh> I got the following error.
>
>Suresh> org.apache.jasper.JasperException: Cannot process 
>ActionErrors instance
>Suresh> of class ss.prwp.service.InvalidLoginException
>
>Suresh> I have the following exceptin declared in 
>struts-config.xml:
>
>Suresh> Suresh> key="error.invalid.login" path="login.jsp" />
>
>The ActionErrors list and ActionError object have nothing to 
>do with Exception
>objects.  Your exception object is available as a bean with 
>that key.  Just
>reference it in any of the tags that can reference bean 
>properties, but not the
>"errors" tag.
>
>-- 
>===
>David M. Karr  ; Java/J2EE/XML/Unix/C++
>[EMAIL PROTECTED]   ; SCJP; SCWCD
>
>
>
>
>--
>To unsubscribe, e-mail:   
><mailto:struts-user->[EMAIL PROTECTED]>
>For 
>additional commands, 
>e-mail: <mailto:[EMAIL PROTECTED]>
>


**Disclaimer** 
   
 
 Information contained in this E-MAIL being proprietary to Wipro Limited is 
'privileged' 
and 'confidential' and intended for use only by the individual or entity to which it 
is 
addressed. You are notified that any use, copying or dissemination of the information 
contained in the E-MAIL in any manner whatsoever is strictly prohibited.







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


RE: jsp:directive.taglib doesn't work

2003-01-12 Thread Suresh Addagalla
HI,

Thanks for the solution. I tried to convert just the taglib directive to
XML syntax. The page contains other tags in conventional scripting
style.

The error I get is was as follows:

org.apache.jasper.JasperException: /login.jsp(12,5) jsp.error.badaction
at
org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHand
ler.java:94)
at
org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java
:417)
at
org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java
:126)
at
org.apache.jasper.compiler.Parser.parseAction(Parser.java:676)
at
org.apache.jasper.compiler.Parser.parseElements(Parser.java:807)
at org.apache.jasper.compiler.Parser.parse(Parser.java:122)
at
org.apache.jasper.compiler.ParserController.parse(ParserController.java:
199)
at
org.apache.jasper.compiler.ParserController.parse(ParserController.java:
153)
at
org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:219)

Thanks,
Suresh

>-Original Message-
>From: David M. Karr [mailto:[EMAIL PROTECTED]] 
>Sent: Monday, January 13, 2003 12:11 AM
>To: [EMAIL PROTECTED]
>Subject: Re: jsp:directive.taglib doesn't work
>
>
>>>>>> "Suresh" == Suresh Addagalla <[EMAIL PROTECTED]> writes:
>
>Suresh> Hi,
>Suresh> Slightly off-topic, but a basic JSP question.
>
>Suresh> I found that XML-based tag for taglib is not 
>working for me, where as
>Suresh> the scripting-oriented tag works fine.
>
>Suresh> prefix="tagprefix"/> --
>Suresh> doesn't work
>Suresh> <%@ taglib uri="url to taglig" prefix="tagprefix" 
>%> - works
>
>Suresh> Any idea why the first syntax wouldn't work? I am 
>using Tomcat 4.1.12 on
>Suresh> Win2K.
>
>Are you trying to convert the entire page to the XML syntax, 
>or just that one
>directive?
>
>I believe you can't do it piecemeal, it has to be the entire page.
>
>When you say it "doesn't work", what exactly happens?
>
>-- 
>===
>David M. Karr  ; Java/J2EE/XML/Unix/C++
>[EMAIL PROTECTED]   ; SCJP; SCWCD
>
>
>
>
>--
>To unsubscribe, e-mail:   
><mailto:struts-user->[EMAIL PROTECTED]>
>For 
>additional commands, 
>e-mail: <mailto:[EMAIL PROTECTED]>
>


**Disclaimer** 
   
 
 Information contained in this E-MAIL being proprietary to Wipro Limited is 
'privileged' 
and 'confidential' and intended for use only by the individual or entity to which it 
is 
addressed. You are notified that any use, copying or dissemination of the information 
contained in the E-MAIL in any manner whatsoever is strictly prohibited.







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


RE: Declarative Exception Handling

2003-01-12 Thread Suresh Addagalla
Hi,

I still need some more help in this respect. If any of you have managed
to extract messages from exception objects using declarative exception
handling, please give me some inputs.

I have tried putting the following in my jsp.





My action throws the InvalidLoginException and sets the "message"
attribute to some text.

I got the following error.

org.apache.jasper.JasperException: Cannot process ActionErrors instance
of class ss.prwp.service.InvalidLoginException

I have the following exceptin declared in struts-config.xml:



Thanks,
Suresh


>-Original Message-
>From: Manomohan K Kalathil [mailto:[EMAIL PROTECTED]] 
>Sent: Saturday, January 11, 2003 2:17 PM
>To: Struts Users Mailing List
>Subject: RE: Declarative Exception Handling
>
>
>Hi Suresh, 
>   The default exception handler within struts stores a  reference
to the exception object within the request under the key
Action.EXCEPTION_KEY. You should be able to get the object reference
using Exception cause = (Exception)
request.getAttribute(Action.EXCEPTION_KEY) within your JSP Page. 
>Regards
>Mano
>PS: Use only text mails when you send mails to the mailing list. Not
all of us have HTML mail clients :-)
>
>
>-Original Message-
>From: Suresh Addagalla [mailto:[EMAIL PROTECTED]]
>Sent: Friday, January 10, 2003 5:06 PM
>To: [EMAIL PROTECTED]
>Subject: Declarative Exception Handling
>
>Hi,
>
>If I am using Declarative exception handling, is it possible 
>to extract some information from the exception object and display the
same on 
>the browser? Or is it that I need to use programmatic exception
handling if I have such
>requirements?
>
>Thanks,
>Suresh


**Disclaimer** 
   
 
 Information contained in this E-MAIL being proprietary to Wipro Limited is 
'privileged' 
and 'confidential' and intended for use only by the individual or entity to which it 
is 
addressed. You are notified that any use, copying or dissemination of the information 
contained in the E-MAIL in any manner whatsoever is strictly prohibited.







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


jsp:directive.taglib doesn't work

2003-01-12 Thread Suresh Addagalla
Hi,

Slightly off-topic, but a basic JSP question.

I found that XML-based tag for taglib is not working for me, where as
the scripting-oriented tag works fine.

 --
doesn't work
<%@ taglib uri="url to taglig" prefix="tagprefix" %> - works

Any idea why the first syntax wouldn't work? I am using Tomcat 4.1.12 on
Win2K.

Thanks,
Suresh


**Disclaimer** 
   
 
 Information contained in this E-MAIL being proprietary to Wipro Limited is 
'privileged' 
and 'confidential' and intended for use only by the individual or entity to which it 
is 
addressed. You are notified that any use, copying or dissemination of the information 
contained in the E-MAIL in any manner whatsoever is strictly prohibited.







--
To unsubscribe, e-mail:   
For additional commands, e-mail: 


Declarative Exception Handling

2003-01-10 Thread Suresh Addagalla
Title: Message



Hi,
 
If I 
am using Declarative exception handling, is it possible to extract some 
information from the exception object and display the same on the browser? Or is 
it that I need to use programmatic exception handling if I have such 
requirements?
 
Thanks,
Suresh
**Disclaimer

Information contained in this E-MAIL being proprietary to Wipro Limited is 
'privileged' and 'confidential' and intended for use only by the individual
 or entity to which it is addressed. You are notified that any use, copying 
or dissemination of the information contained in the E-MAIL in any manner 
whatsoever is strictly prohibited.

***


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 


Validator Question

2003-01-09 Thread Suresh Addagalla
Title: Message



Hi,
 
I need 
to validate that the user does not enter only spaces in a particular text field. 
Validator framework doesn't seem to providing any validation directly to achieve 
this. Do I need to write custom _javascript_, or is something already 
available?
 
Thanks,
Suresh
**Disclaimer** 
   
 
 Information contained in this E-MAIL being proprietary to Wipro Limited is 
'privileged' 
and 'confidential' and intended for use only by the individual or entity to which it 
is 
addressed. You are notified that any use, copying or dissemination of the information 
contained in the E-MAIL in any manner whatsoever is strictly prohibited.







--
To unsubscribe, e-mail:   
For additional commands, e-mail: 


problem with bean:define (with error)

2003-01-09 Thread Suresh Addagalla
Title: Message



Hi,
 
I have 
a small problem, which I need to address urgently.
 
I have 
a Vector and am using  to iterate through each element. I 
want to define each element as a bean inside the iterate tag. Is this 
possible?
 
I am 
trying the following, but it gives an error:
 

From the form bean, 
I am accessing serviceObject, which is a java.util.Vector.
    
Defining the current element of the iteration as a bean using 
the "id" defined in logic:iterate
 
    
    
Retrieving the code and name attributes of 
the bean    

 
Do I anywhere need to mention the type of objects contained in the 
Vector?
 
org.apache.jasper.JasperException: Cannot find bean under name 
org.apache.struts.taglib.html.BEAN	at 
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:248)	at 
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:289)	at 
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:240)
 
Thanks,
Suresh
**Disclaimer

Information contained in this E-MAIL being proprietary to Wipro Limited is 
'privileged' and 'confidential' and intended for use only by the individual
 or entity to which it is addressed. You are notified that any use, copying 
or dissemination of the information contained in the E-MAIL in any manner 
whatsoever is strictly prohibited.

***


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 


problem with bean:define

2003-01-09 Thread Suresh Addagalla
Title: Message



Hi,
 
I have 
a small problem, which I need to address urgently.
 
I have 
a Vector and am using  to iterate through each element. I 
want to define each element as a bean inside the iterate tag. Is this 
possible?
 
I am 
trying the following, but it gives an error:
 

From the form bean, 
I am accessing serviceObject, which is a java.util.Vector.
    
Defining the current element of the iteration as a bean using 
the "id" defined in logic:iterate
 
    
    
Retrieving the code and name attributes of 
the bean    

Do I anywhere need to mention the type of objects contained in the 
Vector?
 
Thanks,
Suresh
**Disclaimer

Information contained in this E-MAIL being proprietary to Wipro Limited is 
'privileged' and 'confidential' and intended for use only by the individual
 or entity to which it is addressed. You are notified that any use, copying 
or dissemination of the information contained in the E-MAIL in any manner 
whatsoever is strictly prohibited.

***


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 


RE: Passing data to presentation objects

2003-01-09 Thread Suresh Addagalla
Hi,

In your example, Struts knows about the implementing class for the
form-property bean (ManagerNewsView). Is it necessary and how can we
avoid?





Thanks,
Suresh

>-Original Message-
>From: VEDRE, RANAPRATAP REDDY [mailto:[EMAIL PROTECTED]] 
>Sent: Wednesday, January 08, 2003 6:43 PM
>To: 'Suresh Addagalla '; '[EMAIL PROTECTED] '
>Subject: RE: Passing data to presentation objects
>
>
> 
> This is how i use value objects.
>
> I have a property in my form called view.  It is user written 
>class and
>contains all the information that needs to be available in the jsp.
>This view object has to be initialized in ur action class 
>before forwarding
>to the jsp.
>
>I find this especially useful when there is a lot of information to be
>obtained from a database, to be displayed in a jsp. ActionForm 
>contains only
>the fields that the user enters/submits in the html form/page 
>and all other
>data is embedded in the view class.
>
>lets say u have have a couple of vectors(Containers) to be 
>initialised from
>the database for rendering select boxes.
>
>You can store the vectors int the form, or add each vector 
>seperately to the
>request object.
>
>By using a view class which contains two vectors as member variables.
>you have to create an instance of the view class and call the 
>set methods to
>initialize the two vectors in the instance and then set the ActionsForm
>"view" attribute with this instance.
>Then in ur jsp,get the view instance from the form and the 
>vectors from it
>using  tag or something similar.
>
>It is  bit more work than adding the vector objects directly 
>to the request.
>but it has the advantage in that u can easily see which view 
>objects are
>used for an Action or JSP just by looking at the form declarations in
>struts-config.xml(if u are using dynamic forms)
>
>-Rana.
>
>Sample form declaration using a view attribute.
>
>
>type="org.apache.struts.validator.DynaValidatorForm">
>  type="java.lang.String"/>
>  
>  
>  type="edu.sc.asg.manager.view.ManagerNewsView"/>
>  
>
>
>-Original Message-
>From: Suresh Addagalla
>To: [EMAIL PROTECTED]
>Sent: 1/8/2003 6:31 AM
>Subject: Passing data to presentation objects
>
>Hi,
>
>I have been reading a lot of material on Struts, but I could not get
>answer to my question.
>
>What is the recommended strategy (or a design pattern) to pass data to
>the view objects (JSPs in my case)?
>
>One reply I got is to use the form-beans associated with the actions to
>pass data to the JSPs. I found some situations when this did not work
>well (for example, I faced this problem when I am trying to 
>use the same
>form-bean for populating data as well as editing/submitting a form).
>
>What are "value objects" and how are they useful in passing data? Can
>someone refer me to a good resource on knowing more about this? Any
>examples would be highly useful.
>
>Also, is there any sample application I can download and which can be
>used as sort of a reference for common tasks required for struts
>programming?
>
>Thanks,
>Suresh


**Disclaimer** 
   
 
 Information contained in this E-MAIL being proprietary to Wipro Limited is 
'privileged' 
and 'confidential' and intended for use only by the individual or entity to which it 
is 
addressed. You are notified that any use, copying or dissemination of the information 
contained in the E-MAIL in any manner whatsoever is strictly prohibited.







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


Application scope variables

2003-01-08 Thread Suresh Addagalla
Title: Message



Hi,
 
I have 
a few options for storing application level data, and need your opinions on 
deciding on a strategy.
 
My 
requirement is to load a couple of properties files in the application startup 
and to be able to access them across all classes and JSPs in the web 
application.
 
1. 
Using the ServletContext of ActionServlet
2. 
Using the pageContext of JSP (PageContext.APPLICATION_SCOPE)
3. 
Using JSTL  tag (Does Struts provide a similar 
tag?)
4. Any 
other..
 
If I 
use 2 or 3, will I able able to access a property in, say, the execute 
method of an Action class? What's the best way to do 
this?
 
Thanks,
Suresh
**Disclaimer

Information contained in this E-MAIL being proprietary to Wipro Limited is 
'privileged' and 'confidential' and intended for use only by the individual
 or entity to which it is addressed. You are notified that any use, copying 
or dissemination of the information contained in the E-MAIL in any manner 
whatsoever is strictly prohibited.

***


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 


RE: Call Struts Action from JS

2003-01-08 Thread Suresh Addagalla
Hi,

IE 5.0 seems to be treating document.forms[0].action as an "Object",
where as, earlier I used it directly set an URL string many times. Any
ideas?

Suresh

>-Original Message-
>From: Siggelkow, Bill [mailto:[EMAIL PROTECTED]] 
>Sent: Wednesday, January 08, 2003 9:54 PM
>To: 'Struts Users Mailing List'
>Subject: RE: Call Struts Action from JS
>
>
>Also, I meant to say that the error from IE is saying that in 
>its DOM it doesn't have the property you are referring to.  If 
>the formObject is actually the form itself then eliminate the 
>'form' property ... in other words, you would have:
>
>formObject.action="<%=request.getContextPath()%>/getAccounts.do";
>formObject.submit();
>
>-Original Message-
>From: Siggelkow, Bill [mailto:[EMAIL PROTECTED]]
>Sent: Wednesday, January 08, 2003 11:20 AM
>To: 'Struts Users Mailing List'
>Subject: RE: Call Struts Action from JS
>
>
>What type of object is formObject?  That is, how are you 
>calling this function (e.g. from onclick? or some other event handler).
>
>If 'formObject' is actually the 'document' then you would do 
>something like ...
>
>  
>formObject.forms[0].action="<%=request.getContextPath()%>/getAc
>counts.do";
>  formObject.forms[0].submit();
>
>or if the form were named 'myForm' you could use ...
>
>  
>formObject.myForm.action="<%=request.getContextPath()%>/getAcco
>unts.do";
>  formObject.myForm.submit();
>
>Also, I am curious as to why you are needing to set the action 
>via JavaScript when it doesn't seem like it is dynamic?  Even 
>if you submit using the submit() method of Form it will still 
>use the action that is specified for the form tag.
>
>Another thing to keep in mind is that calling 'submit()' will 
>not invoke any onsubmit event handlers if you have them.  In 
>general, I don't like using the 'submit()' method but 
>sometimes it is unavoidable.
>
>-Original Message-
>From: Gus Delgado [mailto:[EMAIL PROTECTED]]
>Sent: Wednesday, January 08, 2003 10:51 AM
>To: Struts Users Mailing List
>Subject: Call Struts Action from JS
>
>
>when I call an action from JavaScript like this, it works fine under 
>Mozilla (Netscape) but I get a warning under IE, any ideas how to get 
>around that popup.
>
>Error: "Object does not support this property of method" on the line 
>that I call the struts action.  
>
>If I select no on the popup it will give me the response but I 
>want the 
>popup not to show, any ideas?  Thanks.
>
>
>function setNav(formObject)
>  {
>//alert ("FormObject: " + formObject );
>
>formObject.form.action="<%=request.getContextPath()%>/getAccounts.do";
>formObject.form.submit();
>  }
>
>
>
>
>--
>To unsubscribe, e-mail:   
>[EMAIL PROTECTED]>
>For 
>additional commands, 
>e-mail: 
>
>--
>To unsubscribe, e-mail:   
>[EMAIL PROTECTED]>
>For 
>additional commands, 
>e-mail: 
>
>--
>To unsubscribe, e-mail:   
>[EMAIL PROTECTED]>
>For 
>additional commands, 
>e-mail: 
>


**Disclaimer** 
   
 
 Information contained in this E-MAIL being proprietary to Wipro Limited is 
'privileged' 
and 'confidential' and intended for use only by the individual or entity to which it 
is 
addressed. You are notified that any use, copying or dissemination of the information 
contained in the E-MAIL in any manner whatsoever is strictly prohibited.




--
To unsubscribe, e-mail:   
For additional commands, e-mail: 


RE: 'collection' dropdown trouble

2003-01-08 Thread Suresh Addagalla
Example:







Here, servicesForm is the bean and it has a property called services of
type Vector. The "services" property contains a list of objects for whom
get/set methods are defined on "code" and "name" properties again.

Suresh

>-Original Message-
>From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] 
>Sent: Wednesday, January 08, 2003 5:25 PM
>To: [EMAIL PROTECTED]
>Subject: 'collection' dropdown trouble
>
>
>Hi,
>
>I'm a STRUTS newbie and I've been trying to get a 'collection' 
>dropdown to
>work for what must be a couple of weeks now...
>
>The code I'm using to display the dropdown in my JSP is:
>
>
>   labelProperty="value"/>
>
>
>Then my getter and setter methods are:
>
> public Vector getMemPeriodFromMonths() {
>
> for (int i=1; i <= 12; i++) {
> memPeriodFromMonths.add(getMonthName (i));
> }
>
> return memPeriodFromMonths;
> }
>
>public void setMemPeriodFromMonths(String newMemPeriodFromMonths) {
>
>memPeriodFromMonths = newMemPeriodFromMonths;
>
>  }
>
>public String getMonthName (int monthNumber) {
>
>  String strReturn = "";
>  switch (monthNumber){
>
>  case 1:
>  strReturn = "Jan";
>  break;
>case 2:
>  strReturn = "Feb";
>  break;
>  case 3:
>  strReturn = "Mar";
>  break;
>  case 4:
>  strReturn = "Apr";
>  break;
>  case 5:
>  strReturn = "May";
>  break;
>  case 6:
>  strReturn = "Jun";
>  break;
>  case 7:
>  strReturn = "Jul";
>  break;
>  case 8:
>  strReturn = "Aug";
>  break;
>  case 9:
>  strReturn = "Sep";
>  break;
>  case 10:
>  strReturn = "Oct";
>  break;
>  case 11:
>  strReturn = "Nov";
>  break;
>  case 12:
>  strReturn = "Dec";
>  break;
>  }
>
>  return strReturn;
>
>  }
>
>
>Can anyone tell me what I'm doing wrong? Or mail me working 
>sample code so
>I can compare?
>
>Thanks,
>David
>
>
>This message is for the designated recipient only and may contain
>privileged, proprietary, or otherwise private information.  If you have
>received it in error, please notify the sender immediately and 
>delete the
>original.  Any other use of the email by you is prohibited.
>
>
>--
>To unsubscribe, e-mail:   
>[EMAIL PROTECTED]>
>For 
>additional commands, 
>e-mail: 
>


**Disclaimer** 
   
 
 Information contained in this E-MAIL being proprietary to Wipro Limited is 
'privileged' 
and 'confidential' and intended for use only by the individual or entity to which it 
is 
addressed. You are notified that any use, copying or dissemination of the information 
contained in the E-MAIL in any manner whatsoever is strictly prohibited.







--
To unsubscribe, e-mail:   
For additional commands, e-mail: 


Passing data to presentation objects

2003-01-08 Thread Suresh Addagalla
Hi,

I have been reading a lot of material on Struts, but I could not get
answer to my question.

What is the recommended strategy (or a design pattern) to pass data to
the view objects (JSPs in my case)?

One reply I got is to use the form-beans associated with the actions to
pass data to the JSPs. I found some situations when this did not work
well (for example, I faced this problem when I am trying to use the same
form-bean for populating data as well as editing/submitting a form).

What are "value objects" and how are they useful in passing data? Can
someone refer me to a good resource on knowing more about this? Any
examples would be highly useful.

Also, is there any sample application I can download and which can be
used as sort of a reference for common tasks required for struts
programming?

Thanks,
Suresh


**Disclaimer** 
   
 
 Information contained in this E-MAIL being proprietary to Wipro Limited is 
'privileged' 
and 'confidential' and intended for use only by the individual or entity to which it 
is 
addressed. You are notified that any use, copying or dissemination of the information 
contained in the E-MAIL in any manner whatsoever is strictly prohibited.







--
To unsubscribe, e-mail:   
For additional commands, e-mail: 


RE: Problem with form submission

2003-01-08 Thread Suresh Addagalla
Hi,

Attached is services.jsp. It mainly access the form-bean containing two
Vector and displays two combo boxes.

The flow is as follows. 

services.do populates the 2 vectors in servicesForm (DynaActionForm) and
forwards to services.jsp. Services.jsp accesses the servicesForm and
displays the contents of 2 vectors as two combo boxes. When the user
selects one entry from the first combo box, I need to submit this so
that the second combo box is updated as per the selection made in the
first combo box. For this, I am submitting to searchServices.do, which
is associated with searchServicesForm (again a DynaActionForm with two
String varaiables for holding the selections from two combo boxes).

Thanks,
Suresh

>-Original Message-
>From: Iris [mailto:[EMAIL PROTECTED]] 
>Sent: Wednesday, January 08, 2003 2:07 PM
>To: Struts Users Mailing List
>Subject: Re: Problem with form submission
>
>
>What is your jsp code ?
>
>Suresh Addagalla wrote:
>
>> Hi,
>>  
>> I am facing a problem when submitting a form which contains a combo 
>> box ("select").
>>  
>> While populating the combo box, I use a form-bean (DynaActionForm) 
>> containing a Vector to populate the combo box. When I submit 
>the form 
>> (to the same action so that the same page is displayed with a 
>> different list), the selected value goes as a String. Struts 
>is trying 
>> to assign this *String* to the *Vector* and it's throwing the 
>> following error:
>>  
>> org.apache.commons.beanutils.ConversionException: Cannot 
>assign value 
>> of type 'java.lang.String' to property 'serviceSets' of type 
>> 'java.util.Vector'
>> Any help is greatly appreciated.
>>  
>> Thanks,
>> Suresh
>>
>>  
>>
>>--
>--
>>
>>--
>>To unsubscribe, e-mail:   
><mailto:struts-user->[EMAIL PROTECTED]>
>>For 
>additional commands, 
>e-mail: <mailto:[EMAIL PROTECTED]>
>>
>
>
>
>
>--
>To unsubscribe, e-mail:   
><mailto:struts-user->[EMAIL PROTECTED]>
>For 
>additional commands, 
>e-mail: <mailto:[EMAIL PROTECTED]>
>



services.jsp
Description: Binary data
**Disclaimer

Information contained in this E-MAIL being proprietary to Wipro Limited is 
'privileged' and 'confidential' and intended for use only by the individual
 or entity to which it is addressed. You are notified that any use, copying 
or dissemination of the information contained in the E-MAIL in any manner 
whatsoever is strictly prohibited.

***


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


Problem with form submission

2003-01-08 Thread Suresh Addagalla
Title: Message



Hi,
 
I am 
facing a problem when submitting a form which contains a combo box 
("select").
 
While 
populating the combo box, I use a form-bean (DynaActionForm) containing a Vector 
to populate the combo box. When I submit the form (to the same action so that 
the same page is displayed with a different list), the selected value goes as a 
String. Struts is trying to assign this String to the 
Vector and it's throwing the following 
error:
 
org.apache.commons.beanutils.ConversionException: Cannot assign value 
of type 'java.lang.String' to property 'serviceSets' of type 
'java.util.Vector'
Any 
help is greatly appreciated.
 
Thanks,
Suresh
**Disclaimer

Information contained in this E-MAIL being proprietary to Wipro Limited is 
'privileged' and 'confidential' and intended for use only by the individual
 or entity to which it is addressed. You are notified that any use, copying 
or dissemination of the information contained in the E-MAIL in any manner 
whatsoever is strictly prohibited.

***


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 


Validator problem

2003-01-07 Thread Suresh Addagalla
Title: Message



Hi,
 
I am doing client-side 
validations using Validator framework. If I click on the submit button, the form 
is getting submitted even if there are errors in the form. How can I stop the 
form from being submitted when there are errors? _javascript_ alerts are being 
shown properly, but when I click on the OK button, I want the form to remain 
unsubmitted.
 
I am using 
onsubmit="validateLoginForm(this) in  tag and am 
including
 

 
before closing the 
 tag.
 
Thanks,
Suresh
**Disclaimer

Information contained in this E-MAIL being proprietary to Wipro Limited is 
'privileged' and 'confidential' and intended for use only by the individual
 or entity to which it is addressed. You are notified that any use, copying 
or dissemination of the information contained in the E-MAIL in any manner 
whatsoever is strictly prohibited.

***


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 


problem with

2003-01-07 Thread Suresh Addagalla
Title: Message



Hi,
 
I have a DynaActionForm, 
which has 2 form-property elements. I am using this form-bean to retrieve two 
different lists as follows.
 
   
   

From the jsp, I am trying to retrieve 
the two Vectors as follows.
 

 
However, I am not able to define the 
second bean in the same JSP page. I found the following in Struts User Guide. 
Please let me know if any one knows of an alternate solution.
USAGE NOTE - There is a restriction in the JSP 1.1 
Specification that disallows using the same value for an id 
attribute more than once in a single JSP page. Therefore, you will not be able 
to use  for the same bean name more than once in 
a single page.
See the Bean Developer's Guide section on bean 
creation for more information about these differences, as well as 
alternative approaches to introducing beans into a JSP page.
Thanks,
Suresh
**Disclaimer** 
   
 
 Information contained in this E-MAIL being proprietary to Wipro Limited is 
'privileged' 
and 'confidential' and intended for use only by the individual or entity to which it 
is 
addressed. You are notified that any use, copying or dissemination of the information 
contained in the E-MAIL in any manner whatsoever is strictly prohibited.







--
To unsubscribe, e-mail:   
For additional commands, e-mail: 


RE: Struts equivalent of if...else (newbie)

2003-01-06 Thread Suresh Addagalla
Thanks, that helps.

Suresh

>-Original Message-
>From: David M. Karr [mailto:[EMAIL PROTECTED]] 
>Sent: Tuesday, January 07, 2003 1:01 PM
>To: [EMAIL PROTECTED]
>Subject: Re: Struts equivalent of if...else (newbie)
>
>
>>>>>> "Suresh" == Suresh Addagalla <[EMAIL PROTECTED]> writes:
>
>Suresh> Hi,
>Suresh> Here is my code snippet. Basically, I am not sure 
>which attribute of
>Suresh> "logic:equal" I have to use for scriptlet 
>variables. It's printing "No"
>Suresh> and as per my requirements, it should be "Yes".
>
>Suresh><%! String curr="Tracking"; %>
>
>Suresh>
>Suresh>Yes
>Suresh>
>
>Suresh>
>Suresh>No
>Suresh>
>
>There is no variant of "logic:equal" which compares the value 
>against an
>arbitrary expression.  You can compare the value against a 
>cookie, header,
>request parameter, or bean property.
>
>Your options are:
>
>1. Use a pure scriptlet to do the comparison.
>2. Use either "c:if" or "c:choose/c:when" from the JSTL.
>
>-- 
>===
>David M. Karr  ; Java/J2EE/XML/Unix/C++
>[EMAIL PROTECTED]   ; SCJP; SCWCD
>
>
>
>
>--
>To unsubscribe, e-mail:   
><mailto:struts-user->[EMAIL PROTECTED]>
>For 
>additional commands, 
>e-mail: <mailto:[EMAIL PROTECTED]>
>


**Disclaimer

Information contained in this E-MAIL being proprietary to Wipro Limited is 
'privileged' and 'confidential' and intended for use only by the individual
 or entity to which it is addressed. You are notified that any use, copying 
or dissemination of the information contained in the E-MAIL in any manner 
whatsoever is strictly prohibited.

***


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


Struts Exception

2003-01-06 Thread Suresh Addagalla
Hi,

I got the following exception when I replaced the struts.jar of 1.0 with
1.1 beta 2. Probably this is a well-known exception, but I couldn't
isolate the error. I've validated the struts-config.xml file with Struts
Console 3.1 and it seems to be fine as per the 1.1 DTD. Pls find my
struts-config.xml content below this exception.


org.apache.jasper.JasperException: Cannot retrieve ActionMappings under
key "org.apache.struts.action.MAPPINGS"
at
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.ja
va:248)
at
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:289)
at
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:240)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applica
tionFilterChain.java:247)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilt
erChain.java:193)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValv
e.java:260)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.i
nvokeNext(StandardPipeline.java:643)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:4
80)
at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValv
e.java:191)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.i
nvokeNext(StandardPipeline.java:643)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:4
80)
at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at
org.apache.catalina.core.StandardContext.invoke(StandardContext.java:239
6)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java
:180)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.i
nvokeNext(StandardPipeline.java:643)
at
org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherVa
lve.java:170)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.i
nvokeNext(StandardPipeline.java:641)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java
:172)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.i
nvokeNext(StandardPipeline.java:641)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:4
80)
at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.
java:174)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.i
nvokeNext(StandardPipeline.java:643)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:4
80)
at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at
org.apache.ajp.tomcat4.Ajp13Processor.process(Ajp13Processor.java:458)
at
org.apache.ajp.tomcat4.Ajp13Processor.run(Ajp13Processor.java:551)
at java.lang.Thread.run(Thread.java:536)

struts-config.xml===



http://jakarta.apache.org/struts/dtds/struts-config_1_1.dtd";>












   



































 







 

















  
  
  
  
  




  

  

  



  






Thanks,
Suresh


**Disclaimer

Information contained in this E-MAIL being proprietary to Wipro Limited is 
'privileged' and 'confidential' and intended for use only by the individual
 or entity to which it is addressed. You are notified that any use, copying 
or dissemination of the information contained in the E-MAIL in any manner 
whatsoever is strictly prohibited.

***


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 


RE: Struts equivalent of if...else (newbie)

2003-01-06 Thread Suresh Addagalla
Hi,

Here is my code snippet. Basically, I am not sure which attribute of
"logic:equal" I have to use for scriptlet variables. It's printing "No"
and as per my requirements, it should be "Yes".

<%! String curr="Tracking"; %>


Yes



No


Thanks,
Suresh

>-Original Message-
>From: David M. Karr [mailto:[EMAIL PROTECTED]] 
>Sent: Monday, January 06, 2003 9:23 PM
>To: [EMAIL PROTECTED]
>Subject: Re: Struts equivalent of if...else (newbie)
>
>
>>>>>> "Suresh" == Suresh Addagalla <[EMAIL PROTECTED]> writes:
>
>Suresh> Sorry for the haste..
>Suresh> Logic:equal doesn't seem to be working with local 
>variables...
>
>The "logic:equal" tag should work fine with scripting 
>variables defined by
>scriptlets.  You'd have to show us your code for us to 
>determine what's wrong.
>
>-- 
>===
>David M. Karr  ; Java/J2EE/XML/Unix/C++
>[EMAIL PROTECTED]   ; SCJP; SCWCD


**Disclaimer** 
   
 
 Information contained in this E-MAIL being proprietary to Wipro Limited is 
'privileged' 
and 'confidential' and intended for use only by the individual or entity to which it 
is 
addressed. You are notified that any use, copying or dissemination of the information 
contained in the E-MAIL in any manner whatsoever is strictly prohibited.







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


RE: Struts equivalent of if...else (newbie)

2003-01-06 Thread Suresh Addagalla
Sorry for the haste..
Logic:equal doesn't seem to be working with local variables...

Suresh

>-Original Message-
>From: Suresh Addagalla [mailto:[EMAIL PROTECTED]] 
>Sent: Monday, January 06, 2003 7:49 PM
>To: 'Struts Users Mailing List'
>Subject: RE: Struts equivalent of if...else (newbie)
>
>
>Well, as you guessed, I do have scriptlets. Now my effort is 
>to minimize
>or remove them completely.
>
>And I tried to use logic with local variables, it worked. Thanks for
>that. And still, logic:equal offers only if..then; is there any way to
>simulate if..then..else?
>
>Thanks,
>Suresh
>
>>-Original Message-
>>From: Siggelkow, Bill [mailto:[EMAIL PROTECTED]] 
>>Sent: Monday, January 06, 2003 7:41 PM
>>To: 'Struts Users Mailing List'
>>Subject: RE: Struts equivalent of if...else (newbie)
>>
>>
>>I believe that the logic tags will work with a local variable 
>>-- anyway, if you don't want to use scriptlet, how did you 
>>create the local variable in the first place?
>>
>>-Original Message-
>>From: Suresh Addagalla [mailto:[EMAIL PROTECTED]]
>>Sent: Monday, January 06, 2003 8:59 AM
>>To: [EMAIL PROTECTED]
>>Subject: Struts equivalent of if...else (newbie)
>>
>>
>>Hi,
>> 
>>I would like to know if Struts provides a custom tag for 
>>achieving if..then..else functionality.
>> 
>>I can not use logic:equal because the data for me is NOT 
>>coming from either a bean or through the request. I just need 
>>to compare a variable. Is there any option apart from writing 
>>a cryptic looking scriptlet?
>> 
>>Thanks,
>>Suresh
>>
>>
>>--
>>To unsubscribe, e-mail:   
>><mailto:struts-user->[EMAIL PROTECTED]>
>>For 
>>additional commands, 
>>e-mail: <mailto:[EMAIL PROTECTED]>
>>
>
>


**Disclaimer

Information contained in this E-MAIL being proprietary to Wipro Limited is 
'privileged' and 'confidential' and intended for use only by the individual
 or entity to which it is addressed. You are notified that any use, copying 
or dissemination of the information contained in the E-MAIL in any manner 
whatsoever is strictly prohibited.

***


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


RE: Struts equivalent of if...else (newbie)

2003-01-06 Thread Suresh Addagalla
Well, as you guessed, I do have scriptlets. Now my effort is to minimize
or remove them completely.

And I tried to use logic with local variables, it worked. Thanks for
that. And still, logic:equal offers only if..then; is there any way to
simulate if..then..else?

Thanks,
Suresh

>-Original Message-
>From: Siggelkow, Bill [mailto:[EMAIL PROTECTED]] 
>Sent: Monday, January 06, 2003 7:41 PM
>To: 'Struts Users Mailing List'
>Subject: RE: Struts equivalent of if...else (newbie)
>
>
>I believe that the logic tags will work with a local variable 
>-- anyway, if you don't want to use scriptlet, how did you 
>create the local variable in the first place?
>
>-Original Message-
>From: Suresh Addagalla [mailto:[EMAIL PROTECTED]]
>Sent: Monday, January 06, 2003 8:59 AM
>To: [EMAIL PROTECTED]
>Subject: Struts equivalent of if...else (newbie)
>
>
>Hi,
> 
>I would like to know if Struts provides a custom tag for 
>achieving if..then..else functionality.
> 
>I can not use logic:equal because the data for me is NOT 
>coming from either a bean or through the request. I just need 
>to compare a variable. Is there any option apart from writing 
>a cryptic looking scriptlet?
> 
>Thanks,
>Suresh
>
>
>--
>To unsubscribe, e-mail:   
><mailto:struts-user->[EMAIL PROTECTED]>
>For 
>additional commands, 
>e-mail: <mailto:[EMAIL PROTECTED]>
>


**Disclaimer** 
   
 
 Information contained in this E-MAIL being proprietary to Wipro Limited is 
'privileged' 
and 'confidential' and intended for use only by the individual or entity to which it 
is 
addressed. You are notified that any use, copying or dissemination of the information 
contained in the E-MAIL in any manner whatsoever is strictly prohibited.




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


Struts equivalent of if...else (newbie)

2003-01-06 Thread Suresh Addagalla
Title: Message



Hi,
 
I 
would like to know if Struts provides a custom tag for achieving if..then..else 
functionality.
 
I can 
not use logic:equal because the data for me is NOT coming from either a bean or 
through the request. I just need to compare a variable. Is there any option 
apart from writing a cryptic looking scriptlet?
 
Thanks,
Suresh
**Disclaimer** 
   
 
 Information contained in this E-MAIL being proprietary to Wipro Limited is 
'privileged' 
and 'confidential' and intended for use only by the individual or entity to which it 
is 
addressed. You are notified that any use, copying or dissemination of the information 
contained in the E-MAIL in any manner whatsoever is strictly prohibited.




--
To unsubscribe, e-mail:   
For additional commands, e-mail: 


Help needed

2003-01-06 Thread Suresh Addagalla
Title: Message



Hi,
 
I have 
a login page. If the login fails, I want to show the errors next to the specific 
field (if username is wrong, the error is shown next to username field, etc.) I 
am using programmatic exception handling.
 
    try 
{    
service.authenticate(userName, password) 
;    } catch (InvalidLoginException 
ile) 
{  
  
System.out.println("adding action errors in action class") 
;  
  
ActionErrors errors = new 
ActionErrors();  
errors.add( "userName", new ActionError("invalid.login") 
);  
saveErrors( request, errors 
);  
  
return mapping.findForward("Failure") 
;    }
 
How 
should I access these errors in my JSP to show the errors?
 
Thanks,
Suresh
**Disclaimer** 
   
 
 Information contained in this E-MAIL being proprietary to Wipro Limited is 
'privileged' 
and 'confidential' and intended for use only by the individual or entity to which it 
is 
addressed. You are notified that any use, copying or dissemination of the information 
contained in the E-MAIL in any manner whatsoever is strictly prohibited.




--
To unsubscribe, e-mail:   
For additional commands, e-mail: 


Error in getting message resouces

2003-01-06 Thread Suresh Addagalla
Hi,

I am seeing "???en_US.invalid.login???" in place of "Invalid login,
please try again" when I use  in my login.jsp.

I have put PRWPResources.properties in WEB-INF/classes directory. My
struts.config is as follows.







...



Thanks in advance,
Suresh


**Disclaimer

Information contained in this E-MAIL being proprietary to Wipro Limited is 
'privileged' and 'confidential' and intended for use only by the individual
 or entity to which it is addressed. You are notified that any use, copying 
or dissemination of the information contained in the E-MAIL in any manner 
whatsoever is strictly prohibited.

***


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 


redirect attribute (newbie)

2002-12-30 Thread Suresh Addagalla
Hi,

I have a loginAction. If login is successfu, I want to perform another
action as follows.



I am not sure whether to use true or false for "redirect". What is the
difference and which one should I use in this case?

Thanks,
Suresh


**Disclaimer

Information contained in this E-MAIL being proprietary to Wipro Limited is 
'privileged' and 'confidential' and intended for use only by the individual
 or entity to which it is addressed. You are notified that any use, copying 
or dissemination of the information contained in the E-MAIL in any manner 
whatsoever is strictly prohibited.

***


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 


Form Errors (Newbie)

2002-12-18 Thread Suresh Addagalla
Hi,

I would like to know whether the following is possible to implement with
Struts.

I display a form for creating, say, a Service. The user fills in a form.
When the form is submitted, the Validator performs the validations with
no errors. Now the control comes to the execute method. In this method,
I find that the Service Name is already present in DB. Now I need to
display the "input form" indicating along side the field that "this
Service already exists, give a different name".

Although it seems possible, the doubt I have is as follows. The input
form might have been generated based on a complex s performed
in the JSP. Now when Action encounters an error, will it be able to
display the input form in "exactly the same" state? Which means that if
the input form contains a lot of fields with specific values, do I see
the same values when it is displayed again with some errors?

Thanks for your time.

Suresh


**Disclaimer** 
   
 
 Information contained in this E-MAIL being proprietary to Wipro Limited is 
'privileged' 
and 'confidential' and intended for use only by the individual or entity to which it 
is 
addressed. You are notified that any use, copying or dissemination of the information 
contained in the E-MAIL in any manner whatsoever is strictly prohibited.







--
To unsubscribe, e-mail:   
For additional commands, e-mail: 


Form Errors (Newbie)

2002-12-18 Thread Suresh Addagalla
Title: Message



Hi,
 
I 
would like to know whether the following is possible to implement with 
Struts.
 
I 
display a form for creating, say, a Service. The user fills in a form. When the 
form is submitted, the Validator performs the validations with no errors. Now 
the control comes to the execute method. In this method, I find that the 
Service Name is already present in DB. Now I need to display the "input 
form" indicating along side the field that "this Service already exists, give a 
different name".
 
Although it seems possible, the doubt I have is as follows. The input 
form might have been generated based on a complex s performed in 
the JSP. Now when Action encounters an error, will it be able to display the 
input form in "exactly the same" state? Which means that if the input form 
contains a lot of fields with specific values, do I see the same values when it 
is displayed again with some errors?
 
Thanks 
for your time.
 
Suresh
**Disclaimer** 
   
 
 Information contained in this E-MAIL being proprietary to Wipro Limited is 
'privileged' 
and 'confidential' and intended for use only by the individual or entity to which it 
is 
addressed. You are notified that any use, copying or dissemination of the information 
contained in the E-MAIL in any manner whatsoever is strictly prohibited.







--
To unsubscribe, e-mail:   
For additional commands, e-mail: 


RE: Validator (newbie)

2002-12-18 Thread Suresh Addagalla
Hi,

Using request scope instead of session makes sense.

One question on your suggestion. Usually the form bean represents the
form data of the "previous" page. The data, which is required to be put
in the view (JSP), most probably would not be present in the form bean.
So, how can we say that using the form bean is the best idea. In the
scenario which I described, what can be the alternative and best
practise?

Thanks,
Suresh

>-Original Message-
>From: [EMAIL PROTECTED] 
>[mailto:[EMAIL PROTECTED]] 
>Sent: Wednesday, December 18, 2002 4:37 PM
>To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
>Subject: RE: Validator (newbie)
>
>
>U r first Q ,I dont know ...But abt 2nd may be i have some 
>suggestion form my 
>experience with struts ..
2. What is the standard way to pass data from Action 
>objects to the JSP
>(view)? Should the data be sent as a) Session properties, b) Some bean
>objects, or c) Data members of the Action object?
>
>GEnerally u should try to avoid using session variables.So the 
>standard way is 
>to pass the data in request scope.So if the data u want to use 
>in jsp is 
>attribute of the formBean,then as the form bean is available 
>to the jsp , u can 
>use it there...I think this keeps the design clean as the form 
>bean actually 
>represents the form data..So u dont have to look at the action 
>class to see 
>what u are trying to put on jsp..The form bean is the place... 
>
>-Original Message-
>From: suresh.addagalla [mailto:[EMAIL PROTECTED]]
>Sent: Wednesday, December 18, 2002 12:02 PM
>To: struts-user
>Subject: Validator (newbie)
>
>
>Hi,
>
>I have a couple of basic questions.
>
>1. If we use ActionForm, the ActionServlet first executes the 
>validate()
>method before calling execute() on the corresponding Action. 
>If I switch
>from ActionForms to Struts Validator (that is, use 
>ValidatorForm instead
>of ActionForm), do things work the same way? Is it that in this case
>also, ActionServlet calls the validate() just before calling the
>execute()?
>
>2. What is the standard way to pass data from Action objects to the JSP
>(view)? Should the data be sent as a) Session properties, b) Some bean
>objects, or c) Data members of the Action object?
>
>Thanks,
>Suresh
>
>


**Disclaimer** 
   
 
 Information contained in this E-MAIL being proprietary to Wipro Limited is 
'privileged' 
and 'confidential' and intended for use only by the individual or entity to which it 
is 
addressed. You are notified that any use, copying or dissemination of the information 
contained in the E-MAIL in any manner whatsoever is strictly prohibited.







--
To unsubscribe, e-mail:   
For additional commands, e-mail: 


Validator (newbie)

2002-12-18 Thread Suresh Addagalla
Hi,

I have a couple of basic questions.

1. If we use ActionForm, the ActionServlet first executes the validate()
method before calling execute() on the corresponding Action. If I switch
from ActionForms to Struts Validator (that is, use ValidatorForm instead
of ActionForm), do things work the same way? Is it that in this case
also, ActionServlet calls the validate() just before calling the
execute()?

2. What is the standard way to pass data from Action objects to the JSP
(view)? Should the data be sent as a) Session properties, b) Some bean
objects, or c) Data members of the Action object?

Thanks,
Suresh


**Disclaimer

Information contained in this E-MAIL being proprietary to Wipro Limited is 
'privileged' and 'confidential' and intended for use only by the individual
 or entity to which it is addressed. You are notified that any use, copying 
or dissemination of the information contained in the E-MAIL in any manner 
whatsoever is strictly prohibited.

***


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 


RE: Struts Validator

2002-12-17 Thread Suresh Addagalla
Hi Iris,

I came across the following excerpt from Struts kickstart:

"After moving all the properties out of the bean and into the DynaForm
definition in
struts-config.xml, the only thing left in the bean is the validate
function. By
using the Struts Validation framework, which ties into the Commons
Validator
package, you can remove this last piece of code and get rid of the form
bean."

Are we sure that we do need to define the form bean (which extends
ValidatorForm) if we use Struts Validator?

Thanks,
Suresh


>-Original Message-
>From: Iris [mailto:[EMAIL PROTECTED]] 
>Sent: Tuesday, December 17, 2002 3:12 PM
>To: Struts Users Mailing List
>Subject: Re: Struts Validator
>
>
>Suresh Addagalla wrote:
>
>>Hi,
>>
>>I'm new to Struts and am trying to get a hang of Struts Validator
>>framework.
>>
>>I defined the validator-rules.xml, application.properties,
>>validator.xml. To be able to do server-side validations, is it still
>>required to have the ActionForm class? If yes, do we need to override
>>the validate() or what exactly is needed?
>>
>Yes you need an ActionForm to describe your form (get and set).
>But you must no override the validate().
>And to use the validator, your ActionForm must extends ValidatorForm.
>
>Iris


**Disclaimer

Information contained in this E-MAIL being proprietary to Wipro Limited is 
'privileged' and 'confidential' and intended for use only by the individual
 or entity to which it is addressed. You are notified that any use, copying 
or dissemination of the information contained in the E-MAIL in any manner 
whatsoever is strictly prohibited.

***


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


RE: Struts Validator

2002-12-17 Thread Suresh Addagalla
Thanks Iris.

Could you recommend a good book (or online tutorial) for me to learn
Struts? I am going through a lot of material on the web, but more often
I am getting confused than learning something new.

Suresh

>-Original Message-
>From: Iris [mailto:[EMAIL PROTECTED]] 
>Sent: Tuesday, December 17, 2002 3:12 PM
>To: Struts Users Mailing List
>Subject: Re: Struts Validator
>
>
>Suresh Addagalla wrote:
>
>>Hi,
>>
>>I'm new to Struts and am trying to get a hang of Struts Validator
>>framework.
>>
>>I defined the validator-rules.xml, application.properties,
>>validator.xml. To be able to do server-side validations, is it still
>>required to have the ActionForm class? If yes, do we need to override
>>the validate() or what exactly is needed?
>>
>Yes you need an ActionForm to describe your form (get and set).
>But you must no override the validate().
>And to use the validator, your ActionForm must extends ValidatorForm.
>
>Iris
>
>
>
>--
>To unsubscribe, e-mail:   
><mailto:struts-user->[EMAIL PROTECTED]>
>For 
>additional commands, 
>e-mail: <mailto:[EMAIL PROTECTED]>
>


**Disclaimer** 
   
 
 Information contained in this E-MAIL being proprietary to Wipro Limited is 
'privileged' 
and 'confidential' and intended for use only by the individual or entity to which it 
is 
addressed. You are notified that any use, copying or dissemination of the information 
contained in the E-MAIL in any manner whatsoever is strictly prohibited.







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


Struts Validator

2002-12-17 Thread Suresh Addagalla
Hi,

I'm new to Struts and am trying to get a hang of Struts Validator
framework.

I defined the validator-rules.xml, application.properties,
validator.xml. To be able to do server-side validations, is it still
required to have the ActionForm class? If yes, do we need to override
the validate() or what exactly is needed?

Thanks,
Suresh


**Disclaimer** 
   
 
 Information contained in this E-MAIL being proprietary to Wipro Limited is 
'privileged' 
and 'confidential' and intended for use only by the individual or entity to which it 
is 
addressed. You are notified that any use, copying or dissemination of the information 
contained in the E-MAIL in any manner whatsoever is strictly prohibited.







--
To unsubscribe, e-mail:   
For additional commands, e-mail: