Struts question

2002-01-06 Thread Gupta

Hi,

How do i call a jsp usebean property value in another jsp tag?
Problem Case:
I have an html:hidden element and I want to replace
"<%=transBean.getTransID()%>" by using  in below statement,

   

I failed to get the result by coding the below statement:

 " />
The jsp is not parsing the statement full.

TAI
RAYAKU


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




Struts logic tag lib question

2002-01-06 Thread Gupta

> Hi,
>
> I am here again,
>
> Is there any way to compare an object is null??
if( myObject==null){  ]
> using struts logic tag.
>
> TAI
> RAYAKU


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




Re: Struts Validator Load Failure

2002-01-06 Thread @Basebeans.com

Subject: Re: Struts Validator Load Failure
From: "Paul Heath" <[EMAIL PROTECTED]>
 ===
The same validation.xml works in the Tomcat environment with the same
commons, struts, tiles & validator jars.

Do I need to be including jaxp or xerces in my classpath as well ?  FYI - My
app server is SilverStream 3.7.3


"Steven D. Wilkinson" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]...
> I haven't used the validator, but that is a Digester error.  I would
> guess that something is wrong in the validation.xml file.
>
> "Struts Newsgroup @Basebeans.com" wrote:
> >
> > Subject: Struts Validator Load Failure
> > From: "Paul Heath" <[EMAIL PROTECTED]>
> >  ===
> > The following is a partial stack trace of when the app server tries to
load
> > Struts Validator.
> >
> > I have the latest version of Digester (v1.1.1) and Struts Validator in
my
> > classpath.
> >
> > Anyone know how to fix this:
> >
> > java.lang.NoSuchMethodError
> >
> >  at org.apache.commons.digester.Digester.getReader(Digester.java:527)
> >  at org.apache.commons.digester.Digester.parse(Digester.java:1206)
> >  at
> >
com.wintecinc.struts.validation.ValidatorResourcesInitializer.initialize(Val
> > idatorResourcesInitializer.java:237)
> >  at
> >
com.wintecinc.struts.validation.ValidatorResourcesInitializer.initialize(Val
> > idatorResourcesInitializer.java:123)
> >  at
> >
com.wintecinc.struts.action.ValidatorServlet.initMapping(ValidatorServlet.ja
> > va:223)
> >  at
> >
com.wintecinc.struts.action.ValidatorServlet.init(ValidatorServlet.java:123)
> >  at javax.servlet.GenericServlet.init(GenericServlet.java:258)
> >
> > --
> > To unsubscribe, e-mail:

> > For additional commands, e-mail:

>
> --
> To unsubscribe, e-mail:

> For additional commands, e-mail:

>



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




Re: The encoding "Cp1252" is not supported.

2002-01-06 Thread Reid Pinchback


 
  Anna Chen <[EMAIL PROTECTED]> wrote: 
Any one has idea about this error?

FATAL: configuration error

org.xml.sax.SAXParseException: The encoding "Cp1252" is not supported.

I don't know why you are getting the error, but Cp1252 is the default character 
encoding for the assorted java.io reader classes on Win32 JVMs.

 



-
Do You Yahoo!?
Send FREE video emails in Yahoo! Mail.


Re: javax.servlet.ServletException: Cannot find message resources under key org.apache.struts.action.MESSAGE

2002-01-06 Thread Reid Pinchback


   Jack <[EMAIL PROTECTED]> wrote: 
What causes this exception: javax.servlet.ServletException: Cannot find
message resources under key org.apache.struts.action.MESSAGE?

I ran into this repeatedly trying to get Struts working within JBuilder.
I found two things I had to fix:

1. Never rename 'struts.jar' (otherwise you break the OpenTool for JBuilder
that removes Struts from the classpath before launching Tomcat)

2. Use the load-on-startup tag in web.xml (it shouldn't be necessary, and
isn't if you deploy to a Tomcat server, but for some oddball reason seemed
to sometimes matter when using the Tomcat integrated with JBuilder).

 

 

 



-
Do You Yahoo!?
Send FREE video emails in Yahoo! Mail.


"Back" button

2002-01-06 Thread George White

Hi everyone,

