Multiple Submit Buttons

2001-06-21 Thread DHarty

Is it possible to use multiple  buttons in the same form, and
provide a different action depending on which was hit?

ex:

Do something
Do Something Else
Do Yet Another Thing

I know you can check if the button is a cancel, but that only works if you
have two alternatives.

I'm looking for a way in the Action class to see which button was hit.

Thnxs
David

-Original Message-
From: Ted Husted [mailto:[EMAIL PROTECTED]]
Sent: Thursday, June 21, 2001 11:13 AM
To: [EMAIL PROTECTED]
Subject: Re: [EJB] Design Patterns (was JavaReport ...)


They could. This is especially convenient when your value object bean
contains a RowSet, since the *String versions are already built in. So,
you end up with something like

thisForm.set(
thisValue.getItemString(),
thisValue.getDonorString(),
thisValue.getDonorAnonString(),
thisValue.getCategoryString(),
thisValue.getPricelessString(),
thisValue.getScriptString(),
thisValue.getHasImageString(),
thisValue.getShippingString(),
thisValue.getItemTypeString(),
thisValue.getNameString(),
thisValue.getMarketString(),
thisValue.getMinimumString(),
thisValue.getIncrementString(),
thisValue.getSaleTypeString(),
thisValue.getQtyReceivedString(),
thisValue.getShippableString(),
thisValue.getWeightString(),
thisValue.getLocationString()
);


where thisValue.getItemString() does something like

 /**
  * Return the item as String
  *
  * @return the item as String
  */
 public String getItemString() throws SQLException {
 return values.getString("item");
 }

// ... and

thisValue.setString(
thisForm.getItem(),
thisForm.getDonor(),
thisForm.getDonorAnon(),
thisForm.getCategory(),
thisForm.getPriceless(),
thisForm.getScript(),
thisForm.getHasImage(),
thisForm.getShipping(),
thisForm.getItemType(),
thisForm.getName(),
thisForm.getMarket(),
thisForm.getMinimum(),
thisForm.getIncrement(),
thisForm.getSaleType(),
thisForm.getQtyReceived(),
thisForm.getShippable(),
thisForm.getWeight(),
thisForm.getLocation()
);

where setString does something like

 values.updateString("item",item);

I'm just looking for the least intrusive, most flexible pattern.

The nice part about a map is that it works well as part of an interface,
encapsulates the accessors within a toMap() method, and that mutators
can be called through reflection (e.g. BeanUtil.populate()).

Jonathan wrote:
>
> Why is it that each bean (includeing the containing bean) could not have
> BOTH String get/set and also native type get/set?
>




RE: Multiple Submit Buttons

2001-06-22 Thread DHarty

Yuri and John,

Thanks for your input.

I used the property method which is checked in the action class
successfully.

D

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Thursday, June 21, 2001 6:16 PM
To: [EMAIL PROTECTED]
Subject: Re: Multiple Submit Buttons


David,

Yes, it's possible, but unfortunately Struts won't help
you much in this case like it does with "cancel" or
single "submit" buttons. (please correct me, if I'm wrong)
Perform method of Action takes HttpServletRequest object as request and
you can execute its getParameter() method to find out which
button was pushed.

Best of luck,
Yuriy Zubarev


--- DHarty <[EMAIL PROTECTED]> wrote at 21 Jun 08:43 :

> Is it possible to use multiple  buttons in the same form,
and>
> provide a different action depending on which was hit?>
>
>   ex:>
>
>   Do something>
>   Do Something Else>
>   Do Yet Another Thing>
>
> I know you can check if the button is a cancel, but that only works if
you>
> have two alternatives.>
>
> I'm looking for a way in the Action class to see which button was hit.>
>
> Thnxs>
> David>




html action links

2001-06-22 Thread DHarty

This is really a two part question.

I have an iterative loop that displays a list users that are stored in
Action Forms.  The idea is that when the button (or link) next to the item
is selected, the user will be allowed to make modifications to the selected
form:

  
  





Modify



  
  

Where "result" is a vector of ActionForms.

Currently, when the "Modify" button is selected, the appropriate action
class is called, but the ActionForm is reset.

I know I could add a field to the submit button, i.e:

Modify 

and then have the action class look up the user in hte database again, but I
would rather not.

I was considering using an html link instead of a button, but was unsure how
to proceed.
Ideally, I would like to use an html link, while retaining the existing form
(without having to look it up again).

Any thoughts or comments would be appreciated.

Thnxs

David




RE: html action links

2001-06-22 Thread DHarty

The submit button in the first code snippet I posted should have read:

Modify

instead of:
Modify


I had used the "property" attribute when experimenting with usernames in the
button.

David

-Original Message-----
From: DHarty [mailto:[EMAIL PROTECTED]]
Sent: Friday, June 22, 2001 11:25 AM
To: [EMAIL PROTECTED]
Subject: html action links


This is really a two part question.

I have an iterative loop that displays a list users that are stored in
Action Forms.  The idea is that when the button (or link) next to the item
is selected, the user will be allowed to make modifications to the selected
form:

  
  





Modify



  
  

Where "result" is a vector of ActionForms.

Currently, when the "Modify" button is selected, the appropriate action
class is called, but the ActionForm is reset.

I know I could add a field to the submit button, i.e:

Modify 

and then have the action class look up the user in hte database again, but I
would rather not.

I was considering using an html link instead of a button, but was unsure how
to proceed.
Ideally, I would like to use an html link, while retaining the existing form
(without having to look it up again).

Any thoughts or comments would be appreciated.

Thnxs

David




RE: Running Tomcat+Struts w/o internet connection

2001-06-22 Thread DHarty

I was following this thread, and I tried to use a relative directory of the
type:
file://./struts-config_1_0.dtd"

When I attempted to start tomcat I got the following message:

resolveEntity('-//Apache Software Foundation//DTD Struts Configuration
1.0//EN', 'file://.')  Resolving to alternate DTD
'jar:file:/C:/dev/jbproject/TMate/tmate/WEB-INF/lib/struts.jar!/org/apache/s
truts/resources/struts-config_1_0.dtd'

and then my app worked correctly.  Simarly, you could change the http path
to point to a null object. ex:
"http://this.domain.does.not.exist.org/struts/dtds/struts-config_1_0.dtd";

It seems that if the file can't be found where specified, struts resorts to
a struts-config_1_0.dtd file embedded within struts jar. This may only work
in struts_1.0.

David




-Original Message-
From: Liang Li [mailto:[EMAIL PROTECTED]]
Sent: Friday, June 22, 2001 11:43 AM
To: '[EMAIL PROTECTED]'
Subject: RE: Running Tomcat+Struts w/o internet connection


Of course you can use relative directory, and put the DTD file into your
war.

-Original Message-
From: Hartmut Bernecker [mailto:[EMAIL PROTECTED]]
Sent: Friday, June 22, 2001 11:52 AM
To: [EMAIL PROTECTED]
Subject: Re: Running Tomcat+Struts w/o internet connection


Hi,

I think that problem has been fixed since Struts 1.0, but I'm not sure.
Do you have a new release from Struts?

The solution with "file://c:/..." is IMHO a problem if you want to
deploy your Application (e.g. in a war-File).
Who guarantees you, Tomcat or JRun or ... will be installed on Drive C?

Currently I have a similar problem: I have a XML-File (retrieved by
SOAP) and do parse it with Digester.
That is no problem. If I want to validate that Document, I do it by
writing the DTD-Reference into the XML-File
(  ) and by calling
digester.validate(true).
The Drawback is, that I must put that DTD in the tomcat/bin Directory,
otherwise it would **not** be found.

Then I tried to use the digester.register method. But it seems, I does
not work, as I want.
What I want is: To put the DTD file in some custom directory and use it
to validate the XML-File (that I get wrapped in in a SOAP Document).

Who knows, how to do that?

Cheers
Hartmut



Liang Li schrieb:
>
> Open the struts-config.xml, change the head
>
>"-//Apache Software Foundation//DTD Struts Configuration
1.0//EN"
>   "http://jakarta.apache.org/struts/dtds/struts-config_1_0.dtd";>
>
> To:
>
>"-//Apache Software Foundation//DTD Struts Configuration
1.0//EN"
>   "file://c:/{where_your_DTD_is}/struts-config_1_0.dtd">
>
> I think that will work.
>
> -Original Message-
> From: James Howe [mailto:[EMAIL PROTECTED]]
> Sent: Friday, June 22, 2001 10:30 AM
> To: [EMAIL PROTECTED]
> Subject: Running Tomcat+Struts w/o internet connection
>
> We are trying to run Tomcat + Struts to run our web application without an
> external internet connection.  We are running into a problem because our
> struts-config.xml has an external reference to the struts-config DTD.
What
> is the proper way to modify struts-config.xml to reference a locally
> defined DTD and where would that file normally reside in a standard Tomcat
> installation?
>
> Thanks.




RE: html action links

2001-06-22 Thread DHarty

Okay, I changed my page to look like this.



   
  

Modify





this produces a link like
:http://.../user_mod.jsp?UserForm=edu.erau...form.UserForm%40ff5bdefc

I have a global action "modifyUser" with a path to //user_mod.jsp.
I am able to pick up the UserForm parameter in ModifyUser, but I am unable
to use it as the UserForm bean.  Am I passing a reference to the UserForm
Bean, or just a name?  how do I reconstruct the UserForm bean in ModifyUser?
I experimented with  with no
success.

I'm sorry if these questions are simplistic, but I am new to jsp, and
especially struts.

Also, in the origional example, the global path is to a .do file.  I was
under the impression that the ".do" files were generated by the server.  Do
I need to have a generated page waiting to receive my request?  How is this
done?

thnxs again,
David


-Original Message-
From: Ted Husted [mailto:[EMAIL PROTECTED]]
Sent: Friday, June 22, 2001 12:10 PM
To: [EMAIL PROTECTED]
Subject: Re: html action links


If you just want to use html:link, you don't necessarily have to use an
ActionForm class (though you can, if you want).

Here's some code for generating a list with links. Result is a bean that
exposes a collection named rows.



  

  



When the page renders, it generates links like this:

http://localhost/struts-stub/donor/View.do?key=123456";>123456

where there is a global forward "donor" with the path "/donor/View.do"

and row.getDonor() returns 123456

DHarty wrote:
>
> This is really a two part question.
>
> I have an iterative loop that displays a list users that are stored in
> Action Forms.  The idea is that when the button (or link) next to the item
> is selected, the user will be allowed to make modifications to the
selected
> form:
>
>   
>   
> 
> 
> 
> 
> 
> Modify
> 
> 
> 
>   
>   
>
> Where "result" is a vector of ActionForms.
>
> Currently, when the "Modify" button is selected, the appropriate action
> class is called, but the ActionForm is reset.
>
> I know I could add a field to the submit button, i.e:
>
> Modify  property="username"/>
>
> and then have the action class look up the user in hte database again, but
I
> would rather not.
>
> I was considering using an html link instead of a button, but was unsure
how
> to proceed.
> Ideally, I would like to use an html link, while retaining the existing
form
> (without having to look it up again).
>
> Any thoughts or comments would be appreciated.
>
> Thnxs
>
> David




RE: Contribution: 1) IF, AND, OR, THEN, ELSE, ELSEIF tags 2) SWITCH, CASE, DEFAULT tags

