How do i get a refernce to the exception thrown in my jsp page

2003-10-22 Thread teknokrat
I have defined a global exception handler which logs the exception and 
then foreards to my error page. In the error page I need to get a 
reference to the exception but there is no exception object. How do i 
get a reference to the exception thrown in the jsp page?

thanks



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


Re: How do i get a refernce to the exception thrown in my jsp page

2003-10-22 Thread teknokrat
Geeta Ramani wrote:

If you set a request scope Exception object before you forward to the
error page, then you will be able to get that reference.
Regards,
Geeta
teknokrat wrote:


I have defined a global exception handler which logs the exception and
then foreards to my error page. In the error page I need to get a
reference to the exception but there is no exception object. How do i
get a reference to the exception thrown in the jsp page?
thanks

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
I use request.setAttribute(exception,exception); in the exception 
handler before forwarding to the jsp but i still get a NPE when i try
to use exception in the page.



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


Bug in tile with struts 1.1

2003-09-11 Thread teknokrat
My layout file (layout.jsp) has the following block

tiles:insert attribute=header flush=true/
tiles:insert attribute=menubar  flush=true/
tiles:insert attribute=body  flush=true/
That is I want first the header tile to be layed out, then the menu tile 
and finally the body tile.

The definition for the page in the tiles-def.xml file is

definition name=.customer.page path=/WEB-INF/layout.jsp 
put name=header  value=/WEB-INF/header.jsp /
put name=menu  value=.menu /
put name=body   value=/WEB-INF/customer.jsp /
/definition
definition name=.menu path= controllerUrl=/admin/menu.do
/definition
definition name=.menubar1 path=/WEB-INF/menu.jsp
   putList name=menu 
  item value=Search
link=/admin/search.do
classtype=org.apache.struts.tiles.beans.SimpleMenuItem
tooltip=Search for customers /
/definition
Note that the menu uses an action to determine whether the current 
logged on user should have access to this item. In fact I have several 
menubars and the action forwards tot he relevant one for the user.

the struts-config mapping is

action path=/admin/menu type=com.CheckRoleAction
forward name=success path=.menubar1/
forward name=failure path=.error/
/action
Now all this works perfectly EXCEPT that the order of the tiles is 
wrong. The menu tile is displayed before the header tile. If i change my 
layout to

tiles:insert attribute=header flush=true/
tiles:insert attribute=body  flush=true/
tiles:insert attribute=menubar  flush=true/
then everything works Ok. This is only a problem when using a tiles 
controller and I am sure it was working correctly in struts 1.0 ( in 
fact i am certain it was ok even in the 1.1 betas)

I was going to raise this in the bug database if everything here is OK

thanks



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


Re: Bug in tile with struts 1.1

2003-09-11 Thread teknokrat
Yann Cébron wrote:

snip large block/

then everything works Ok. This is only a problem when using a tiles
controller and I am sure it was working correctly in struts 1.0 ( in
fact i am certain it was ok even in the 1.1 betas)
I was going to raise this in the bug database if everything here is OK


Don't get me wrong - but before filing this as a bug: did you verify this
behaviour using different Servlet Containers? Might be as well a bug in a
(most probably newer) version of your Tomcat/Whatever..
I just wonder, because easily spotted bugs like this one should already have
shown up by long time..
Cheers,

Yann
I am using and have been using tomcat 4.1.24 so this is definitely new 
behavior from tiles. when I try out builds before struts 1.1 final this 
does not occur.



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


on using beans in different scopes

2003-07-03 Thread teknokrat
I have a number of beans set in the application scope that I want to use 
 in various select boxes. The docs say to use
html:options collection=bean where bean is the bean in some scope.

However when I try this I get an exception no bean specified 
eventhough I can show that the required bean is available in the 
application scope.

what am i missing here? there is no scope field in the html:options tag 
to let it know where to look for the bean...

thanks



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


Re: on using beans in different scopes

2003-07-03 Thread teknokrat
teknokrat wrote:

I have a number of beans set in the application scope that I want to use 
 in various select boxes. The docs say to use