Does anyone know how to code a "Back" button -- one that works like the I.E. "Back" 
toolbar button?
I currently use one that requires JavaScript and would like to switch to one that 
works with Struts/JSP but is not dependent upon JavaScript.

Thanks.
George





RE: JavaScript -- use or not use???

2002-01-06 Thread charles arehart

I'll just add that it's a shame to throw the baby out with the bathwater,
avoiding use of JavaScript altogether. Yes, the cross-browser issues are
real, for even reasonably substantial use. But there are lots of things one
can do that are simple yet supported in the oldest implementations of
JavaScript and therefore reasonably safe in all browsers.

Also, not every use of JavaScript will cause great harm if the browser
doesn't support it. For instance, one feature I often stress is the focus()
method for putting the cursor into a field on a page (like a search form)
where the user would naturally have to do that themselves. It saves them
mousing to it, or tabbing perhaps several times.

Indeed, this is the subject of an article I've written in the January Java
Developers Journal magazine. You can see it online, "Getting Focus()ed--and
a Quick JavaScript Lesson", at
http://www.sys-con.com/java/articlea.cfm?id=1272

/charlie

PS There are books that do a good job of helping identify how to write
better cross-browser scripts, or at least being more aware of the browser
support of given objects, properties and methods, such as Danny Goodman's
O'Reilly title, "Dynamic HTML, The Definitive Reference", as well as his
"JavaScript Bible" and David Flanagan's O'Reilly title "JavaScript: The
Definitive Guide".

-Original Message-
From: Steven D. Wilkinson [mailto:[EMAIL PROTECTED]]
Sent: Sunday, January 06, 2002 6:37 PM
To: Struts Users Mailing List
Subject: Re: JavaScript -- use or not use???


Personally, I believe that only people that are very computer savy do
this.

However, another reason to avoid JavaScript in validation is if your
application can have an interface other than the web.  If the validation
in on the server then the interface could be anything.  For example, WAP
and standard GUI clients don't use JavaScript.

On the otherhand, if you say well it's only a web application then you
have to deal with how JavaScript is implemented in each browser.  The
differences between IE and Netscape are real and it's best to avoid this
by doing server side validation. At least that's my view on the subject.

Steve

George White wrote:
>
> Hi folks,
>
>  This isn't exactly a struts question but I have seen comments about
JavaScript often enough I was hoping someone could answer this very general
question.
> The people I work use struts but are avoiding JavaScript because they say
that some clients may have JavaScript functionality turned off on their
browsers.
> I use I.E. 5.0 and cannot see where I can turn JavaScript "off".
> Is this a valid concern (in other browsers such as Netscape, as well) and
if so how/where can JavaScript be turned "off"?
>
> Thanks much,
> George

--
To unsubscribe, e-mail:

For additional commands, e-mail:




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




Re: Creating reports in PDF format

2002-01-06 Thread Ted Husted

Ajay Chitre wrote:
> I know this is probably going to sound stupid, but I have to ask - Is there
> a platform independent product that will allow me to create a report in
> Excel format?  Once the report is created on the server I can let the user
> download it via browser.  Has anybody done anything like this?

Take a look at poi.sourceforge.net 

There's talk of donating it to Jakarta. 

-Ted.

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




RE: Struts with BES 5.0 problem

2002-01-06 Thread Mark Whelan

Thanks for the replies Steve, Mark.

Borland Enterprise Server 5.0 is running JDK 1.3.1 and Tomcat 4.0.1. The
struts web app I'm deploying is the struts/velocity example from Ted, and
has the updated struts and commons-disgester. It would seem this combination
should be ok, any other ideas?

Mark

