Getting the id of an object in the value tag

2003-04-01 Thread JONATHAN PHILIP HOLLOWAY
I wonder whether someboyd knows how to do the following:

If I have:



How do i change this so the value tag takes the id from a bean instead of "2"

Is it like this:

 " 
property="answer"/>

Or is there another way of doing it?

Thanks,
Jon.

*-*
 Jonathan Holloway,   
 Dept. Of Computer Science,   
 Aberystwyth University, 
 Ceredigion,  
 West Wales,  
 SY23 3DV.
  
 07968 902140 
 http://users.aber.ac.uk/jph8 
*-*


Sessions Again (Last Time)

2003-03-07 Thread JONATHAN PHILIP HOLLOWAY
Ok can somebody clarify this, I have one JSP that uses two actions,
If I use Action A exclusively then only one session will be used but if
I try to use Action B from the same JSP will a new session be
created?

Jon.

*-*
 Jonathan Holloway,   
 Dept. Of Computer Science,   
 Aberystwyth University, 
 Ceredigion,  
 West Wales,  
 SY23 3DV.
  
 07968 902140 
 http://users.aber.ac.uk/jph8 
*-*


Nested problem not finding the id

2003-03-04 Thread JONATHAN PHILIP HOLLOWAY
I'm currently using a nested:form part inside a nested:iterate loop
to display a number of different items along with a corresponding 
edit and delete button for each item.  The problem I have is that
I can't refer to the id of the item using:



Could somebody tell me why it's looking for the addressId in my
initial person form instead of the nested Address object which
is contained with an arraylist in person, i.e.

PersonForm
Arraylist addressList

where addressList is of type person.

I get the following error message.

ServletException in:/person/addperson.jsp] 
No getter method for property addressId of bean Personform

This is the following code segment, note that the nested:write
tag locates the address object correctly but the nested:hidden
tag within the nested:form tag does not.  Do I need to use
nested:root or something?




 
 
   
 
   

   

  

   
  
  
  


  
 
  

   


   

 
   
   
   
   
  
  
   
 
   
  
 
   

   
   


Many thanks in advance,

Jon.

*-*
 Jonathan Holloway,   
 Dept. Of Computer Science,   
 Aberystwyth University, 
 Ceredigion,  
 West Wales,  
 SY23 3DV.
  
 07968 902140 
 http://users.aber.ac.uk/jph8 
*-*


Nested Bug?

2003-03-03 Thread JONATHAN PHILIP HOLLOWAY
Could somebody tell me whether the followign line is an error
for the indexed=true property of the nested tags?  The number
value seems to be outside the quotes,


   

 

  
 
  

Note that this is the code generated from:




 
  
 

 
  
  

 
  
   
 

   


  

This doesn't seem right to me, I haven't looked at the source code
yet but please somebody correct me if I'm wrong.

Jon.




*-*
 Jonathan Holloway,   
 Dept. Of Computer Science,   
 Aberystwyth University, 
 Ceredigion,  
 West Wales,  
 SY23 3DV.
  
 07968 902140 
 http://users.aber.ac.uk/jph8 
*-*


Sessions

2003-02-28 Thread JONATHAN PHILIP HOLLOWAY
Does anybody know when a new session is started?
Is it in any of the following:

1. When a new action is selected?
2. When a new page is linked to on the client side?
3. When a page is returned to via an action forward?

Also when is a new actionform created? Is it for every request to a new mapping? 
If the scope is set to session should it last throughout the user session no matter 
what mapping or action the user is currently using?

In general how do sessions work within Struts, can somebody please please
pretty please provide me with a brief overview or link to some information.

Many thanks,
Jon.

*-*
 Jonathan Holloway,   
 Dept. Of Computer Science,   
 Aberystwyth University, 
 Ceredigion,  
 West Wales,  
 SY23 3DV.
  
 07968 902140 
 http://users.aber.ac.uk/jph8 
*-*


Session Problems

2003-02-27 Thread JONATHAN PHILIP HOLLOWAY
Hi,

I'm curerntly having problems with sessions in Struts.

I have two JSP's both of which point to the same action.

In my first JSP I have a number of basic properties and a list of addresses
as shown below:

*Name:  Bill Blah
*Age:  23

* Addresses (list)
23 Glamorgan Street  |  ER34 5RT  | Edit | Delete
13 Glamorgan Street  |  ER34 6TT  | Edit | Delete

The addresses are simply displayed using a logic:iterate tag.  