html:options collection=bean where bean is the bean in some scope.

However when I try this I get an exception no bean specified 
eventhough I can show that the required bean is available in the 
application scope.

what am i missing here? there is no scope field in the html:options tag 
to let it know where to look for the bean...

thanks
Ok I get it - you can't use arrays in collections. doh!



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


Problem with tiles in struts rc2

2003-06-18 Thread teknokrat
The following tiles insert

tiles:insert attribute=header /
tiles:insert attribute=menubar/
now places the menubar above the header. Nothing i dio changes this and 
the behaviour was correct in RC1. Note that my menubar definition uses a 
ControllerUrl.

bye



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


Re: tiles and tiles controllers

2003-06-06 Thread teknokrat
Currently i have two page definitions - one for inheritence and one for 
the controller. The controller is a TilesAction - I suppose i could 
create a TilesAction that did nothing and have the inherited pages use 
that but it seems an unnecessary hack. It would be good if setting the 
controllerUrl to  was OK or even a switch to disable it.

Mike Jasnowski wrote:
I suppose one possibility is to have a noop controller, noop.jsp,   or use
the controller attribute on each tile rather than the definition, which I
think is less desireable than having it at the def level.
-Original Message-
From: teknokrat [mailto:[EMAIL PROTECTED]
Sent: Thursday, June 05, 2003 8:14 AM
To: [EMAIL PROTECTED]
Subject: tiles and tiles controllers
I have a page definition that uses a tiles controller. This works fine.
However, i now want to defines several pages that extend the first page
but i do not want them using the controller ( or any controller). can
this be done? leaving urlController blank gives errors.
thanks



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


tiles and tiles controllers

2003-06-05 Thread teknokrat
I have a page definition that uses a tiles controller. This works fine. 
However, i now want to defines several pages that extend the first page 
but i do not want them using the controller ( or any controller). can 
this be done? leaving urlController blank gives errors.

thanks



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


dealing with null values

2003-03-19 Thread teknokrat
I need to write out beans that can have complex nested object that may 
sometimes be null. If they are null i would like nothing to be output. 
Is there a way to do this with struts without having to check if a 
property exists every time?

thanks



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


Re: bean:write question

2003-03-19 Thread teknokrat
[EMAIL PROTECTED] wrote:
hello

i have a class wich contains another class
like class user which contains a class adress in a
response.

i'd like to write the properties in a jsp




bean:write name=user property=address.city /
hth,
Tib


thanks
couldn't have been more simple !
-
SPECIAL ADSL 
L'ADSL à partir de 15,95 EUR/mois et le modem ADSL offert ?  C'est en exclusivité chez Tiscali !
Pour profiter de cette offre, cliquez ici: http://register.tiscali.fr/adsl/
Offre soumise à conditions.


Ok - but what happens if address is null - then you get NPE. Is there a 
way stop the NPE and have the field set to nothing i.e. empty

thanks



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


confused about an action forms fields

2003-03-18 Thread teknokrat
Do all the fields of an actionform have to be strings? I am confused as 
to when a form field should become an entity in my business logic. For 
example, I have quite complex business objects composed of ArrayLists, 
Dates and other classes. How are these to be set? Do I need to capture 
everything as a primitive type and then have my action build the complex 
business entity? if I am updating an already existing entitiy do I need 
to change every field in it manually?

thanks



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


Re: confused about an action forms fields

2003-03-18 Thread teknokrat
Nicolas De Loof wrote:
As user can edit them, you should set all actionform fields as string.
You can use Collection, arrays and references to obects with String
fields.
This way you can build a formbean model that has the same look as
your business object model (or data transfert objects). You can the
use BeanUtil.copyProperties() to populate DTO datas to a formbean and
afert user edited it (and validation occured)transfert formbean datas
to DTO back.
FormBean are this way a String-copy of your business, that user can
edit. BeanUtil will convert data types (you can register converters if
needed)
Nico.


Am i right in that BeanUtil can only copy basic data types and not 
complex data types that i have created myself? Presumably if I have a 
form that allows changing a user's role ( which is of type Role ) i need 
to compare the string roleName returned by the form with a cache of 
possible role objects and if one exists with that name assign it to the 
user manually.





Do all the fields of an actionform have to be strings? I am confused
as

to when a form field should become an entity in my business logic.
For

example, I have quite complex business objects composed of
ArrayLists,

Dates and other classes. How are these to be set? Do I need to
capture

everything as a primitive type and then have my action build the
complex

business entity? if I am updating an already existing entitiy do I
need

to change every field in it manually?

thanks




-

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]