2001-06-25 Thread DHarty

I agree.

Add to that the fact that java script functionality is not consistent across
all browsers, and some organizations refuse to allow its use in intranet
applications.


D

-Original Message-
From: bram [mailto:[EMAIL PROTECTED]]
Sent: Monday, June 25, 2001 5:46 AM
To: [EMAIL PROTECTED]
Subject: Re: Contribution: 1) IF, AND, OR, THEN, ELSE, ELSEIF tags 2)
SWITCH, CASE, DEFAULT tags


But tags have one main advantage, the "view" builder doesn't have to
understand Java and it is easy to intergrate the tags in a wysiwyg jsp
editor. We use that kind of tags to make our webpages, eg see jsp
and all we have to do is to make a xml based editor...
with scriplets this is impossible.

* begin jsp 

















* end jsp 

- Original Message -
From: "Wong Kok Wai" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, June 25, 2001 7:41 AM
Subject: Re: Contribution: 1) IF, AND, OR, THEN, ELSE, ELSEIF tags 2)
SWITCH, CASE, DEFAULT tags


> No offense, but I feel it is much better in
> performance to use Java scriptlets for these cases.
> The overhead of the tags is just too high to justify
> using them.
>
>
>
> __
> Do You Yahoo!?
> Get personalized email addresses from Yahoo! Mail
> http://personal.mail.yahoo.com/
>




Templates and relative paths

2001-06-25 Thread DHarty

I'm using templates, but I would prefer to "put" relative paths to the
template vs. an absolute path.

For example, a file using templates might look like:

<%@ taglib uri="/WEB-INF/struts-template.tld" prefix="template" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>









Whereas I'd rather send the realtive path to the template ala:



or even


I can't seem to do this as the template always look for the file relative to
its own location, and not the location of the calling file.

Intestingly, if I put an  tag in my template, the base it
outputs is the location of the calling file.

D




RE: Templates and relative paths

2001-06-25 Thread DHarty

I would also like to know why other tags (ie img) use a relative path to the
calling file, while the get tags do not.

For example the line in a template file:



render the path relative to the file that called the template (ex
/nested/body/body.jsp), whereas:

  

renders 'body' relative to the location of the template file>

D

-Original Message-
From: DHarty [mailto:[EMAIL PROTECTED]]
Sent: Monday, June 25, 2001 3:39 PM
To: [EMAIL PROTECTED]
Subject: Templates and relative paths


I'm using templates, but I would prefer to "put" relative paths to the
template vs. an absolute path.

For example, a file using templates might look like:

<%@ taglib uri="/WEB-INF/struts-template.tld" prefix="template" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>









Whereas I'd rather send the realtive path to the template ala:



or even


I can't seem to do this as the template always look for the file relative to
its own location, and not the location of the calling file.

Intestingly, if I put an  tag in my template, the base it
outputs is the location of the calling file.

D




Templates anyone?

2001-06-26 Thread DHarty



I would like to know why some tags in the template file (ie img) use a
relative path to the
calling file, while the get tags do not.

For example the line in a template file:



render the path relative to the file that put to the template (ex
/nested/body/body.jsp), whereas:

  

renders 'body' relative to the location of the template file>

I would like to "put" relative paths to the template vs. an absolute path.

For example, a file using templates might look like:

<%@ taglib uri="/WEB-INF/struts-template.tld" prefix="template" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>









Whereas I'd rather send the realtive path to the template ala:



or even


I can't seem to do this as the template always look for the file relative to
its own location, and not the location of the calling file.  I've been able
to send paths relative to the template file, but that seems bass ackwards.

Intestingly, if I put an  tag in my template, the base it
outputs is the location of the calling file.

D




beans and scope

2001-06-28 Thread DHarty

I'm trying to get a series of pages to populate a form ala a "wizard"
interface.