> -Original Message-
> From: Steven D. Wilkinson [mailto:[EMAIL PROTECTED]]
>
> There is a new version of the Digester in the jakarta-commons 
> project. 
> You may want to look there also.
> 
> I'm using the Digester from CVS (updated in December 2001) with:
> 
> Tomcat 4.0.1
> JDK1.3.1
> struts from CVS (updated in December 2001)
> 
> And I had had no problem.
> Note, the Digester in the release version of struts will not used
> anymore.  It has been moved to the commons project along with other
> things in struts.  There are some code changes to the 
> digester since it
> was moved out of struts.  The next release of struts (don't ask when,
> cause no one knows yet) will use the commons version of the Digester.
> 
> Steve
> 
> 
> Mark Gordon wrote:
> > 
> > I don't have a full answer for you, just some info.
> > 
> > I have had problem with the digester (this seems to be where you are
> > having problems also) with the following configuration:
> > 
> > JDK 1.4.0b?
> > Apache (latest version ...not sure exactly)
> > mod_webapp (latest version)
> > Tomcat 4.0.1 (I think latest version)
> > Red Hat 7.2
> > 
> > I had trouble parsing most XML documents.
> > 
> > If I ran without apache & mod_webapp and just tomcat 
> serving the HTTP it
> > could parse the xml and deploy my webapp.
> > 
> > If I went back to JDK1.3.1 I also could deploy the webapp 
> (using apache
> > & tomcat or just tomcat).
> > 
> > Not sure what all this means. just that it has 
> something to do with
> > the new XML parsers included with JDK1.4.0.
> > 
> > I think the digester has some debugging that may help.  I 
> had to hack
> > the struts code to turn it on.  If you are using jdk1.4, 
> fall back to jdk1.3
> > 
> > Sorry I can't be of more help.
 
The contents of this e-mail (including any attachments) are intended only
for the person or entity to which this e-mail is addressed and may contain
confidential, privileged and/or commercially sensitive material.  If you are
not, or believe you may not be, the intended recipient, please advise the
sender immediately by return e-mail, delete this e-mail and destroy any
copies.



Re: JavaScript -- use or not use???

2002-01-06 Thread Steven D. Wilkinson

Personally, I believe that only people that are very computer savy do
this.

However, another reason to avoid JavaScript in validation is if your
application can have an interface other than the web.  If the validation
in on the server then the interface could be anything.  For example, WAP
and standard GUI clients don't use JavaScript.

On the otherhand, if you say well it's only a web application then you
have to deal with how JavaScript is implemented in each browser.  The
differences between IE and Netscape are real and it's best to avoid this
by doing server side validation. At least that's my view on the subject.

Steve

George White wrote:
> 
> Hi folks,
> 
>  This isn't exactly a struts question but I have seen comments about JavaScript 
>often enough I was hoping someone could answer this very general question.
> The people I work use struts but are avoiding JavaScript because they say that some 
>clients may have JavaScript functionality turned off on their browsers.
> I use I.E. 5.0 and cannot see where I can turn JavaScript "off".
> Is this a valid concern (in other browsers such as Netscape, as well) and if so 
>how/where can JavaScript be turned "off"?
> 
> Thanks much,
> George

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




RE: JavaScript -- use or not use???

2002-01-06 Thread James Dasher

Absolutely.  IE calls it Active Scripting, and it is at the bottom of
the Internet Options dialog.  I run with Javascript off so I don't have
to look at advertising popups and other "look at me!!!" shenanigans.  A
small but significant population of web-luddites do this.  Best to sniff
for it beforehand.


-Original Message-
From: George White [mailto:[EMAIL PROTECTED]] 
Sent: Sunday, January 06, 2002 6:24 PM
To: Struts Users Mailing List
Subject: JavaScript -- use or not use???


Hi folks,

 This isn't exactly a struts question but I have seen comments about
JavaScript often enough I was hoping someone could answer this very
general question. The people I work use struts but are avoiding
JavaScript because they say that some clients may have JavaScript
functionality turned off on their browsers. I use I.E. 5.0 and cannot
see where I can turn JavaScript "off". Is this a valid concern (in other
browsers such as Netscape, as well) and if so how/where can JavaScript
be turned "off"?

Thanks much,
George




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




JavaScript -- use or not use???

2002-01-06 Thread George White

Hi folks,

 This isn't exactly a struts question but I have seen comments about JavaScript often 
enough I was hoping someone could answer this very general question.
The people I work use struts but are avoiding JavaScript because they say that some 
clients may have JavaScript functionality turned off on their browsers.
I use I.E. 5.0 and cannot see where I can turn JavaScript "off".
Is this a valid concern (in other browsers such as Netscape, as well) and if so 
how/where can JavaScript be turned "off"?

Thanks much,
George





Re: Struts Validator Load Failure