Are action forms reused?

2003-03-18 Thread teknokrat
I am using struts 1.1. What I would like to know is whether a new form 
bean is created in the following situation:

An action sets a form bean as an attribute and passes it for display to 
the appropriate jsp page and its contents displayed. This form is 
updated and submitted to a different action. Now, is the form bean that 
submitted the second time the same as the first form or has a new form 
bean been created and its fields re-populated.

thanks



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


having a problem updating my form - starnge error with beanUtils

2003-03-17 Thread teknokrat
I have a jsp page that is being populated OK by the form bean. However - 
when i make changes to the fields and submit it to my action i get the 
following error

java.lang.IllegalArgumentException: No bean specified
	at 
org.apache.commons.beanutils.PropertyUtils.getPropertyDescriptor(PropertyUtils.java:837)
	at org.apache.commons.beanutils.BeanUtils.setProperty(BeanUtils.java:849)
	at org.apache.commons.beanutils.BeanUtils.populate(BeanUtils.java:729)
	at org.apache.struts.util.RequestUtils.populate(RequestUtils.java:1097)
	at 
org.apache.struts.action.RequestProcessor.processPopulate(RequestProcessor.java:798)
	at 
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:254)
	at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1422)
	at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:523)

Does anyone know what this means and what is going on here?

thanks

p.s. the form is a simple html:form action=myAction.do  etc /html:form



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


Re: having a problem updating my form - starnge error with beanUtils

2003-03-17 Thread teknokrat
ALAMI Ahmed wrote:
make sure you specified a name attribute for your action  element in struts-config

   action path=/myAction name=myActionForm type=MyActionAction scope=request 
input=/myAction.jsp
forward name=success 
/action
yes i have specified a name - the action mapping is ( customer refers to 
a form bean i have defined in form-beans )

action path=/updateCustomer name=customer scope=request 
type=com.lab.struts.customer.CustomerAction parameter=action 
input=/WEB-INF/jsp/CustomerDetails.jsp attribute=customer
	forward name=updated path=/WEB-INF/jsp/CustomerDetails.jsp 
redirect=false /
/action







-Message d'origine-
De : teknokrat [mailto:[EMAIL PROTECTED]
Envoyé : Monday, March 17, 2003 5:11 PM
À : [EMAIL PROTECTED]
Objet : having a problem updating my form - starnge error with beanUtils
I have a jsp page that is being populated OK by the form bean. However - 
when i make changes to the fields and submit it to my action i get the 
following error

java.lang.IllegalArgumentException: No bean specified
	at 
org.apache.commons.beanutils.PropertyUtils.getPropertyDescriptor(PropertyUtils.java:837)
	at org.apache.commons.beanutils.BeanUtils.setProperty(BeanUtils.java:849)
	at org.apache.commons.beanutils.BeanUtils.populate(BeanUtils.java:729)
	at org.apache.struts.util.RequestUtils.populate(RequestUtils.java:1097)
	at 
org.apache.struts.action.RequestProcessor.processPopulate(RequestProcessor.java:798)
	at 
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:254)
	at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1422)
	at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:523)

Does anyone know what this means and what is going on here?

thanks

p.s. the form is a simple html:form action=myAction.do  etc /html:form



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


wrapping beans in a form - any ideas

2003-03-17 Thread teknokrat
Have there been any discussion on the pros/cons of having forms like

class MyForm extends ActionForm {

MyBean bean;

public void setBean(MyBean bean) {
this.bean=bean;
}
public MyBean getBean() {
return bean;
}
}

And then use the properties like so bean:write name=bean 
property=bean.name / and so on

cheers



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