Each page enters a chunck of information which is then forwarded to the next
page in the sequence.  The previous information is dispalyed along with an
area to enter the next bit of info.

The Problem is that after the information on the second page is entered, the
third page doesn't receive the information from the fist page, only the
second.  The informatoin never makes it into the second pages action class.
I made the scope="session", but this still doesn't work.

Please help, I've been banging my head against this for days.


--first page---

  Enter Project Name:   
   
  Project Description:
   
  
  

Next
  

--
-second page---

 
Add Project Leader:



Project Name:


Project Description:

  
--
from stuts-config.xml---






  










--






RE: beans and scope

2001-06-28 Thread DHarty

Thank you John!

Funny thing is, I had changed that in previous attempts.  When that didn't
work, I must have forgot to put it back.

Speaking of request scope,  Is there a way to do this (wizard steps) using
the request scope, or do I just have to make the action classes responsible
for reseting the form to start from scratch?

Thanks again

David

-Original Message-
From: John Schroeder [mailto:[EMAIL PROTECTED]]
Sent: Thursday, June 28, 2001 4:01 PM
To: [EMAIL PROTECTED]
Subject: RE: beans and scope


Try removing the scope="request" line below.  The formbean will default to
session scope (I believe).  If you specify request scope, then the formbean
will be accessible on the second page, but not the third...

This worked for me after I banged my head against it as well!!



  



Hope this helps...

--John





-Original Message-----
From: DHarty [mailto:[EMAIL PROTECTED]]
Sent: Thursday, June 28, 2001 12:57 PM
To: [EMAIL PROTECTED]
Subject: beans and scope


I'm trying to get a series of pages to populate a form ala a "wizard"
interface.

Each page enters a chunck of information which is then forwarded to the next
page in the sequence.  The previous information is dispalyed along with an
area to enter the next bit of info.

The Problem is that after the information on the second page is entered, the
third page doesn't receive the information from the fist page, only the
second.  The informatoin never makes it into the second pages action class.
I made the scope="session", but this still doesn't work.

Please help, I've been banging my head against this for days.


--first page---

  Enter Project Name:   
   
  Project Description:
   
  
  

Next
  

--
-second page---

 
Add Project Leader:



Project Name:


Project Description:

  
--
from stuts-config.xml---






  










--




Multiple Struts-config files

2001-07-02 Thread DHarty



My 
struts-config file is beginning to get a bit unwieldy. 
 
Is it 
possible to call multiple *-config files from web.xml?
 
ex:
    
    
  config  
  /WEB-INF/meaningfulName1-config.xml    
  
    
    
  config  
  /WEB-INF/meaningfulName2-config.xml    
  
 
or 
will "config" be overwritten each time?
 
D
 


RE: Multiple Struts-config files

2001-07-02 Thread DHarty

Thanks

D

-Original Message-
From: Ted Husted [mailto:[EMAIL PROTECTED]]
Sent: Monday, July 02, 2001 12:11 PM
To: [EMAIL PROTECTED]
Subject: Re: Multiple Struts-config files


People are working on that, but it hasn't made it into a build let. 

For more see, 

<
http://www.mail-archive.com/struts-user@jakarta.apache.org/msg10052.html
>

-- Ted Husted, Husted dot Com, Fairport NY USA.
-- Custom Software ~ Technical Services.
-- Tel 716 737-3463.
-- http://www.husted.com/about/struts/

> DHarty wrote:
> 
> My struts-config file is beginning to get a bit unwieldy.
> 
> Is it possible to call multiple *-config files from web.xml?
> 
> ex:
>   
> config
> /WEB-INF/meaningfulName1-config.xml
>   
>   
> config
> /WEB-INF/meaningfulName2-config.xml
>   
> 
> or will "config" be overwritten each time?
> 
> D
>



RE: Templates located in WEB-INF?

2001-07-02 Thread DHarty

Where is you template file (WEB-INF)?  If it is, rry using relative paths to
put to the template.

ex: the line in "project.jsp" that puts to the template...



where the path is relative to the template NOT to the "put"ing file.

Let me know this works, or I'll have a hell of a time when I deploy.

D

-Original Message-
From: Tim Colson [mailto:[EMAIL PROTECTED]]
Sent: Monday, July 02, 2001 2:48 PM
To: [EMAIL PROTECTED]
Subject: Templates located in WEB-INF?


Is it possible to "hide" all JSP files under the /WEB-INF/ directory and
still use templates??

I had some difficulties with the following code finding the
"main_content.jsp" page. Should this work or am I trying to do something
that is known to not work?

(BTW - The code seems to run fine if I put the /jsp directory inside the
context root.)

Thanks!
Tim Colson

<%@ page language="java" %>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ taglib uri='/WEB-INF/struts-template.tld' prefix='template' %>


  
   
  
  
  
  
  






RE: HTML:link tag

2001-07-02 Thread DHarty

I think you'd have to use an Action class to get the 
behavior.

The action class would call "isCancelled(request)" to find out if the form
was canceled, and then return a forward mapping to the cancel path ex:

return (mapping.findForward("cancel"));

If you can use  (or submit for that matter) without an action
class, please let me know.

D

-Original Message-
From: Matt Raible [mailto:[EMAIL PROTECTED]]
Sent: Monday, July 02, 2001 3:02 PM
To: [EMAIL PROTECTED]
Subject: Re: HTML:link tag


I have a search page that displays a list of data, it is a jsp that only
talks to itself.  I'd like to add a "done" button at the bottom that takes
them back to the main menu when they are done.

In my JSP, I'd like to put:


And map it in my struts-config.xml using:


 
  

But this does NOT work, so I am looking for a "work around" using the
following:



And I want to get "/NASApp/appName/mainMenu" from html:link, rather than
hardcoding it into my application.

Thanks,

Matt

- Original Message -
From: <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, June 27, 2001 10:06 AM
Subject: RE: HTML:link tag


>
>
> Matt,
>
> Not sure I follow what you are trying to do.  Do you want to post some
more
> info...?
>
> Cheers,
>
> Dave
>
>
>
>
>
> Matt Raible <[EMAIL PROTECTED]> on 06/26/2001
11:06:02
> PM
>
> Please respond to [EMAIL PROTECTED]
>
> To:   [EMAIL PROTECTED],
>   [EMAIL PROTECTED]
> cc:(bcc: David Hay/Lex/Lexmark)
> Subject:  RE: HTML:link tag
>
>
>
> Does anyone know how to extract the link url using
> struts, rather than the full  tag?  I would
> like to get a URL from a global-forward for use in a
> javascript function.
>
> Thanks,
>
> Matt
>
> --- Michael Skariah <[EMAIL PROTECTED]> wrote:
> > Thanks a million Spencer.
> > -Michael.
> >
> >
> > -Original Message-
> > From: Spencer Smith [mailto:[EMAIL PROTECTED]]
> > Sent: Tuesday, June 26, 2001 3:37 PM
> > To: [EMAIL PROTECTED];
> > [EMAIL PROTECTED]
> > Subject: Re: HTML:link tag
> >
> >
> > <%@ taglib uri="/WEB-INF/struts-html.tld"
> > prefix="html" %>
> >
> > *make sure above line is in your jsp page
> >
> > Click
> > Here
> >
> > *in order for above line to work you need to set up
> > an action in
> > struts-config.xml
> >
> > ie:
> >
> >  
> >  > type="com.pfizer.ecms.ws.TestAction">
> > 
> >
> >
> > - Original Message -
> > From: "Michael Skariah" <[EMAIL PROTECTED]>
> > To: <[EMAIL PROTECTED]>
> > Sent: Tuesday, June 26, 2001 3:23 PM
> > Subject: HTML:link tag
> >
> >
> > > Hello all,
> > > I am trying to replace the following with the
> > Struts HTML link tag.
> > > Test
> > >
> > > Could anyone help me out here\.
> > >
> > > Thanks,
> > > Michael.
> > >
> > >
> >
> >
>
>
> __
> Do You Yahoo!?
> Get personalized email addresses from Yahoo! Mail
> http://personal.mail.yahoo.com/
>
>
>
>
>