I also supply a link on this page to add an address in a seperate page,
this JSP allows a user to add an address to the list in the first page. 
When the page is submitted it is simply added to in the actionform.

Once I've entered the new address using this second page I'm returned
tot he first page where the new address is shown in the list of addresses.
the problem I have is that when I add a second address it removes the
first address and only the second address is shown here as:

* Addresses (list)
13 Glamorgan Street  |  ER34 6TT  | Edit | Delete

instead of 

* Addresses (list)
23 Glamorgan Street  |  ER34 5RT  | Edit | Delete
13 Glamorgan Street  |  ER34 6TT  | Edit | Delete

I'm assuming this is a problem with the session, could somebody please explain to
me why this happening.  I have set the scope to session for both JSP pages and
both JSP pages use the same action form so why is this happening?

Many thanks,
Jon.


*-*
 Jonathan Holloway,   
 Dept. Of Computer Science,   
 Aberystwyth University, 
 Ceredigion,  
 West Wales,  
 SY23 3DV.
  
 07968 902140 
 http://users.aber.ac.uk/jph8 
*-*


LookupDispatchAction

2003-02-12 Thread JONATHAN PHILIP HOLLOWAY
Does anybody know why the following is casuing me so many problems.
I'm using LookupDispatchAction and have a number of methods defined
in my action class including an execute method.  The problem is that
the execute method ALWAYS gets executed and not the intended method.

I have in the addbanana.jsp:


and in Struts-config:
   
  
   

In my action class I've defined the following:

public ActionForward addBanana(ActionMapping mapping, 
  ActionForm form, 
  HttpServletRequest request, 
HttpServletResponse response) throws 
IOException, ServletException {
 

  return (mapping.findForward("success"));
 }

public ActionForward deleteBanana(ActionMapping mapping, 
  ActionForm form, 
  HttpServletRequest request, 
HttpServletResponse response) throws 
IOException, ServletException {
 

  return (mapping.findForward("success"));
 }
 
/**
 * Get key method map just obtains the map that maps the button
 * text onto the particular method in this action
 * @param mapping is the action mapping
 * @param form is the action form 
 * @param request is the http request
 */ 
protected Map getKeyMethodMap() {
   
   
  Map map = new HashMap();
  map.put("Add Banana", "addBanana");
  map.put("Delete Banana", "deleteBanana");   
  return map;
 }



  /**
 * Execute method
 * @param mapping is the information regardin gthe URI mapping and the action
 * @param form is the action form used
 * @param request is the request
 * @param response is the response
 * @return the action forward, a destination to forward the user onto (eg another JSP)
 */
public ActionForward execute(ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response) throws IOException, 
ServletException {

  
  Logger.logInfo("Execute Called");   
  
  
  
//We can now put these bits in the database
return (mapping.findForward("success")
}


Does anybody know why EXECUTE is called but the intended ADDBANANA method is not
called?

Many thanks,
Jon.



*-*
 Jonathan Holloway,   
 Dept. Of Computer Science,   
 Aberystwyth University, 
 Ceredigion,  
 West Wales,  
 SY23 3DV.
  
 07968 902140 
 http://users.aber.ac.uk/jph8 
*-*



Re: Searching the Archives?

2003-02-12 Thread JONATHAN PHILIP HOLLOWAY
Try

http://www.mail-archive.com

Instead.. : )

Jon
- Original Message -
From: "Jason Vinson" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Wednesday, February 12, 2003 3:51 PM
Subject: Searching the Archives?


> I feel dumb for asking this, but I am trying to search the list archives
via:
>
>
http://nagoya.apache.org/eyebrowse/SearchList?listId=&listName=struts-user@j
akarta.apache.org&searchText=bean+attributes&defaultField=subject&Search=Sea
rch
>
> and when i do a search, it returns "Text search not available for this
list".  Where should i look for proper archive searching?
>
> Thanks,
> Jason
>
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


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




Adding a new object to a collection in an actionform

2003-02-11 Thread JONATHAN PHILIP HOLLOWAY
Does anybody know how to add a new Object to a collection
that exists in an ActionForm.

public class MonkeyForm extends Actionform {
public ArrayList bananas;

...
...

public void setAddBananaForMonkey(Banana newBanana) {
bananas.add(newBanana)
}
}

I know I can create an empty object just by doing this:



But how do I go about creating a new banana with initialized properties
that come from a nwe form on another page.  Is it possible?
I need the new form because I want the user to enter the details for 
the banana BEFORE it is created as blank in the actionform.  
It would be ideal if I could enter these new details in a popup window 
of some sort but how do I go about doing this,