2002-01-06 Thread Steven D. Wilkinson

I haven't used the validator, but that is a Digester error.  I would
guess that something is wrong in the validation.xml file.

"Struts Newsgroup @Basebeans.com" wrote:
> 
> Subject: Struts Validator Load Failure
> From: "Paul Heath" <[EMAIL PROTECTED]>
>  ===
> The following is a partial stack trace of when the app server tries to load
> Struts Validator.
> 
> I have the latest version of Digester (v1.1.1) and Struts Validator in my
> classpath.
> 
> Anyone know how to fix this:
> 
> java.lang.NoSuchMethodError
> 
>  at org.apache.commons.digester.Digester.getReader(Digester.java:527)
>  at org.apache.commons.digester.Digester.parse(Digester.java:1206)
>  at
> com.wintecinc.struts.validation.ValidatorResourcesInitializer.initialize(Val
> idatorResourcesInitializer.java:237)
>  at
> com.wintecinc.struts.validation.ValidatorResourcesInitializer.initialize(Val
> idatorResourcesInitializer.java:123)
>  at
> com.wintecinc.struts.action.ValidatorServlet.initMapping(ValidatorServlet.ja
> va:223)
>  at
> com.wintecinc.struts.action.ValidatorServlet.init(ValidatorServlet.java:123)
>  at javax.servlet.GenericServlet.init(GenericServlet.java:258)
> 
> --
> To unsubscribe, e-mail:   
> For additional commands, e-mail: 

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




Struts Validator Load Failure

2002-01-06 Thread @Basebeans.com

Subject: Struts Validator Load Failure
From: "Paul Heath" <[EMAIL PROTECTED]>
 ===
The following is a partial stack trace of when the app server tries to load
Struts Validator.

I have the latest version of Digester (v1.1.1) and Struts Validator in my
classpath.

Anyone know how to fix this:


java.lang.NoSuchMethodError

 at org.apache.commons.digester.Digester.getReader(Digester.java:527)
 at org.apache.commons.digester.Digester.parse(Digester.java:1206)
 at
com.wintecinc.struts.validation.ValidatorResourcesInitializer.initialize(Val
idatorResourcesInitializer.java:237)
 at
com.wintecinc.struts.validation.ValidatorResourcesInitializer.initialize(Val
idatorResourcesInitializer.java:123)
 at
com.wintecinc.struts.action.ValidatorServlet.initMapping(ValidatorServlet.ja
va:223)
 at
com.wintecinc.struts.action.ValidatorServlet.init(ValidatorServlet.java:123)
 at javax.servlet.GenericServlet.init(GenericServlet.java:258)




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




Iteration logic solution

2002-01-06 Thread Gupta

Hi Guys,
I Have little problem with struts iterate tag lib.
My code is below and just view it and give details.


<%
for( int i=0;i
 
  
  
  
  
<%
}//for ends
%>

I would  like to replace for loop and other java code by struts logic tag
lib, If any of
mail recievers can give solution for it I would be very glad .
TAI
Guptha.k and RAYAKU


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




Struts Question of select and options tag

2002-01-06 Thread Gupta

Hi Guys,
I am new to struts  frame work and I am facing little difficult.

I have a select control in html form using  below code to display in html
form (not using html tag lib) in MVC2 model by reading key by key and
reading its value ,
Now i want to do it in struts framework with struts taglib,I am halfway
through but not full,I hope u guys help me out in this using tag libs.
<%Hashtable hashmap=(Hashtable)request.getAttribute("codesMap");
  String
selectedOption=(String)request.getAttribute("selectedOption");
  //MVC2 approach
%>
  <% if(hashmap!=null){   //it can be null some cases
//fetch one object and keep it in
//  %>
<%  Enumeration enum=hashmap.keys();
while(enum.hasMoreElements()){
Object key=enum.nextElement();
Object value=hashmap.get(key);
  String selected="";
if(selectedOption!=null){
if(value.equals(selectdOption)){
 selected="Selected";
}else{
 selected="";
  }
}
 %>
  > <%=value%>

   <% }//while ends %>

  <%  }if ends
  else{
 //if hashmap is null then print some thing
  %>
  SOrry no codes available.
  <% } //else ends%>