_
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com




html:select in a session form

2001-07-03 Thread DHarty

I have a form that is used in a session scope.

It has a boolean attribute (grant) that is set in an  by a
 item.

I had to put the form in session scope so that it didn't get erased as it
was passed from one step to the other.

The problem is that every time ActionServlet passes the form it called the
forms reset method and erased my data.
SO, I put code in the reset method of the form to check  if the scope was
session:

public void reset(ActionMapping mapping, HttpServletRequest request)
 {
if(!"session".equals(mapping.getScope()))
{
this.grant = false;
...
}
}

However, when If I unselect the select button, the boolean grant doesn;t get
unset.  I can't pull the "reset"ing of grant out of the above code block,
because then it will get set to false everytime I submit a page.

This is begging to get bothersome!

D




RE: Templates located in WEB-INF?

2001-07-05 Thread DHarty

I was able to successfully use template under WEB-INF, but not as I had
origionally supposed.

Given a template file ("template.jsp" that might look similar to this:




   



which is located in the "/template" directory (ex
webapps/appdir/templates/).

Also given a page named "project.jsp" in the "/project" directory (ex
webapps/appdir/project/) wich might look like this:







This works until you move the pages into the WEB-INF directory ex (ex
webapps/appdir/WEB_INF/pages/).  The container has trouble parsing the
nultiple ".." operators.  In this case
"../templates/../project/project_body.jsp".

I've found two solutions to this.  The first is to put the absolute path in
your "project.jsp" file like so:







A second solution (my preferrence), is to put the template file in the base
directory of your WEB-INF path that you are using.  In this example you
could put the template file into "WEB-INF/pages/",  and then your
project.jsp could look like this:







You could probably also put the template file directly into the WEB-INF
directory, and adjust your paths accordingly, but I prefer to keep it
separate from the config files etc.

Good luck

D

-Original Message-
From: phil southward [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, July 04, 2001 3:58 AM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: RE: Templates located in WEB-INF?


Guys I had the same problem, I could access pages that were under the root,
but not under WEB-INF. Until I re-read my Wrox Press book (Java Server
Programming, J2EE edition). I quote here,

"The other files, contained within the WEB-INF directory, are resources
accessible only to the container"


In other words, the WEB-INF is a private directory for the Servlet engine
only, if you want to access your JSPs you have to put them either under the
root directory or in sub directories also under root.

Phil




ERROR IN:Templates located in WEB-INF?

2001-07-05 Thread DHarty

Sorry, I caught an error in the last bit of code I submitted in the previous
reply.
This:







should actually be







note the missing "/" at the bigging of the content value.

I still feel that this is, at best, a poor implementation of templates,
however this is a problem with having to use paths relative to the template
file (vs relative to the "put"ing file) as a whole, and not with using them
in WEB-INF.

D

-Original Message-
From: DHarty [mailto:[EMAIL PROTECTED]]
Sent: Thursday, July 05, 2001 12:36 PM
To: Struts; [EMAIL PROTECTED]; phil southward
Subject: RE: Templates located in WEB-INF?


I was able to successfully use template under WEB-INF, but not as I had
origionally supposed.

Given a template file ("template.jsp" that might look similar to this:




   



which is located in the "/template" directory (ex
webapps/appdir/templates/).

Also given a page named "project.jsp" in the "/project" directory (ex
webapps/appdir/project/) wich might look like this:







This works until you move the pages into the WEB-INF directory ex (ex
webapps/appdir/WEB_INF/pages/).  The container has trouble parsing the
nultiple ".." operators.  In this case
"../templates/../project/project_body.jsp".

I've found two solutions to this.  The first is to put the absolute path in
your "project.jsp" file like so:







A second solution (my preferrence), is to put the template file in the base
directory of your WEB-INF path that you are using.  In this example you
could put the template file into "WEB-INF/pages/",  and then your
project.jsp could look like this:







You could probably also put the template file directly into the WEB-INF
directory, and adjust your paths accordingly, but I prefer to keep it
separate from the config files etc.

Good luck

D

-Original Message-
From: phil southward [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, July 04, 2001 3:58 AM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: RE: Templates located in WEB-INF?


Guys I had the same problem, I could access pages that were under the root,
but not under WEB-INF. Until I re-read my Wrox Press book (Java Server
Programming, J2EE edition). I quote here,

"The other files, contained within the WEB-INF directory, are resources
accessible only to the container"


In other words, the WEB-INF is a private directory for the Servlet engine
only, if you want to access your JSPs you have to put them either under the
root directory or in sub directories also under root.

Phil




RE: Action forward to Action losing request objects ??

2001-07-05 Thread DHarty



I had 
the same problem when trying to use a sequence of pages to complete the same 
form.
 
I 
turns out that struts ActionServlet class calls the "reset" method of your form 
between requests, thus erasing your form.  I even tried to put the form in 
a "session" but had the same problem.  Finally I put conditions around the 
reset statements in the reset method ot block unwanted 
resets.
 
I 
would like to know a more elegant solution to this, but it 
works.
 
D

  -Original Message-From: Jonathan 
  [mailto:[EMAIL PROTECTED]]Sent: Thursday, July 05, 2001 3:39 
  PMTo: [EMAIL PROTECTED]Subject: Action 
  forward to Action losing request objects ??
  I am submitting to an Action which when 
  successful places an object in the request and forwards to a second 
  Action, which looks for the item in the request, and forwards yet again to a 
  third Action which gets the item placed in the request object by the previous 
  Action:
  Action1>Action2(put in 
  object)>Action3(getobject)
   
  I am loosing the object in the request between 
  Action1 and Action2 for sure.  Anyone know 
why?


FW: Templates located in WEB-INF?

2001-07-06 Thread DHarty



>I haven't tried to replicate DH's methods on my own stuff yet... but it's
of
>interest to note that the files must be specified relative to the template
>rather than relative to the initial JSP.

Its also of interest to note that if you call resources directly from the
template file, (ex: mailto:[EMAIL PROTECTED]]
Sent: Thursday, July 05, 2001 10:17 PM
To: phil southward; [EMAIL PROTECTED]
Subject: RE: Templates located in WEB-INF?


Phil / DH -

Phil wrote:
> "The other files, contained within the WEB-INF directory, are resources
> accessible only to the container"

Apologies for not replying sooner - this is somewhat moot as DH replied with
a few other path options that apparently work. ;-)

WEB-INF is indeed private and can only be accessed by the container (The
Servlet Spec 2.2 is quite handy to have printed out IMHO.)

However, the template TLD is running inside that container and therefore
should have access.

I haven't tried to replicate DH's methods on my own stuff yet... but it's of
interest to note that the files must be specified relative to the template
rather than relative to the initial JSP.

Thanks DH for the info - I'll give it a try and reply back with results. ;-)

Cheers,
Timo


(BTW - I've been fighting with another issue involving getting the value of
"j_username" to put into my login error.jsp page so the user can try again.
Ugh. No mention of this one in the Servlet spec. <%=
request.getParameter("j_username") %> returns 'null' fyi.)




Struts and Javascript

2001-07-06 Thread DHarty

I know this is getting out of context for for this list, but I've got a
selection box populated with the name property of a bean.  I'd like to
display the "description" property of that bean when the selection changes.
I know you can use javascript commands in the select option, but I am unsure
how to user javascript to get bean properties and then display them:

I imaging psuedo code for the process  would look something like this:





function toggle() {
Project proj = ProjectSearch.getProject(name);
display(proj.getDescription);
}

any help would be greatly appreciated.

D




RE: Struts and Javascript

2001-07-06 Thread DHarty

Thanks guys,  I'll work on these and let you know what happens.



-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Friday, July 06, 2001 2:03 PM
To: [EMAIL PROTECTED]
Subject: Re: Struts and Javascript




Only other thought is could you include the description as the value?  I
know
it's not perfect, but then you could pass the select object into the
function,
and display the value using javascript.

If you don't have too many options, Peter's suggestion to create javascript
array may be best bet.

Dave





Peter Alfors <[EMAIL PROTECTED]> on 07/06/2001
01:51:11 PM

Please respond to [EMAIL PROTECTED]

To:   [EMAIL PROTECTED]
cc:(bcc: David Hay/Lex/Lexmark)
Subject:  Re: Struts and Javascript



I don't believe that this will work.
To my understanding, JavaScript does not have access to objects within a
request
or
session.
By the time the javascript is run, the request is dead.

There may be a better solution than this...
One solution would be to have your JSP page generate a javascript array
declaration
containing the project names.
Then your toggle() method would create the array (if it has not been created
yet)
and look up the project.
It would be ugly, but should work.


HTH,
Pete

DHarty wrote:

> I know this is getting out of context for for this list, but I've got a
> selection box populated with the name property of a bean.  I'd like to
> display the "description" property of that bean when the selection
changes.
> I know you can use javascript commands in the select option, but I am
unsure
> how to user javascript to get bean properties and then display them:
>
> I imaging psuedo code for the process  would look something like this:
>
> 
> 
> 
>
> function toggle() {
> Project proj = ProjectSearch.getProject(name);
> display(proj.getDescription);
> }
>
> any help would be greatly appreciated.
>
> D










RE: Struts and Javascript

2001-07-06 Thread DHarty

David,

Thanks for the advice.

I don't need a message box, just an area on the page that will display the
description of the currently selected item.

An example would be www.cars.com  Here, they have a series of selection
boxes, each of which is populated depending on what the previous selection
is.  I don't need anthing that fancy, just the text description, but my data
is coming from a struts bean, and I am unsure of how to get the data from
one to the other.

Thanks.

-Original Message-
From: David Winterfeldt [mailto:[EMAIL PROTECTED]]
Sent: Friday, July 06, 2001 2:04 PM
To: [EMAIL PROTECTED]
Subject: Re: Struts and Javascript


I'm not sure what you are trying to do exactly.  Do
you want to show a message box with a value based on
the choice from the select?  You would need to create
a JavaScript array of the values you are looking for
in order to display them.

// Auto-generate the description that goes with the
key
function Project {
   this.a = new Array("address.name", "Address Class
Name Value");
   this.b = new Array("firstName", "First Name");

}

// Loop through the descriptions until
// you find the on matching the key
function getDescription(key) {
   var oProject = new Project();

   for (x in oProject) {
  if (oProject[x][0] == key)
 return oProject[x][1];
   }
}

// Pass in the value of the select
function toggle(form) {
   alert(getDescription(document.form[0].name.value));

}

This is the general idea if this is what you want to
do.

David

--- DHarty <[EMAIL PROTECTED]> wrote:
> I know this is getting out of context for for this
> list, but I've got a
> selection box populated with the name property of a
> bean.  I'd like to
> display the "description" property of that bean when
> the selection changes.
> I know you can use javascript commands in the select
> option, but I am unsure
> how to user javascript to get bean properties and
> then display them:
>
> I imaging psuedo code for the process  would look
> something like this:
>
>size="1" property="name" >
>property="projects" />
>   
>
>   function toggle() {
>   Project proj = ProjectSearch.getProject(name);
>   display(proj.getDescription);
>   }
>
> any help would be greatly appreciated.
>
> D
>


__
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail
http://personal.mail.yahoo.com/




RE: Struts and Javascript

2001-07-06 Thread DHarty

Thanks again guys.  It ain't pretty, but here's there important bits.

<%@ page language="java" import="java.util.Vector"  %>

<%
Vector
desc=((ProjectSearchForm)session.getAttribute("ProjectSearch")).getDescripti
ons();
%>



// set to default
var description="Select A Project";

// instantiate a new array
descriptions = new Array(<%=desc.size()%>);

// fill the array
<%
for(int i=0; i<desc.size(); i++)
{
%>
// desctiption has the same index as its name
descriptions[<%=i%>]="<%=desc.get(i) %>";
<% } %>

// called when selection changes
function fillDescription(listBox)
{
description = descriptions[listBox.selectedIndex];
document.all.DescriptionTextArea.value=description;
}


<%-- then in the form -- %>




<%-- and finally the output area --%>

Project Description.


D

-Original Message-
From: David Winterfeldt [mailto:[EMAIL PROTECTED]]
Sent: Friday, July 06, 2001 2:58 PM
To: [EMAIL PROTECTED]
Subject: RE: Struts and Javascript


You could still do something I did below with
JavaScript, but have the toggle set the value
somewhere on the page for you.

David

--- DHarty <[EMAIL PROTECTED]> wrote:
> David,
>
> Thanks for the advice.
>
> I don't need a message box, just an area on the page
> that will display the
> description of the currently selected item.
>
> An example would be www.cars.com  Here, they have a
> series of selection
> boxes, each of which is populated depending on what
> the previous selection
> is.  I don't need anthing that fancy, just the text
> description, but my data
> is coming from a struts bean, and I am unsure of how
> to get the data from
> one to the other.
>
> Thanks.
>
> -Original Message-
> From: David Winterfeldt
> [mailto:[EMAIL PROTECTED]]
> Sent: Friday, July 06, 2001 2:04 PM
> To: [EMAIL PROTECTED]
> Subject: Re: Struts and Javascript
>
>
> I'm not sure what you are trying to do exactly.  Do
> you want to show a message box with a value based on
> the choice from the select?  You would need to
> create
> a JavaScript array of the values you are looking for
> in order to display them.
>
> // Auto-generate the description that goes with the
> key
> function Project {
>this.a = new Array("address.name", "Address Class
> Name Value");
>this.b = new Array("firstName", "First Name");
>
> }
>
> // Loop through the descriptions until
> // you find the on matching the key
> function getDescription(key) {
>var oProject = new Project();
>
>for (x in oProject) {
>   if (oProject[x][0] == key)
>  return oProject[x][1];
>}
> }
>
> // Pass in the value of the select
> function toggle(form) {
>
> alert(getDescription(document.form[0].name.value));
>
> }
>
> This is the general idea if this is what you want to
> do.
>
> David
>
> --- DHarty <[EMAIL PROTECTED]> wrote:
> > I know this is getting out of context for for this
> > list, but I've got a
> > selection box populated with the name property of
> a
> > bean.  I'd like to
> > display the "description" property of that bean
> when
> > the selection changes.
> > I know you can use javascript commands in the
> select
> > option, but I am unsure
> > how to user javascript to get bean properties and
> > then display them:
> >
> > I imaging psuedo code for the process  would look
> > something like this:
> >
> >  > size="1" property="name" >
> >  > property="projects" />
> > 
> >
> > function toggle() {
> > Project proj = ProjectSearch.getProject(name);
> > display(proj.getDescription);
> > }
> >
> > any help would be greatly appreciated.
> >
> > D
> >
>
>
> __
> Do You Yahoo!?
> Get personalized email addresses from Yahoo! Mail
> http://personal.mail.yahoo.com/
>


__
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail
http://personal.mail.yahoo.com/




Session Form Reset?

2001-07-11 Thread DHarty

Why does the servlet call the reset method of an action form even when it's
been put in the session scope?

It doesn't do much good if my session bean is reset to null after every
request!

D




RE: Session Form Reset?

2001-07-12 Thread DHarty

Gregor, you bring up an interesting point.

I have a form that has a boolean "grant" property that is selected by a
checkbox.  After the origional form is submitted, a second page uses that
form for verification purposes.

The problem is that if "grant" is true, and then the user decides to revoke
grant, he can uncheck the box.  However, as we all know, struts cannot see
this unchecking.

If I allow the box to be reset in the reset method, the grant property also
gets reset by the time it makes it to the verification page, and thus
becomes impossible to actually "grant" anything.  If I remove the reset
functionality, it become impossible to revoke the "grant".

I could create a second boolean property (grantCheckBox) that could be used
by the page to set the grant variable before it itself is reset, but how
would I get the checkbox to set itself when the page is initially viewed if
the origional grant property is true?

I would like to do something like...

public reset(...)
{
grant = grantCheckBox;
grantCheckBox=false;
}

then in my page:



but I know that there are several problems with this such as value="grant"
isn't supposed to be used to set the initial value.

I hope this discussion isn't to convoluted, but it seems any solution on one
hand just causes a problem on the other.

Thanks
D



-Original Message-
From: Gregor Rayman [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, July 11, 2001 5:29 PM
To: [EMAIL PROTECTED]
Subject: Re: Session Form Reset?


"DHarty" <[EMAIL PROTECTED]> wrote:

> Why does the servlet call the reset method of an action form even when
it's
> been put in the session scope?
>
> It doesn't do much good if my session bean is reset to null after every
> request!
>
> D

The reset method takes the request as a parameter. Make your reset
method smart enough to clear only properties, which should be
cleared. (like checkboxes displayed on the page which is beeing
submitted)

The same for validate.

--
gR




html:select/options

2001-07-12 Thread DHarty

Is there a way to dictate which "option" in a collection is set as
"selected" when the page is rendered?
ex


For example, I have a collection of projects that are rendered by the
 tag.  I also have  some java script which updates a project
description box when the selection is changed.  The problem is when the page
is first rendered, the two don't always match up.  I initialize the
description box to the first item in the collection, but the select doesn't
always choose the first item.

Thanks
D




RE: Bean property getting vanished from scope

2001-07-13 Thread DHarty

Have you coded the reset() method in your form?

If so, struts will call it between requests even if your session is set to
scope.  You can make the reset smart by wrapping the contents of you reset
method in:

if (!"session".equals(mapping.getScope())) {//reset stuff here...}

the body of the if statement will only perform the functions in the body if
the scope is not session.

Hope this helps.

D


-Original Message-
From: Vaibhav Patil [mailto:[EMAIL PROTECTED]]
Sent: Friday, July 13, 2001 4:35 AM
To: '[EMAIL PROTECTED]'
Subject: Bean property getting vanished from scope


Hello,
I have a bean having array of objects.
I am using that object for iterate tag. Its displaya the table correctly.
But once I submit the tag and go to next page, I trying again to display
the same thing, but it says no collection found. The scope I have given is
session.
Also I tried by removing  set methid for the particular property thinking
there might be problem in set method.
But seems to be something different.
  Can anybody focus some light on this??

Thanks,
Vaibhav




Indexed Tags Functionality

2001-07-16 Thread DHarty


I was just reviewing the indexed tags funtionality and it looks like a
valuable addittion.

Before I rebuilt struts however, I had a question regarding the funtionality
with ArrayLists and Vectors.

Essentially, I was wondering if you could use these tags on objects like
Vectors and lists given that you implement the getter funtion using an
indexed parameter.

Using the example from http://husted.com/about/struts/indexed-tags.htm :


...

...


then in the action class, could you have?

// an ArrayList of some "parameter" bean that has a "value" property.
private ArrayList parameterList;

public ArrayList getParameterList()
{
return this.parameterList;
}

public parameter getParameter(int index)
{
return this.parameterList.get(index)
}

Thanks

D






RE: Indexed Tags Functionality

2001-07-16 Thread DHarty

Excellent, thanks for the effort.  I had been hoping for a way to do this.

I'll begin working with it, and let you know if I have any comments.

D

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Monday, July 16, 2001 12:01 PM
To: [EMAIL PROTECTED]
Subject: Re: Indexed Tags Functionality




PS  You obviously also need a setParameterList(ArrayList paramList).

Dave





"DHarty" <[EMAIL PROTECTED]> on 07/16/2001 10:26:11
AM

Please respond to [EMAIL PROTECTED]

To:   "Struts User" <[EMAIL PROTECTED]>
cc:(bcc: David Hay/Lex/Lexmark)
Subject:  Indexed Tags Functionality




I was just reviewing the indexed tags funtionality and it looks like a
valuable addittion.

Before I rebuilt struts however, I had a question regarding the funtionality
with ArrayLists and Vectors.

Essentially, I was wondering if you could use these tags on objects like
Vectors and lists given that you implement the getter funtion using an
indexed parameter.

Using the example from http://husted.com/about/struts/indexed-tags.htm :

 
  ...
  
  ...
 

then in the action class, could you have?

 // an ArrayList of some "parameter" bean that has a "value" property.
 private ArrayList parameterList;

 public ArrayList getParameterList()
 {
  return this.parameterList;
 }

 public parameter getParameter(int index)
 {
  return this.parameterList.get(index)
 }

Thanks

D












RE: Problem in template tag

2001-07-17 Thread DHarty

I'm not sure if I understand your question entirely, but I know that
templates have funny and inconsitent ways of dealing with paths.

For example, you cannot use multiple relative path iterators if your
template is runing in the container (../templates/../page/pagehead.jsp".
This happens if you put a relative path to a template tat is specified by a
relative path.

Also paths specified within the template are relative to the putting JSP,
while paths specified withing the putting file are relative to the template.

Essientiall check the paths sent to the template.  They need to be either
absolute, or relative to the template, NOT the "put"ting JSP.

> -Original Message-
> From: Boompally, Jayapal [mailto:[EMAIL PROTECTED]]
> Sent: Monday, July 16, 2001 2:15 PM
> To: '[EMAIL PROTECTED]'
> Subject: Problem in template tag
>
>
> First time template working correctly but when I submit to other same page
> it is not showing header, footer, menu it only showing content
>
>
> please help me
> Thanks
> Jayapal




html:select/options

2001-07-18 Thread DHarty


 Is there a way to dictate which "option" in a collection is initially set
as
 "selected" when the page is rendered?
 ex



RE: html:select/options

2001-07-18 Thread DHarty

Thank you!



> -Original Message-
> From: Joe Clark [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, July 18, 2001 12:12 PM
> To: undisclosed-recipients:
> Subject: RE: html:select/options
> 
> 
>  Use the 'value' attribute to make the selection. For example assume you
> have a dropdown of countries and one entry is 'United States' the code
> below would select 'United States'.
>property="country" value="United States">
> ...
> 
> 
> -Original Message-
> From: [EMAIL PROTECTED] at INTERNET
> [mailto:IMCEACCMAIL-struts-user+40jakarta+2Eapache+2Eorg+20at+20INTERNET
> @alltel.com]
> Sent: Wednesday, July 18, 2001 10:38 AM
> To: Clark, Joe; [EMAIL PROTECTED] at INTERNET
> Subject: html:select/options
> 
> 
>  Is there a way to dictate which "option" in a collection is initially
> set
> as
>  "selected" when the page is rendered?
>  ex
>
>  For example, I have a collection of projects that are rendered by the
>   project
>  description box when the selection is changed.  The problem is
>  when the page
>  is first rendered, the two don't always match up.  I initialize the
>  description box to the first item in the collection, but the
>  select doesn't
>  always choose the first item.
> 
>  Thanks
>  D



RE: html:select/options

2001-07-19 Thread DHarty

Good question, and what if you want to get the value from a bean?

Is value='<@=bean.getsomthing()%>' the only way?




> -Original Message-
> From: Pham Thanh Quan [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, July 18, 2001 9:23 PM
> To: [EMAIL PROTECTED]
> Subject: Re: html:select/options
>
>
> But how to keep the choice that user chose in the last time he submitted
>
> - Original Message -
> From: Joe Clark <[EMAIL PROTECTED]>
> Sent: Wednesday, July 18, 2001 11:12 PM
> Subject: RE: html:select/options
>
>
> > Use the 'value' attribute to make the selection. For example assume you
> > have a dropdown of countries and one entry is 'United States' the code
> > below would select 'United States'.
> >> property="country" value="United States">
> > ...
> > 
> >
> > -Original Message-
> > From: [EMAIL PROTECTED] at INTERNET
> > [mailto:IMCEACCMAIL-struts-user+40jakarta+2Eapache+2Eorg+20at+20INTERNET
> > @alltel.com]
> > Sent: Wednesday, July 18, 2001 10:38 AM
> > To: Clark, Joe; [EMAIL PROTECTED] at INTERNET
> > Subject: html:select/options
> >
> >
> >  Is there a way to dictate which "option" in a collection is initially
> > set
> > as
> >  "selected" when the page is rendered?
> >  ex
> >>
> >  For example, I have a collection of projects that are rendered by the
> >   > project
> >  description box when the selection is changed.  The problem is
> >  when the page
> >  is first rendered, the two don't always match up.  I initialize the
> >  description box to the first item in the collection, but the
> >  select doesn't
> >  always choose the first item.
> >
> >  Thanks
> >  D
> >
>




RE: html:select/options

2001-07-19 Thread DHarty

The problem is in the origionally "selected" item when the page is rendered.
for example

> 
>-- Select a Role -- 
>
> 

would set the roleName "TeamLeader" as selected by default.  However, if you
don't wan't the page designers to have to worry about the initially selected
value, or want to make it dynamic, you would have to use something like:


> 
>-- Select a Role -- 
>
> 

whick commingles JSP and struts' tags.  It works, but it aint pretty.

D

PS:  Does anyone know, if I use
<%jsp:useBean id="bean"...>
could i then use


Thanks



> -Original Message-
> From: Jason Te Whau [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, July 19, 2001 12:55 PM
> To: '[EMAIL PROTECTED]'
> Subject: RE: html:select/options
>
>
> This works for me:
>
> 
>-- Select a Role -- 
>
> 
>
> where the userForm.getRoleName() method will return a value that matches
> with one of the values returned by the getName() method of the objects
> stored in the Roles collection.
>
> HTH
>
> -Original Message-
> From: DHarty [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, July 19, 2001 6:31 AM
> To: [EMAIL PROTECTED]
> Subject: RE: html:select/options
>
>
> Good question, and what if you want to get the value from a bean?
>
> Is value='<@=bean.getsomthing()%>' the only way?
>
>
>
>
> > -Original Message-
> > From: Pham Thanh Quan [mailto:[EMAIL PROTECTED]]
> > Sent: Wednesday, July 18, 2001 9:23 PM
> > To: [EMAIL PROTECTED]
> > Subject: Re: html:select/options
> >
> >
> > But how to keep the choice that user chose in the last time he submitted
> >
> > - Original Message -
> > From: Joe Clark <[EMAIL PROTECTED]>
> > Sent: Wednesday, July 18, 2001 11:12 PM
> > Subject: RE: html:select/options
> >
> >
> > > Use the 'value' attribute to make the selection. For example
> assume you
> > > have a dropdown of countries and one entry is 'United States' the code
> > > below would select 'United States'.
> > >> > property="country" value="United States">
> > > ...
> > > 
> > >
> > > -Original Message-
> > > From: [EMAIL PROTECTED] at INTERNET
> > >
> [mailto:IMCEACCMAIL-struts-user+40jakarta+2Eapache+2Eorg+20at+20INTERNET
> > > @alltel.com]
> > > Sent: Wednesday, July 18, 2001 10:38 AM
> > > To: Clark, Joe; [EMAIL PROTECTED] at INTERNET
> > > Subject: html:select/options
> > >
> > >
> > >  Is there a way to dictate which "option" in a collection is initially
> > > set
> > > as
> > >  "selected" when the page is rendered?
> > >  ex
> > >> >
> > >  For example, I have a collection of projects that are rendered by the
> > >   > > project
> > >  description box when the selection is changed.  The problem is
> > >  when the page
> > >  is first rendered, the two don't always match up.  I initialize the
> > >  description box to the first item in the collection, but the
> > >  select doesn't
> > >  always choose the first item.
> > >
> > >  Thanks
> > >  D
> > >
> >




Temporarily Dissapearing Form

2001-07-19 Thread DHarty

I have a Bean that I put into session scope called "ProjectForm".  It stays
in session through the many steps it takes to populate the entire project
form.  When all the data is entered I have a "projectVerify" page wich
displays all the project information using the following code: (i've removed
the table information)


Project Name:   
Project Description:  
TeamLeader: 

When the user verifies this information the form data is commited to the
database, and if successful, a page appears telling the user.  I want to
display the project information again just for kicks, but on the final page,
I use the same code, and get a BLANK table?  Checking the session scope I
see that the form IS still there with the correct data.  Any ideas what it
going on?

D




RE: html:select/options

2001-07-19 Thread DHarty

Ahh..., well that makes it simple.

THX

> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, July 19, 2001 3:09 PM
> To: [EMAIL PROTECTED]
> Subject: RE: html:select/options
>
>
>
>
> Not sure I understand...
>
> I just set the value of roleName in my FORM, and whatever is set there is
> reflected as the selected item - ie just leave off the value=
> altogether (as
> Jason's code).
>
> Dave
>
>
>
>
>
> "DHarty" <[EMAIL PROTECTED]> on
> 07/19/2001 01:33:39 PM
>
> Please respond to [EMAIL PROTECTED]
>
> To:   [EMAIL PROTECTED]
> cc:(bcc: David Hay/Lex/Lexmark)
> Subject:  RE: html:select/options
>
>
>
> The problem is in the origionally "selected" item when the page
> is rendered.
> for example
>
> >  value="Team Leader">
> >-- Select a Role -- 
> >
> > 
>
> would set the roleName "TeamLeader" as selected by default.
> However, if you
> don't wan't the page designers to have to worry about the
> initially selected
> value, or want to make it dynamic, you would have to use something like:
>
>
> >  value="<%=bean.getTheItemWeWantSelected">
> >-- Select a Role -- 
> >
> > 
>
> whick commingles JSP and struts' tags.  It works, but it aint pretty.
>
> D
>
> PS:  Does anyone know, if I use
>  <%jsp:useBean id="bean"...>
> could i then use
>  
>
> Thanks
>
>
>
> > -Original Message-
> > From: Jason Te Whau [mailto:[EMAIL PROTECTED]]
> > Sent: Thursday, July 19, 2001 12:55 PM
> > To: '[EMAIL PROTECTED]'
> > Subject: RE: html:select/options
> >
> >
> > This works for me:
> >
> > 
> >-- Select a Role -- 
> >
> > 
> >
> > where the userForm.getRoleName() method will return a value that matches
> > with one of the values returned by the getName() method of the objects
> > stored in the Roles collection.
> >
> > HTH
> >
> > -Original Message-
> > From: DHarty [mailto:[EMAIL PROTECTED]]
> > Sent: Thursday, July 19, 2001 6:31 AM
> > To: [EMAIL PROTECTED]
> > Subject: RE: html:select/options
> >
> >
> > Good question, and what if you want to get the value from a bean?
> >
> > Is value='<@=bean.getsomthing()%>' the only way?
> >
> >
> >
> >
> > > -Original Message-
> > > From: Pham Thanh Quan [mailto:[EMAIL PROTECTED]]
> > > Sent: Wednesday, July 18, 2001 9:23 PM
> > > To: [EMAIL PROTECTED]
> > > Subject: Re: html:select/options
> > >
> > >
> > > But how to keep the choice that user chose in the last time
> he submitted
> > >
> > > - Original Message -
> > > From: Joe Clark <[EMAIL PROTECTED]>
> > > Sent: Wednesday, July 18, 2001 11:12 PM
> > > Subject: RE: html:select/options
> > >
> > >
> > > > Use the 'value' attribute to make the selection. For example
> > assume you
> > > > have a dropdown of countries and one entry is 'United
> States' the code
> > > > below would select 'United States'.
> > > >> > > property="country" value="United States">
> > > > ...
> > > > 
> > > >
> > > > -Original Message-
> > > > From: [EMAIL PROTECTED] at INTERNET
> > > >
> > [mailto:IMCEACCMAIL-struts-user+40jakarta+2Eapache+2Eorg+20at+20INTERNET
> > > > @alltel.com]
> > > > Sent: Wednesday, July 18, 2001 10:38 AM
> > > > To: Clark, Joe; [EMAIL PROTECTED] at INTERNET
> > > > Subject: html:select/options
> > > >
> > > >
> > > >  Is there a way to dictate which "option" in a collection
> is initially
> > > > set
> > > > as
> > > >  "selected" when the page is rendered?
> > > >  ex
> > > >> > >
> > > >  For example, I have a collection of projects that are
> rendered by the
> > > >   > > > project
> > > >  description box when the selection is changed.  The problem is
> > > >  when the page
> > > >  is first rendered, the two don't always match up.  I initialize the
> > > >  description box to the first item in the collection, but the
> > > >  select doesn't
> > > >  always choose the first item.
> > > >
> > > >  Thanks
> > > >  D
> > > >
> > >
>
>
>
>
>
>
>




action/context path inconsitencies

2001-07-23 Thread DHarty


I have an appliaction called "tmate" that is being deployed in the
"webapps/tmate" directory of tomcat so when I call localhost/tmate I go to
the index of my application.

I also have in my struts confix.xml file some action mappings that begin
with "/tmate" for example:


This has worked until today.  Now, instead of looking for the full action
path (/tmate/projectSelect) it truncates the tmate due to context and looks
for /projectSelect.

Any idea why this has begun happening all of a sudden.  I haven't made any
changes to struts!

D





RE: action/context path inconsitencies

2001-07-23 Thread DHarty

P.S.

The pages that call the /tmate/projectSelect" action load fine (no "missing
action mapping" are thrown).  Its only when the action is actually hit
(submit button) that the action can't be found.

D

> -Original Message-
> From: DHarty [mailto:[EMAIL PROTECTED]]
> Sent: Monday, July 23, 2001 12:36 PM
> To: Struts User
> Subject: action/context path inconsitencies
>
>
>
> I have an appliaction called "tmate" that is being deployed in the
> "webapps/tmate" directory of tomcat so when I call localhost/tmate I go to
> the index of my application.
>
> I also have in my struts confix.xml file some action mappings that begin
> with "/tmate" for example:
>   
>
> This has worked until today.  Now, instead of looking for the full action
> path (/tmate/projectSelect) it truncates the tmate due to context
> and looks
> for /projectSelect.
>
> Any idea why this has begun happening all of a sudden.  I haven't made any
> changes to struts!
>
> D
>
>




RE: application scope problem

2001-07-25 Thread DHarty

Hopefully someone will be able to elaborate on this, but I don't believe you
can't use

interchangablby with struts bean tags.

You should be able to use:



then, to display:



Also, make sure that you are putting the bean "host" into the "application"
scope in you java code.
hth

D

> -Original Message-
> From: Hartmut Bernecker [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, July 25, 2001 11:00 AM
> To: [EMAIL PROTECTED]
> Subject: application scope problem
>
>
> Please Help!
>
> In my Struts-Application I create at a certain point (init Method of
> myClass extends ActionServlet) a Bean for the Servlet Context.
>
> ServletContext context = getServletContext();
> Info info = (Info)context.getAttribute("host");
> if (info == null)
> {
>info = new Info();
>info.setBase("test");
>context.setAttribute("host", info);
> }
>
> Later in a JSP page I have that:
>
> 
> Context Bean:  property="base"/>
>
> But I don't reach the value of the property because every time when I
> forward to that JSP-Page the Bean (Info) is created again and it's
> properties initialized with null.
>
> Any idea?
> What is wrong???
>
> Hartmut Bernecker




isCancelled and infinite loops

2001-08-03 Thread DHarty



Is there a way to reset the request in the action so that it is no longer
cancelled?

for example, I have the following clock in the beginning of my action's
perform method:

if(isCancelled(request))
{
return (mapping.findForward("cancel");
}

the "cancel" mapping returns the action to the same mapping via






FW: ALERT From InfoWorld: New virus spreads using Acrobat files

2001-08-08 Thread DHarty



-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, August 08, 2001 11:13 AM
To: [EMAIL PROTECTED]
Subject: ALERT From InfoWorld: New virus spreads using Acrobat files



INFOWORLD ALERT: SECURITY

Wednesday,  August 8, 2001

NEW VIRUS SPREADS USING ACROBAT FILES

August 08, 2001 07:56 AM

A VIRUS THAT infects PDF (Portable Document Format)
files, used by Adobe Systems' Acrobat software, was
identified Tuesday, according to two security organizations.


For Full Story: 
http://www.infoworld.com/articles/hn/xml/01/08/08/010808hnacr.xml?0808alert

- - - - - - - - - - - - - - - - - - - - - - - - - - - - 

UNSUBSCRIBE
If you want to unsubscribe from InfoWorld's Newsletters
or Alerts, go to http://www.iwsubscribe.com/newsletters/unsubscribe/

CHANGE E-MAIL
If you want To change the e-mail address where
you are receiving InfoWorld newsletters or Alerts, go to
http://iwsubscribe.com/newsletters/adchange/

SUBSCRIBE
To subscribe to any of InfoWorld's e-mail newsletters,
or Alerts tell your friends and colleagues to go to:
http://www.iwsubscribe.com/newsletters/

To subscribe to InfoWorld.com, or InfoWorld Print,
or both, go to http://www.iwsubscribe.com

- - - - - - - - - - - - - - - - - - - - - - - - - - - - 
Copyright 2001 InfoWorld Media Group Inc.



This message was sent to:  [EMAIL PROTECTED]