Many thanks in advance,
Jon Holloway.


*-*
 Jonathan Holloway,   
 Dept. Of Computer Science,   
 Aberystwyth University, 
 Ceredigion,  
 West Wales,  
 SY23 3DV.
  
 07968 902140 
 http://users.aber.ac.uk/jph8 
*-*



Forms and multiple buttons

2003-02-11 Thread JONATHAN PHILIP HOLLOWAY
I've successfully built a page that iterates over a nested arraylist 
displaying the contents of the arraylist in the following way

 ---
| Title | Code | Available? |  Edit  |  Remove  |
|---| 
| rara  | 1220 | X  | Button |  Button  |
| asdd  | 1435 | X  | Button |  Button  |
 ---

In the case of the edit button I want to display an
alternate screen that allows the entry of the 
details (title, code and available).  In the above 
table I just want them to be read only.   I also
want the remove button to remove the selected object
from the ArrayList.

Can anybody tell me how I shoudl go about doing this?

Is it a case of embedding id's in the button and 
manipulating the array list using these ids and 
an action?  If so how do I partition my action
up into various parts to achieve this?  Is it a
simple case of using dispatchAction and passing
the id in the query string?

Many thanks in advance,
Jon.


*-*
 Jonathan Holloway,   
 Dept. Of Computer Science,   
 Aberystwyth University, 
 Ceredigion,  
 West Wales,  
 SY23 3DV.
  
 07968 902140 
 http://users.aber.ac.uk/jph8 
*-*



Re: Nesting forms

2003-02-10 Thread JONATHAN PHILIP HOLLOWAY
You don't actually need to create three forms.  All you need to do is to
create one action form
for your top level form, in your case LineItem.  The other two are standard
Java classes, just
make sure they implement Serializable.  You can just refer to these in your
main form in the
following way

LineItem
ArrayList shippingList

then in your Shipping java object just have

Shipping
ArrayList billingList

The code is simple to loop through and display these and it simply involves
sticking nested:iterate
tags in your JSP to loop through the fields within the other objects.

Hope that starts you off, you don't actually need to piss about with the
struts-config.xml file at all
apart from declaring your initial actionform there, hope that helps you out.

Jon.

- Original Message -
From: "Jacky Kimmel" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, February 10, 2003 5:16 PM
Subject: Nesting forms


>
> I need to display data from the database in a jsp.  In order to do this I
have created a form in the struts-config.xml.  My question is on how to nest
forms.  I have the main form, then a lineItem form with item info (there may
be mulitiple line Items), then two address forms: shipping and billing.  How
do I create the overall form in the .xml file?  I am using ejb's for the
database calls.
>
>
>
> -
> Do you Yahoo!?
> Yahoo! Mail Plus - Powerful. Affordable. Sign up now


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




Re: A Useful Struts Resource

2003-01-22 Thread JONATHAN PHILIP HOLLOWAY
Struts doesn't deal with client side browser stuff, your right,
but for those of us building complex user interface components
in a browser we have to use something.  Making the same
functionality available in desktop applications to web appliactions
is a big problem and we need a way of solving this.  HTML
doesn't do the job on its own and so we need a scripting language
like Javascript.  The point I was trying to make was if the Javascript
used is compatible with Netscape (and possibly Mozilla) as well as
IE which is what I was viewing it on.

Alternatively another method of complex client side user interfaces is
to use flash remoting and link it through to Struts

http://www.javaworld.com/javaworld/jw-01-2003/jw-0117-flash.html?

I think this has already been done but can't seem to find the link.

Jon.

- Original Message -
From: "Rick Reumann" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>; "JONATHAN
PHILIP HOLLOWAY" <[EMAIL PROTECTED]>
Sent: Wednesday, January 22, 2003 4:25 PM
Subject: Re: A Useful Struts Resource


> On Wednesday, January 22, 2003, 11:22:18 AM, JONATHAN wrote:
>
> JPH> The only I problem is I don't know how compatible this is gonna be
with Netscape,
> JPH> Mozilla and the other browsers.
>
> This isn't a struts issue. Struts doesn't even deal with client side
> browser stuff. Just do all your validation server side if you want and
> then you don't have to worry about the browser type.
>
> --
>
> Rick
> mailto:[EMAIL PROTECTED]
>
>


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




A Useful Struts Resource

2003-01-22 Thread JONATHAN PHILIP HOLLOWAY
For those of you struggling with Struts at the moment, I know I am : ) there's a 
good resource at:

http://struts.application-servers.com/

A new version has just been released and it looks quite nifty, take a look at the
demo application on:

http://struts.application-servers.com/DemoServeurDeNews

A very useful example to show how complex client side user interfaces can be 
built up (using JSP and Javascript) and linked to Struts components.

The only I problem is I don't know how compatible this is gonna be with Netscape,
Mozilla and the other browsers.

Jon.

*-*
 Jonathan Holloway,   
 Dept. Of Computer Science,   
 Aberystwyth University, 
 Ceredigion,  
 West Wales,  
 SY23 3DV.
  
 07968 902140 
 http://users.aber.ac.uk/jph8 
*-*



Referring to pages in a different place

2003-01-22 Thread JONATHAN PHILIP HOLLOWAY
Ok, I've upgraded to tiles and have the following...

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


  
  
   
  
  
 

the only problem is that I get exception page not found for te files.  Is there
any way around this to get my pages to load from this directory:

http://localhost:8080/WebApp/

when I'm here:

http://localhost:8080/WebApp/assessment/

Can I use <%=request.getContextPath()%> or something like that within
my tiles file?

Many thanks,
Jon.

*-*
 Jonathan Holloway,   
 Dept. Of Computer Science,   
 Aberystwyth University, 
 Ceredigion,  
 West Wales,  
 SY23 3DV.
  
 07968 902140 
 http://users.aber.ac.uk/jph8 
*-*



Action Servlet

2003-01-16 Thread JONATHAN PHILIP HOLLOWAY
Could somebody tell me if it's possible to get a handle on the action servlet 
from an action class and if so how this is actually done.

Many thanks in advance,
Jonathan Holloway.

*-*
 Jonathan Holloway,   
 Dept. Of Computer Science,   
 Aberystwyth University, 
 Ceredigion,  
 West Wales,  
 SY23 3DV.
  
 07968 902140 
 http://users.aber.ac.uk/jph8 
*-*



Referring to resources elsewhere

2003-01-13 Thread JONATHAN PHILIP HOLLOWAY
I've currently got a problem with my template and it doesn't actually display
the pages that are referrred to in the parent folder.  I have the template 
defined as follows butI can't seem to reference mainmenu.html, 
message.html, submenu.html or footer.html in the following way.  Could 
somebody tell me exactly how it is defined.

My template resides in a folder called assessments whilst the other 
files reside in the folder above this.

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















Many thanks in advance,
Jon.

*-*
 Jonathan Holloway,   
 Dept. Of Computer Science,   
 Aberystwyth University, 
 Ceredigion,  
 West Wales,  
 SY23 3DV.
  
 07968 902140 
 http://users.aber.ac.uk/jph8 
*-*



Session Management

2003-01-10 Thread JONATHAN PHILIP HOLLOWAY
Hi everyone,

I'm wondering about the ways of managing sessions in Struts and wanted
to know out of these two ways which was the better way of doing things:

1. Storing things within the standard servlet session

2. Using a UserWrapper object and storing that within the session.

Is the second way more preformance intensive or not and which is best
practice?

Many thanks,
Jon Holloway.

*-*
 Jonathan Holloway,   
 Dept. Of Computer Science,   
 Aberystwyth University, 
 Ceredigion,  
 West Wales,  
 SY23 3DV.
  
 07968 902140 
 http://users.aber.ac.uk/jph8 
*-*



Re: Paper

2003-01-09 Thread JONATHAN PHILIP HOLLOWAY
Ok for the heathens amongst you its also here as a pdf.
I didn't want to convert it quite yet : )

http://users.aber.ac.uk/jph8/frameworks.pdf

Jon.

- Original Message -
From: "Lenharcik, Juraj" <[EMAIL PROTECTED]>
To: "'Struts Users Mailing List'" <[EMAIL PROTECTED]>
Sent: Thursday, January 09, 2003 3:20 PM
Subject: AW: Paper


.doc? bad ;-)

-Ursprüngliche Nachricht-
Von: Jonathan [mailto:[EMAIL PROTECTED]]
Gesendet: Donnerstag, 9. Januar 2003 16:19
An: Struts-User@Jakarta. Apache. Org
Betreff: Paper


Ok,

Sorry to everyone about he last mail, it seems as if the server bounced
my attachment.
I've included links to it here.   (Original message enclosed also)

The document can be found here..

http://users.aber.ac.uk/jph8/frameworks.doc

Or in a zipped format here.

http://users.aber.ac.uk/jph8/frameworks.zip