in some sequeces the hashmap object may be null(if request comes from some
other pages) so how would i check an hashmap is null or not and if hashmap
is not null in taglibs I would like to dispaly these hashmap values into
select html control with default selection, If i dont specify which option
should be selected default,It should select the first option in select box
as default.Becoz hashmap values are not fixed.

In short i am looking for a taglib solution for above piece of code

TAI
Yaman & guptha



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




Questions regarding action and form interaction

2002-01-06 Thread Michael Witt

Hello,

I'm fairly new to struts (used over the pass 3 or so weeks) and I have
a question that I'm hoping someone here might know the answer to.
I've looked in the archives and don't believe that I've seen this same
set of problems there, but if I've just missed it, please redirect me.

Here's the problem:

I have two pages which I'll call, for this explanation: list and edit.

The list page presents a list of possible records with a html:link on
each in order to edit that record.  When one of these links is clicked,
it goes to the edit page where the record is displayed for editing.

I have one form bean, which I'll call editform which stores the
information on the edit page.  I've put some functionality into the
constructor for this form bean to populate some select/option fields
with valid options (for example, years to choose from) because I wanted
to be able to drive this programmatically so that the year list always
shows a proper range.

I have three actions, which I'll call listaction, editaction and
updateaction.

The purpose of the listaction is to the load all records from the
database and display them in a list with html:link's for each record
and setting a parameter for each with the records id.  This form has no
name or input.

The purpose of the editaction is to receive the id parameter from the
list form, select the record from the database and populate the form.
This action does not validate and its name is the editform and its
input is the editform.

The pupose of the update action is assemble the information off of the
edit form and either update or insert a record into the database.  This
action does validate and its name is the editform and its input is also
the edit form.

Now for my questions:

1) Am I handling the form bean correctly by tying it to two actions,
one to load it and the other to process it?
2) My initial plan was to forward back to the list form after the
update is complete.  I initially assumed that the action for this form
would be executed again, but it's not.  So, I always get a blank form.
Is there a way to get this action to run again?  If I click the link in
my navigation bar to go to this page, the action does run again.
3) If I have an error, either validating or otherwise, I would like to
go back to the editform again with the record still filled in.  But, I
always get a "handlePageException" caused by a NullPointerException
which seems to have something to do with my select/options (because I
see in the stack trace:

org.apache.struts.taglib.html.OptionsTag.getIterator...).

Thanks in advance for any help you can give,

Mike Witt


_
Chat with friends online, try MSN Messenger: http://messenger.msn.com


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




RE: Struts-config.xml

2002-01-06 Thread Rajan, Jeffy

Thanks Ted, I checked the URL and I am doing something similar using
JavaScript. I have a question..

My forwards is as below

 
 
 

pls note all forwards are same

I do the following for a delete action now

if(action.equals("delete") && success)
form.reset();

return mapping.findForward(request.getParameter("forward"));

another scenario

if(action.equals("insert"){
int success = data.insert(); //something similar
if(Constants.SUCCESSFUL)
errors.add(new
ActionError("error.save.successful"));  
else if (Constants.DATBABASE_ERROR)
errors.add(new
ActionError("error.save.databaseerror"));   
else if (Constants.GENERAL_ERROR)
errors.add(new
ActionError("error.save.systemerror")); 
} 

return mapping.findForward(request.getParameter("forward"));

Is there a better way?

Thanks.

for ref from http://jguru.com/faq/view.jsp?EID=543699

QUOTE 

A good trick here is to use a generic "routing" or "relay" action, so you
don't have to hardcode some type of switch into the Action. It's just one
line in the perform method: 

return mapping.findForward(request.getParameter("forward")); 

This can be used any number of times in a Struts application, just by
changing the form bean and the local forwards in its mapping.


 
 

UNQUOTE

-Original Message-
From: Ted Husted [mailto:[EMAIL PROTECTED]]
Sent: Sunday, January 06, 2002 10:52 AM
To: Struts Users Mailing List
Subject: Re: Struts-config.xml


What you are really asking is how to have different buttons fire
different actions. 

There are several approach to this. The JavaScript approach is described
here:

http://jguru.com/faq/view.jsp?EID=543699

There is also the new org.apache.struts.actions.LookupDispatchAction in
the nightly build. 

Also in the contrib folder of the nightly build, there is a package
called "scaffold" with another standard Action,
org.apache.scaffold.http.FindForwardAction (my personal favorite). 


-- Ted Husted, Husted dot Com, Fairport NY USA.
-- Building Java web applications with Struts.
-- Tel +1 585 737-3463.
-- Web http://www.husted.com/struts/



"Rajan, Jeffy" wrote:
> 
> I hope someone can provide me a sample struts-config.xml snippet for my
> workflow stated as below:
> 
> 1.  A  form is displayed to the user. The form has some fields with
defaults
> values (i.e. current date etc) and blank fields
> 
> 2.  The form has the following actions permitted: SAVE (update/insert),
> DELETE and RESET
> 
> 3.  When the user SAVES, a form validate might restrict the save, a
> validation in the action class might restrict the save, database exception
> might restrict the save, or the save is successful. In all these cases,
the
> user is displayed the same form with data entered by the user with a
> notification of the success or failure of the action at the top of the
form.
> 
> 4. When the user DELETES, on error the same form is displayed with the
error
> on top. if successful, a blank form is displayed with a message on top
> informing the user that the delete was successful
> 
> 5. When the user RESETS, a blank form is displayed with no messages on top
> of the form.
> 
> Thanks
> 
> --
> To unsubscribe, e-mail:

> For additional commands, e-mail:


--
To unsubscribe, e-mail:

For additional commands, e-mail:




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




Re: Struts-config.xml

2002-01-06 Thread Ted Husted

What you are really asking is how to have different buttons fire
different actions. 

There are several approach to this. The JavaScript approach is described
here:

http://jguru.com/faq/view.jsp?EID=543699

There is also the new org.apache.struts.actions.LookupDispatchAction in
the nightly build. 

Also in the contrib folder of the nightly build, there is a package
called "scaffold" with another standard Action,
org.apache.scaffold.http.FindForwardAction (my personal favorite). 


-- Ted Husted, Husted dot Com, Fairport NY USA.
-- Building Java web applications with Struts.
-- Tel +1 585 737-3463.
-- Web http://www.husted.com/struts/



"Rajan, Jeffy" wrote:
> 
> I hope someone can provide me a sample struts-config.xml snippet for my
> workflow stated as below:
> 
> 1.  A  form is displayed to the user. The form has some fields with defaults
> values (i.e. current date etc) and blank fields
> 
> 2.  The form has the following actions permitted: SAVE (update/insert),
> DELETE and RESET
> 
> 3.  When the user SAVES, a form validate might restrict the save, a
> validation in the action class might restrict the save, database exception
> might restrict the save, or the save is successful. In all these cases, the
> user is displayed the same form with data entered by the user with a
> notification of the success or failure of the action at the top of the form.
> 
> 4. When the user DELETES, on error the same form is displayed with the error
> on top. if successful, a blank form is displayed with a message on top
> informing the user that the delete was successful
> 
> 5. When the user RESETS, a blank form is displayed with no messages on top
> of the form.
> 
> Thanks
> 
> --
> To unsubscribe, e-mail:   
> For additional commands, e-mail: 

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




Struts-config.xml

2002-01-06 Thread Rajan, Jeffy

I hope someone can provide me a sample struts-config.xml snippet for my
workflow stated as below:

1.  A  form is displayed to the user. The form has some fields with defaults
values (i.e. current date etc) and blank fields

2.  The form has the following actions permitted: SAVE (update/insert),
DELETE and RESET

3.  When the user SAVES, a form validate might restrict the save, a
validation in the action class might restrict the save, database exception
might restrict the save, or the save is successful. In all these cases, the
user is displayed the same form with data entered by the user with a
notification of the success or failure of the action at the top of the form.


4. When the user DELETES, on error the same form is displayed with the error
on top. if successful, a blank form is displayed with a message on top
informing the user that the delete was successful

5. When the user RESETS, a blank form is displayed with no messages on top
of the form.

Thanks





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




custom tags: IBM 1.3 JDK vs SUN 1.3 JDK

2002-01-06 Thread ltorrence

I have a struts jsp page with a lot of custom tags; it compiles to around
40k. Under Win2k, when I set JAVA_HOME to run Tomcat 4.1 with the IBM 1.3
JDK, the page executes almost instantaneously, but when I set JAVA_HOME to
the Sun JDK 1.3.1, it takes about 5 seconds to load. 

Does the IBM jdk handle the compilation differently (the compiled size is
about the same either way), or is there a switch that's on by default with
the IBM JDK that improves performance over the Sun JDK?

Lee Torrence



Can't make helloworldish appl. work on Orion

2002-01-06 Thread Tobias Hill

Hi,

I try to follow the steps in trail 3 described in the following tutorial:
http://gallery.bluestone.com/Scripts/SaIsapi.dll/StrutsTrailMap.class/struts
-trailmap/Trail3.htm

It is just a simple hello-world application the gets text from
a resource bundle and based on the settings of the browser
displays "hello world" in different languages.

It all works well and as described in the trail on Tomcat.
On ORION-server I get:

500 Internal Server Error
javax.servlet.jsp.JspException: Cannot find message resources under key
org.apache.struts.action.MESSAGE
(followed by a stack trace)


Does anyone have an idea about what's wrong?

Thankful for any inputs on this,

Tobias Hill
Citerus AB
Sweden


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




Forwarding a Bean as a Request Attribute

2002-01-06 Thread Jack

I retrieve a Collection of items from a database and present them to a user
inside a table populated by a  tag.  In the body of the
iterate tag, I have an  tag to send the user to a page with
details about that item.

How can I forward just the "selected" item as a request attribute to the
detail page when the user clicks on the link?  I saw  has
attributes to set request parameter(s) (Strings), but I want to forward the
related bean so I don't have to retrieve it again from the database.

TIA.

Jack


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




RE: Dynamic drop down lists

2002-01-06 Thread Jack

Michael,

Rather than use an array of Strings for the collection, I'd recommend
wrapping each item in a bean with "label" and "value" properties.  For
instance, I've done just that for a collection of States, where the label
property is called "Name" and the value property (which is stored in the db
column) is called "Abbrev".  The struts tags I used are then as follows:



  


I hope this helps.

Jack

-Original Message-
From: Michael Hass [mailto:[EMAIL PROTECTED]]
Sent: Friday, January 04, 2002 11:26 AM
To: [EMAIL PROTECTED]
Subject: Dynamic drop down lists


Hello,

I'm using the following piece of code to generate a select box with dynamic
options:





This grabs a String array out of session called myStringArray and properly
displays the contents correctly. The issue I have is that the option value
is the same as the display value. I need the value to be an int 0,1,2...
which corresponds to database row id's. More importantly, when the form is
validated, or when the user returns to the form, the previously user
selected value is gone and the first item in the drop down is displayed. It
appears the selected attribute is not added to the option tag.

I can hack the first problem by using a for loop so I get my int values, but
I'm still left with the second problem.

Here's the bad hack code:


<%
 for(int i = 0; i < bean.getAgeRange().length; i++)
 {
 out.print("");
 out.print(bean.getAgeRangeValue(i));
 }
%>

My hack has the getAgeId() and setAgeId() in the form using int - but with
the first code block, should the get and set use String?

What do you do for dynamic single selects?

Thanks for the help.



--
To unsubscribe, e-mail:

For additional commands, e-mail:





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




(off topic) Servlet getInitParameter() methods

2002-01-06 Thread Donnie Hale

Folks,

I'm using Tomcat 4.01, and I'm seeing behavior that makes me wonder if it's
part of the servlet spec.

In a method called by my servlet.init(ServletConfig) method, I'm calling
"config.getInitParameter" to successfully get a parameter from my web.xml
file. However, if at the same point in the code I call
getServletContext().getInitParameter to get the same parameter, it returns
null. The javadocs on the two methods imply that
ServletConfig.getInitParameter would be implemented as
getServletContext().getInitParameter() (they don't state this explicitly,
but the see-also implies it).

Am I misunderstanding what getServletContext().getInitParameter() should do?
Will that call not work until after I return from my init() method back to
the container (e.g. in doGet or doPut)?

Any pointers would be appreciated,

Donnie


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