Many thanks again for any feedback you can provide me with : )

Jonathan Holloway.

---

Hi everyone,

I'm currently writing a paper for one of my University assignments on
web application frameworks.  It basically covers the different
approaches that web frameworks take and is focused around Struts and a
product currently being developed in the university using Struts.  It
also covers Maverick, Cocoon, Freemarker, Barracuda and Tapestry with an
overview of Java Server Faces.  The problem I have is that its very
difficult to get feedback on this type of thing with there being nobody
who really knows about these types of things.  If anybody could possibly
spare some time to have a wander through it and give me some feedback
then I would be very grateful as you guys are the experts here and
active users of the struts framework itself.  I've included it here as a
zipped attachment and if you could possibly spare some time to give me
some help and feedback on it then It'd be extremely appreciative,

Many thanks,
Jonathan Holloway.


*-*
 Jonathan Holloway,
 Dept. Of Computer Science,
 Aberystwyth University,
 Ceredigion,
 West Wales,
 SY23 3DV.

 07968 902140
 http://users.aber.ac.uk/jph8
*-*


--
To unsubscribe, e-mail:

For additional commands, e-mail:





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




JNDIConnectorPlugin Example - C.Caveness Book

2002-12-19 Thread JONATHAN PHILIP HOLLOWAY
Has anybody attempted to use the example in the Programming Jakarta Struts book
for the JNDI stuff.  It defines two things:

a) A JNDIConnectorPlugin class that takes the properties from the struts-config.xml
configuration file.

b) An EJBHomeFactory that uses the JNDIConnectorPlugin to lookup a reference to
an Enterprise Java Bean.

The JNDIConnectorPlugin simply takes the values from the config file and inserts 
them into the servlet context for retreval by any servlet via:

getServlet.getServletContext()

The problem with this is that it needs to call this from the EJBhomeFactory which
is simply a singleton class and has no reference to the Servlet Context.  In the book
by C.Caveness he retrieves these properties from a properties file but what I want
to do is to get them from the servlet context (which JNDIPlugin has used to place
the values).  Is there any way of doing this from a standard class or does 
EJBHomeFactory
need to be implemented as a servlet?  

Is this the best approach to take when looking up EJB's form an action class via
the jndi properties?  It seems to me like it is and I don't want to hardcode the values
in the EJBHomeFactory rather take them from the servlet context. 

Also when it comes to the EJBHomeFactory I only want to cache references to one EJB
namely my central facade session bean.  Does anybody know whether it's possible to
resuse the same instance (that's cached) in different action classes or does it have 
to be
a seperate instance for each action class (in a similar way to which a database 
connection
pool works).

Does anybody have any other better methods of looking up EJB's form action classes?

Many thanks,
Jon.

*-*
 Jonathan Holloway,   
 Dept. Of Computer Science,   
 Aberystwyth University, 
 Ceredigion,  
 West Wales,  
 SY23 3DV.
  
 07968 902140 
 http://users.aber.ac.uk/jph8 
*-*



Re: monkey tree problem

2002-12-19 Thread JONATHAN PHILIP HOLLOWAY
I'm using Monkey Tree but I can't seem to get it to work under Struts 1.1,
which version are you using it under at present?  If it's 1.1 could you give
me a few pointers on how you got it working or mail me the war file if
that's not being too cheeky : )

Jon.

- Original Message -
From: "Amit Badheka" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Thursday, December 19, 2002 12:48 PM
Subject: monkey tree problem


Hi All,

I have a requirement to generate the tree structure from the collection
object.

right now I am using the monkey tree to generate the tree structure for the
same.

The tree is generating fine. But, the problem is that I want to catch the
click event i.e. which node is clicked so that I can get the node name that
is clicked.

Is anybody is using monkey tree?

please help me to resolve this problem, also if there is any alternate
option let me know.

thanks a lot,

Amit Badheka.




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




Internationlization Bug

2002-12-18 Thread JONATHAN PHILIP HOLLOWAY
Could somebody please tell me whether I can use the following:



to define my applicationresources.properties file (internationlisation file) under
Struts 1.1 or if I have to use the Struts 1.0 and web.xml way of specifying
the file:


  application
  ApplicationResources.properties


Many Thanks,
Jon.

*-*
 Jonathan Holloway,   
 Dept. Of Computer Science,   
 Aberystwyth University, 
 Ceredigion,  
 West Wales,  
 SY23 3DV.
  
 07968 902140 
 http://users.aber.ac.uk/jph8 
*-*