Re: ActionForm not String type fields (properties)

2004-04-09 Thread Craig McClanahan
Stjepan Brbot wrote:

Hi all,

Does STRUTS ActionForm/DynaForm have to consist only of String object
fields!? Although I saw this strong recommendation in some books and
articles on Internet (since all parameters in Request are Strings) I use
Action and DynaForms with java.lang.Integer fields and everything works
fine! (Integer fields are very convenient when one deals with EJBs where IDs
are of Integer type.) It seems that STRUTS framework automatically converts
Strings from request into defined fields types of Form. Why should one use
only String fields and avoid Form fields other than Strings?
Stjepan Brbot

 

Consider what would happen in the following scenario:

* You have a form bean property of type "int".

* The corresponding field on the page is an  that creates an 
input text field.

* Your user types "1a3" by mistake instead of "123".

What does your user expect to see?  They expect to see an error message 
telling them that they typed something invalid, and they expect to see 
this input field redisplayed with "1a3" in it, so they can just fix the 
wrong part.  That's exactly what you get if you use a String field in 
your form bean.

What happens if you use an "int" property, though?  Answer:  runtime 
exception because the conversion failed.  This is why the correct design 
pattern for Struts is to use String fields in your form bean, coupled 
with validations that ensure that the characters typed in satisfy the 
requirements of being an integer.  Then, in your Action, use something 
like BeanUtils.copyProperties() to copy these fields to your real Java 
object that uses the real data types -- this will only get called if the 
validations all succeeded, so you won't run the risk of conversion errors.

Craig McClanahan

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


Database record create/update STRUTS pattern

2004-04-09 Thread Stjepan Brbot
Hi all,

before I start with this large mail I have to say that I'm fully aware that STRUTS 
framework is intended for dealing with presentation and controll flow of application - 
not for persitance in database but this is exactly what I'd like to discuss with other 
experienced STRUTS users here.

Actually I need something like STRUTS design pattern how to manage 
presentation/controll flow of application for process of creating/updating records in 
database. I'll try to explain how I did it in my application and like to hear what you 
can say about it, is my approach good or there is better/easier way.

1.) I have the list of records on my "persons.jsp" page (btw, retrieved from database 
using DAO and ValueList patterns). Each record is represented as a link pointing to 
"PopulatePersonAction.do" action and having an ID of particular record as a parameter 
(link like PopulatePersonAction.do?persId=100). That are links for updating records. 
On the bottom of this page there's another link without parameter pointing to the same 
PopulatePersonAction.do for creating new record.

2.) PopulatePersonAction tests request parameter for parameter persId and if it 
receives it then it does retreives data of this record from database and manually 
populates PersonForm (DynaValidatorForm). If PopulatePersonAction does not receive 
persId, PopulatePersonAction leaves PersonForm blank for process of inserting new 
data. In struts-config.xml PopulatePersonAction is defined *without validation* and 
*without input page*.

3.) After manually populating PersonForm, PopulatePersonAction forwards flow to 
"edit-person.jsp" (if it is process of updating - this form is automatically populated 
with record's data otherwise form is blank and ready for creating new record). ID of 
record is saved in hidden form field. New or changed data is submitted to another 
action - DatabaseAction.do.

4) In struts-config.xml file this DatabaseAction is *defined for validation* and 
*having input=edit-person.jsp*. If data from edit-person.jsp does not pass the 
validation, flow is returned to edit-person.jsp for correcting inserted form data. If 
DatabaseAction receives persId (from hidden form field on edit-person.jsp) it knows 
that it is update process and it updates existing record with received data otherwise 
it creates new record. After that DatabaseAction forwards controll to result.jsp.

5) Result.jsp shows the message about saved record.

---

persons.jsp (list) ---> PopulatePersonAction.do (populate/blank) ---> edit-person.jsp 
(html form) ---> DatabaseAction.do (update/create) ---> result.jsp

---

It works but my question is: is it good approach? Is there any easier way of doing 
that?

Furthermore, I'd like to assemble the complete logic of managing this update/create 
process in only one action (it seems that I have to use MappedDispatchAction type of 
action because firstly I must not have validation (PopulatePersonAction) and after 
that I have to use validation before DatabaseAction).

Thank you if you reached this end, and thank you for your feedback in advance,

Stjepan Brbot

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



Struts, JSP Prettifiers

2004-04-09 Thread Reda Mokrane
Hi,
does anyone know of a code prettyfier (like Jalopy)  to formatte Struts tag and JSP.


thanks,




-
Post your free ad now! Yahoo! Canada Personals


ActionForm not String type fields (properties)

2004-04-09 Thread Stjepan Brbot
Hi all,

Does STRUTS ActionForm/DynaForm have to consist only of String object
fields!? Although I saw this strong recommendation in some books and
articles on Internet (since all parameters in Request are Strings) I use
Action and DynaForms with java.lang.Integer fields and everything works
fine! (Integer fields are very convenient when one deals with EJBs where IDs
are of Integer type.) It seems that STRUTS framework automatically converts
Strings from request into defined fields types of Form. Why should one use
only String fields and avoid Form fields other than Strings?

Stjepan Brbot


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



RE: [slightly OT] Any advice for 'jsp.error.useBean.duplicate' ?

2004-04-09 Thread Joe Hertz
> The old 'alternating-table-row-color' trick.
> No doubt there's a better way of doing that too.

Thought about using the "one minus 1|0" trick? 

Initialize some int to 1 or 0:

int index = 0;

Then in your loop do:

index = 1 - index;

And set the color based upon some two element array based on index:

color = colorArray[index];


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



Re: [slightly OT] Any advice for 'jsp.error.useBean.duplicate' ?

2004-04-09 Thread bOOyah
Curtis Taylor wrote:

You're creating the bean "status" in the varStatus declaration in your 
c:forEach action. It's in scope in the loop as "status" already, so you 
don't need to re-initialize it. You can access its attributes inside 
your loop:




...etc.
*sigh*  You are, of course, correct.  I could have sworn I tried that. 
I certainly swore.

Just curious; what're you trying to do inside the loop?
The old 'alternating-table-row-color' trick.


  

  <%-- set style for EVEN rows --%>
  
  <%-- set style for ODD rows --%>
  


No doubt there's a better way of doing that too.

Many thanks Curtis.

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


Re: [slightly OT] Any advice for 'jsp.error.useBean.duplicate' ?

2004-04-09 Thread Curtis Taylor
You're creating the bean "status" in the varStatus declaration in your c:forEach 
action. It's in scope in the loop as "status" already, so you don't need to 
re-initialize it. You can access its attributes inside your loop:




...etc.

Just curious; what're you trying to do inside the loop?

Curtis
--
c dot tee at verizon dot net
bOOyah wrote:
It's killing me.  Here's the snippet:

[ServletException in:/pages/editscheduledetails.jsp]
/pages/editscheduledetails.jsp(276,6) jsp.error.useBean.duplicate'
org.apache.jasper.JasperException: /pages/editscheduledetails.jsp(276,6)
My assumption in that the Jasper compiler thinks I have attempted to use 
a bean multiple times in the same scope or something.

Here's the only piece of that JSP that uses a bean:

Line 276:


  
...
If I change "status" to "qwerty" it all works fine!  The JSP books say 
that the 'varStatus' variable is local to the 'c:forEach' loop!  How can 
I be declaring duplicate beans?  I even added a scope="page" to the 
'useBean' clause, but it made no difference.

I'm not explicitly including other JSPs in this JSP...I'm using Tiles 
and Struts.

Google only returns very scant info about 'jsp.error.useBean.duplicate' :-(

Thanks for any help.



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


Any advice for 'jsp.error.useBean.duplicate' ?

2004-04-09 Thread bOOyah
It's killing me.  Here's the snippet:

[ServletException in:/pages/editscheduledetails.jsp]
/pages/editscheduledetails.jsp(276,6) jsp.error.useBean.duplicate'
org.apache.jasper.JasperException: /pages/editscheduledetails.jsp(276,6)
My assumption in that the Jasper compiler thinks I have attempted to use 
a bean multiple times in the same scope or something.

Here's the only piece of that JSP that uses a bean:

Line 276:


  
...
If I change "status" to "qwerty" it all works fine!  The JSP books say 
that the 'varStatus' variable is local to the 'c:forEach' loop!  How can 
I be declaring duplicate beans?  I even added a scope="page" to the 
'useBean' clause, but it made no difference.

I'm not explicitly including other JSPs in this JSP...I'm using Tiles 
and Struts.

Google only returns very scant info about 'jsp.error.useBean.duplicate' :-(

Thanks for any help.

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


RE: [SOLVED] DynaBeans with struts faces

2004-04-09 Thread Joe Hertz
Okay, I aint crazy. And I don't think it's a trivial mistake on my part now.

In struts select boxes, and plain old HTML, if you don't specify a label for 
a given item, you get the value used as your label.

In JSF however, if you don't specify "itemLabel" for a selectItem, you get 
that incredibly descriptive exception "One or more parameters are null"

Thanks for all the help. Sorry it took so much bandwidth. I was alot closer 
than I gave myself credit for.

Whew.

-Joe

 

 

  
  
  
  
  
  




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



Re: html:text for Date property

2004-04-09 Thread Richard Yee
Paul,
You shouldn't keep an instance of SimpleDateFormat as
an instance variable even though you are only using
the parse method. The reason is that the
SimpleDateFormat class is not thread-safe. This is
caused by the fact that the DateFormat class isn't
threadsafe due to the fact that a value (the date
portion of calendar) used only for the duration of a
single public method (parse) in is stored as a member
variable.  (This design flaw was inspired by another
design flaw of a similar
nature in Calendar, but let's not go there.)
See:
http://developer.java.sun.com/developer/bugParade/bugs/4093418.html
http://developer.java.sun.com/developer/bugParade/bugs/4228335.html
http://developer.java.sun.com/developer/bugParade/bugs/4261469.html

So to fix your code, you'd have to put it as a member
variable, thus incurring the overhead of the object
creation each time.

This problem would be very hard to uncover if it went
into production.

Regards,

Richard

--- Paul Barry <[EMAIL PROTECTED]> wrote:
> This seems to work pretty well:
> 
> private Date dateOfBirth;
> private static final DateFormat dateOfBirthFormat =
>  new SimpleDateFormat("MM/dd/");
> 
> public Date getDateOfBirth() {
>  return dateOfBirth;
> }
> 
> public void setDateOfBirth(Date dateOfBirth) {
>  this.dateOfBirth = dateOfBirth;
> }
> 
> public String getDateOfBirthString() {
>  return dateOfBirthFormat.format(dateOfBirth);
> }
>   
> public void setDateOfBirthString(String
> dateOfBirthString)
>  throws ParseException {
>  this.dateOfBirth =
> dateOfBirthFormat.parse(dateOfBirthString);   
> }
> 
> And then I use dateOfBirthString as the property in
> the  tag. 
>   I'll also create a rule in the validator to make
> sure that 
> dateOfBirthString is the right format, so the
> ParseException never happens.
> 
> Christian Bollmeyer wrote:
> 
> > On Friday 09 April 2004 21:19, Paul Barry wrote:
> > 
> > Generally, it's a good idea to have only String
> and boolean
> > properties in an ActionForm and convert the
> information
> > gathered for further processing lateron. For
> complex
> > validations (like Dates), I usually check in
> validate() if
> > the value entered can be successfully converted
> via
> > SimpleDateFormat and do the actual conversion when
> > populating the VO bean. But you can have 2
> properties
> > in the form as well. 
> > 
> > HTH,
> > -- Chris.
> > 
> > BTW, as such conversions are needed quite often,
> > it's a good idea to write a small utility function
> that
> > does the conversion check and put it in either
> > your BaseActionForm or some general utility class.
> > 
> > 
> >>Yeah, I guess I could do that.  I think need 2
> properties.  I would
> >>create a dateAsString property, have the form get
> and set that, and
> >>then have the getters and setters set and convert
> the actual Date. 
> >>This way I can call getDate to get a Date and
> getDateAsString to get
> >>it as a formatted String.
> >>
> >>Are their other ways to handle this, so I don't
> need 2 properties?
> >>
> >>Slattery, Tim - BLS wrote:
> >>
> ActionForm has a object that has a Date property
> that I want to
> set.
> 
> So I have
> 
> 
> 
> If I populate the that property in the Action
> like this:
> 
> MyObject obj = new MyObject();
> obj.setDate(new Date());
> form.setObject(obj);
> 
> The html:text tag does a toString() on the
> object.date property. 
> How can I get it to display in the MM/DD/
> format instead?
> Likewise, how
> do I make it so the user can enter a date in the
> format of
> MM/DD/ and have it correctly set the Date
> property?
> >>>
> >>>I'd have the getter format the Date as a string
> (use
> >>>SimpleDateFormat.format(), you can specify any of
> a wide variety of
> >>>formats). Likewise, the setter should accept a
> string and use
> >>>SimpleDateFormat.parse() to turn it into a Date.
> If parse() returns
> >>>null then the String could not be turned into a
> Date, and you need
> >>>to display an error message.
> >>>
> >>>
>
>>>---
> >>>-- 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]
> > 
> > 
> >
>
-
> > 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]
> 


__
Do you Yahoo!?
Yahoo! Small Business $15K Web Design Giveaway 
http://promotions.yahoo.com/design_giveaway/


Re: Struts with Tomcat and Apache

2004-04-09 Thread Christian Bollmeyer
On Friday 09 April 2004 21:55, Ralf Schneider wrote:

Hi,

I've experimented with the same setup some time
ago and found this helpful:

http://cymulacrum.net/writings/tomcat5/c831.html

HTH,
-- Chris.

NB. Luckily, there are binary versions of mod_jk2
available now, so you can skip the first part 
(http://www.apache.de/dist/jakarta/tomcat-connectors/jk2/binaries/)

> Hi,
>
> I'm new to Struts and I'm trying to install Struts 1.1 with Tomcat
> 5.0.16 and Apache 2.0.48. The documentation only talks about Tomcat
> 3.x.
>
> My first try was to follow these instructions for Tomcat 3.2.1. I
> copied the war files included with the binary distribution into the
> webapps directory of my Tomcat installation. Then I restarted Tomcat,
> but the file tomcat-apache.conf is not generate as described in the
> docs.
>
> So, I assume the installation works a bit different with these newer
> versions, but how? I that described anywhere? And if yes, where?
>
> Any hint would be apreciated,
> Ralf.
>
>
> -
> 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]



[OT] RE: Hiding the .do part in the site address

2004-04-09 Thread Wendy Smoak
> From: Christian Bollmeyer [mailto:[EMAIL PROTECTED] 

> Nope :-) 

Yes, I stand corrected by Craig already.  Tomcat used to redirect, and
I'd occasionally dig up an ancient bug report where the decision was
made in order to convince people that no, you can't make it stop
redirecting.  But now you can, with Tomcat 5. :)

-- 
Wendy Smoak
Application Systems Analyst, Sr.
ASU IA Information Resources Management

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



Re: Hiding the .do part in the site address

2004-04-09 Thread Christian Bollmeyer
On Friday 09 April 2004 22:42, Craig McClanahan wrote:
> Wendy Smoak wrote:
> >>From: Christian Bollmeyer [mailto:[EMAIL PROTECTED]
> >>Already tried s/th like 
> >>in your index.jsp? :-)
> >
> >But then the URL will still have 'index.jsp' in it, at least if
> > Tomcat is involved.  IIRC, Tomcat redirects to the welcome page, so
> > there's going to be something on the URL after the domain name.
> >
> >I think this is more a function of what HTTP server and Servlet
> >Container you're using than something to do with Struts.
>
> Whether the container does a forward or a redirect is container
> dependent ... IIRC Tomcat 5 went back to using a forward for this.
>
> Craig

Thanks - learned something new :-) Well, so Resin, Oracle iAS,
Orion and Tomcat 5 do a forward, while Tomcat 4.1.27 seems to do
a redirect indeed. Strangely enough, Hans Bergsten's LWS 3
(which is built on the TC 4.1.27 core) does not. But it's too late 
tonight for further investigation :-)

-- Chris.

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



Re: html:text for Date property

2004-04-09 Thread Paul Barry
This seems to work pretty well:

private Date dateOfBirth;
private static final DateFormat dateOfBirthFormat =
new SimpleDateFormat("MM/dd/");
public Date getDateOfBirth() {
return dateOfBirth;
}
public void setDateOfBirth(Date dateOfBirth) {
this.dateOfBirth = dateOfBirth;
}
public String getDateOfBirthString() {
return dateOfBirthFormat.format(dateOfBirth);
}

public void setDateOfBirthString(String dateOfBirthString)
throws ParseException {
this.dateOfBirth = dateOfBirthFormat.parse(dateOfBirthString);  
}
And then I use dateOfBirthString as the property in the  tag. 
 I'll also create a rule in the validator to make sure that 
dateOfBirthString is the right format, so the ParseException never happens.

Christian Bollmeyer wrote:

On Friday 09 April 2004 21:19, Paul Barry wrote:

Generally, it's a good idea to have only String and boolean
properties in an ActionForm and convert the information
gathered for further processing lateron. For complex
validations (like Dates), I usually check in validate() if
the value entered can be successfully converted via
SimpleDateFormat and do the actual conversion when
populating the VO bean. But you can have 2 properties
in the form as well. 

HTH,
-- Chris.
BTW, as such conversions are needed quite often,
it's a good idea to write a small utility function that
does the conversion check and put it in either
your BaseActionForm or some general utility class.

Yeah, I guess I could do that.  I think need 2 properties.  I would
create a dateAsString property, have the form get and set that, and
then have the getters and setters set and convert the actual Date. 
This way I can call getDate to get a Date and getDateAsString to get
it as a formatted String.

Are their other ways to handle this, so I don't need 2 properties?

Slattery, Tim - BLS wrote:

ActionForm has a object that has a Date property that I want to
set.
So I have



If I populate the that property in the Action like this:

MyObject obj = new MyObject();
obj.setDate(new Date());
form.setObject(obj);
The html:text tag does a toString() on the object.date property. 
How can I get it to display in the MM/DD/ format instead?
Likewise, how
do I make it so the user can enter a date in the format of
MM/DD/ and have it correctly set the Date property?
I'd have the getter format the Date as a string (use
SimpleDateFormat.format(), you can specify any of a wide variety of
formats). Likewise, the setter should accept a string and use
SimpleDateFormat.parse() to turn it into a Date. If parse() returns
null then the String could not be turned into a Date, and you need
to display an error message.
---
-- 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]


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


Re: Hiding the .do part in the site address

2004-04-09 Thread Christian Bollmeyer
On Friday 09 April 2004 21:56, Wendy Smoak wrote:
> > From: Christian Bollmeyer [mailto:[EMAIL PROTECTED]
> > Already tried s/th like 
> > in your index.jsp? :-)
>
> But then the URL will still have 'index.jsp' in it, at least if
> Tomcat is involved.  IIRC, Tomcat redirects to the welcome page, so
> there's going to be something on the URL after the domain name.
>
> I think this is more a function of what HTTP server and Servlet
> Container you're using than something to do with Struts.

Nope :-) This is the complete index.jsp file from
www.christianbollmeyer.de:

<%@ page contentType="text/html; charset=ISO-8859-1" session="false" %>
 

which runs on Resin. But I used the same approach
e.g. for www.anwalt4you.com which runs on Tomcat
(5, but we didn't use Servlet 2.4 features which
IIRC enable one to use a welcome file that doesn't
physically exist, such as a Struts .do action, just to
note). The mechanism itself is independent from
container implementations: as a forward doesn't
change the browser URL, you can just enter
www.christianbollmeyer.de and it sticks to that, 
though main.do and Tiles do the actual job. If you
invoke the above URL by explicitly specifying
index.jsp (or main.do), the same is true, of course,
but after all, that's just how it should work.

-- Chris.

Just to make sure: of course, I added index.jsp
to the  list (web.xml). The only
reason why I have it at all is the circumstance
that the welcome file has to be a physical one.

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



Servlet filters with Struts

2004-04-09 Thread Kommana, Sridhar
Hi,

  Iam using TimerFilter in my application which gives the response time taken for 
executing the each Action class. Does this will affect the performance of the 
application on production environment. Is there any known performance or stability 
issues with Servlet filters with Struts?

Thanks in advance,

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



Re: Hiding the .do part in the site address

2004-04-09 Thread Craig McClanahan
Wendy Smoak wrote:

From: Christian Bollmeyer [mailto:[EMAIL PROTECTED] 
Already tried s/th like 
in your index.jsp? :-)
   

But then the URL will still have 'index.jsp' in it, at least if Tomcat
is involved.  IIRC, Tomcat redirects to the welcome page, so there's
going to be something on the URL after the domain name.
I think this is more a function of what HTTP server and Servlet
Container you're using than something to do with Struts.
 

Whether the container does a forward or a redirect is container 
dependent ... IIRC Tomcat 5 went back to using a forward for this.

Craig

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


Re: DynaBeans with struts faces

2004-04-09 Thread Craig McClanahan
Joe Hertz wrote:



Craig McC writes:

 

Could you refresh us on what your JSP code looks like now?
   

I've since gone to a datatable. Below is struts-faces and non-struts versions

I did recognize that the nested form bean approach wasn't the optimal way of 
doing once I could put my "real" object into the UI, so I've since modified 
the populating Action to take the objects it gets out of the database and 
stash them into List property (items) of the (Session Scoped, per struts-
config.xml) Dynabean. Still doesn't work any better though. Thinking, "Oh, 
I'm trying to session scope it. Maybe it belongs in faces-config too." didn't 
seem to help.

MaintenanceListForm is the DynaBean which contains a List named "items".

In thinking about it now, it's no great horror to make that one DynaBean 
a "POB". My dependence on DynaBeans came from Struts' need for Form Beans 
with String Properties, and my wanting a fast way to declare them.

One thing I am wondering about (and watch this show all sorts of light on the 
subject) is how is it that JSF knows what actual class "item" is an instance 
of?
 

The current implementation uses reflection at runtime to discover this.  
There is a standard JSF API called a PropertyResolver that contains 
methods like:

   public Object getValue(Object base, Object propertyName);
   public void setValue(Object base, Object propertyName, Object newValue);
that is called for each "." in the expression, so you can plug in 
specialized behavior for what the "." means.  Out of the box, "." 
understands things like beans (call the property getter or setter) and 
Maps (call the get() or put() method).  In the struts-faces integration 
library, I added a PropertyResolver that understands DynaBeans as the 
"base" object, and calls the get() or set() method on it.

JSF snippet:



 
   
	 
   
   
   
 
 
   
	 
   
   
 
< 
   
	 
   
 
 

You also need value="#{item.currency}" here, assuming that you have a 
String property named "currency" on whatever class an "item" actually is.

Craig

 
 
 
 
 

 
   
 
   
   
 
 
   
 
   
   
 

Struts snippet:


Credit Cost Management

Cost Per Credit
Minimum Purchase
Currency
Begin Date
End Date






 
 
 
 









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


Re: html:text for Date property

2004-04-09 Thread Christian Bollmeyer
On Friday 09 April 2004 21:19, Paul Barry wrote:

Generally, it's a good idea to have only String and boolean
properties in an ActionForm and convert the information
gathered for further processing lateron. For complex
validations (like Dates), I usually check in validate() if
the value entered can be successfully converted via
SimpleDateFormat and do the actual conversion when
populating the VO bean. But you can have 2 properties
in the form as well. 

HTH,
-- Chris.

BTW, as such conversions are needed quite often,
it's a good idea to write a small utility function that
does the conversion check and put it in either
your BaseActionForm or some general utility class.

> Yeah, I guess I could do that.  I think need 2 properties.  I would
> create a dateAsString property, have the form get and set that, and
> then have the getters and setters set and convert the actual Date. 
> This way I can call getDate to get a Date and getDateAsString to get
> it as a formatted String.
>
> Are their other ways to handle this, so I don't need 2 properties?
>
> Slattery, Tim - BLS wrote:
> >>ActionForm has a object that has a Date property that I want to
> >> set.
> >>
> >>So I have
> >>
> >>
> >>
> >>If I populate the that property in the Action like this:
> >>
> >>MyObject obj = new MyObject();
> >>obj.setDate(new Date());
> >>form.setObject(obj);
> >>
> >>The html:text tag does a toString() on the object.date property. 
> >> How can I get it to display in the MM/DD/ format instead?
> >>Likewise, how
> >>do I make it so the user can enter a date in the format of
> >> MM/DD/ and have it correctly set the Date property?
> >
> > I'd have the getter format the Date as a string (use
> > SimpleDateFormat.format(), you can specify any of a wide variety of
> > formats). Likewise, the setter should accept a string and use
> > SimpleDateFormat.parse() to turn it into a Date. If parse() returns
> > null then the String could not be turned into a Date, and you need
> > to display an error message.
> >
> >
> > ---
> >-- 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]

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



Re: can iframe include files in web-info folder

2004-04-09 Thread Christian Bollmeyer
On Friday 09 April 2004 16:19, dream_and_yang wrote:

No, you can't include such files directly, as the container
forbids direct access to anything underneath WEB-INF.
But of course, you can always wrap test.jsp in a
ForwardAction and set your  tag to load
that instead: 

HTH,
-- Chris

> 1.in my jsp page information.jsp I do this:
>   src="/web-inf/test.jsp"> but when the Tomcat 5.0 just tell me that
> such page is not available. 2.Then i try another way.
>   i created another page called import page,in this page:
>   
>   <%jsp:include page="information.jsp" %>
>   Here HTMLUrl comes from my Struts Action,and refer the URL in want
> to import in the iframe.
>   This time,I do get it worked and have HTMLUrl page in the
> iframe,The problem is when the HTMLUrl has changed,The page in the
> iframe didn't changed at the same time.
>I use ,i can see this also changed.
>
>   Hoping someone to help me,Thank you very much!
>
>
> dream_and_yang
> [EMAIL PROTECTED]
> 2004-04-09

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



RE: Hiding the .do part in the site address

2004-04-09 Thread Wendy Smoak
> From: Christian Bollmeyer [mailto:[EMAIL PROTECTED] 
> Already tried s/th like 
> in your index.jsp? :-)

But then the URL will still have 'index.jsp' in it, at least if Tomcat
is involved.  IIRC, Tomcat redirects to the welcome page, so there's
going to be something on the URL after the domain name.

I think this is more a function of what HTTP server and Servlet
Container you're using than something to do with Struts.

-- 
Wendy Smoak
Application Systems Analyst, Sr.
ASU IA Information Resources Management 

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



Struts with Tomcat and Apache

2004-04-09 Thread Ralf Schneider
Hi,

I'm new to Struts and I'm trying to install Struts 1.1 with Tomcat 5.0.16 and 
Apache 2.0.48. The documentation only talks about Tomcat 3.x.

My first try was to follow these instructions for Tomcat 3.2.1. I copied the 
war files included with the binary distribution into the webapps directory of 
my Tomcat installation. Then I restarted Tomcat, but the file 
tomcat-apache.conf is not generate as described in the docs.

So, I assume the installation works a bit different with these newer versions, 
but how? I that described anywhere? And if yes, where?

Any hint would be apreciated,
Ralf.


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



RE: html:text for Date property

2004-04-09 Thread Wendy Smoak
> From: Paul Barry [mailto:[EMAIL PROTECTED] 
> Are their other ways to handle this, so I don't need 2 properties?

String properties in the Form, and a utility class to do the conversions
when you need to use it as a Date.  (Possibly a BeanUtils Converter to
do it as part of 'copyProperties' if you have a Date in your business
object?) Any time I've had the idea to use other than String, String[]
or Boolean in an ActionForm, I've ended up changing back.

Or separate fields for month/day/year to keep the users from messing it
up. ;)  Then you can validate on ranges of integers, and string the bits
together to make a Date when you need one.

Then again, I rarely need Dates... in my database, dates are stored as
the number of integers since 12/31/1967.  (I considered offering a prize
to the first person to guess which one, but it's too easy to Google.)

-- 
Wendy Smoak
Application Systems Analyst, Sr.
ASU IA Information Resources Management 

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



Is Struts 1.1 Compatible With Commons-Lang 2.0?

2004-04-09 Thread Hohlen, John C
Does anyone know whether Struts 1.1 is compatible with Commons-Lang 2.0?  There are 
some utilities in the latest version of the Commons-Lang library that we'd really to 
use with our Struts 1.1 based application.  Struts 1.1 comes with Commons-Lang 1.0.1

Thanks,

JOHN

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



RE: Question about throwing an exception in the ValidatorForm validate method.

2004-04-09 Thread Stephan Jones
The RequestProcessor  processPreprocess(request, response) method seems the
best but
 I'm not sure how to override it for my first login page where the valid
session is not set up yet.
Can I give a specific requestProcessor for an individual action mapping?

Thanks for the first response Niall.

Original Message-
From: Niall Pemberton [mailto:[EMAIL PROTECTED]
Sent: April 9, 2004 11:43 AM
To: Struts Users Mailing List
Subject: Re: Question about throwing an exception in the ValidatorForm
validate method.

Do you want to do this on a form by form basis or for all forms?

If you want to do it for all forms then you could either customise
RequestProcessor (maybe in the processPreprocess(request, response) method)
or use a Filter.

If you need to do it on a form by form basis, then why not skip validation
if its expired and let the Action check your session and throw the
Exception.

Niall


- Original Message -
From: "Stephan Jones" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, April 09, 2004 7:06 PM
Subject: Question about throwing an exception in the ValidatorForm validate
method.


> I have a problem I need advice solving.
>
> The Validate method does not allow me to check if the session has expired
> and throw a suitable exception.
> I have the possible scenario where a user calls up a page. Leaves it idle
> long enough to expire the session. Then hits the update button.
>
> What happens is the validate method is called and the record is validated.
> Since the session has timed out when the  input page with an error is
> presented some of the values on my page, (like the current logged in user)
> are no longer available.
>
> Ideally I would like to check the session in the validate method, throw my
> usual SessionExpiredException if the session is blank but the validate
> method does not allow me to override the ValidatorForm validate method.
>
> Any advice on how to elegantly solve this?
>
>
>
>
>



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



Re: Hiding the .do part in the site address

2004-04-09 Thread Christian Bollmeyer
On Friday 09 April 2004 21:33, Erez Efrati wrote:

Already tried s/th like 
in your index.jsp? :-)

HTH,

-- Chris.

> Hi,
>
> Like all Struts application I have the index.jsp redirecting the user
> client to my "home.do" struts action.
>
> Is it possible to get rid of the "home.do" in the address bar so at
> least in the site home page the site address will show a clean
> address of www.mysite.com   ?
>
> Thanks in advance,
>
> Erez

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



Re: html:text for Date property

2004-04-09 Thread Paul Barry
Yeah, I guess I could do that.  I think need 2 properties.  I would 
create a dateAsString property, have the form get and set that, and then 
have the getters and setters set and convert the actual Date.  This way 
I can call getDate to get a Date and getDateAsString to get it as a 
formatted String.

Are their other ways to handle this, so I don't need 2 properties?

Slattery, Tim - BLS wrote:

ActionForm has a object that has a Date property that I want to set.

So I have



If I populate the that property in the Action like this:

MyObject obj = new MyObject();
obj.setDate(new Date());
form.setObject(obj);
The html:text tag does a toString() on the object.date property.  How 
can I get it to display in the MM/DD/ format instead?  
Likewise, how 
do I make it so the user can enter a date in the format of MM/DD/ 
and have it correctly set the Date property?


I'd have the getter format the Date as a string (use
SimpleDateFormat.format(), you can specify any of a wide variety of
formats). Likewise, the setter should accept a string and use
SimpleDateFormat.parse() to turn it into a Date. If parse() returns null
then the String could not be turned into a Date, and you need to display an
error message.
-
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]


Re: [solved] RE: no getter method found for property - using DynaActionForms

2004-04-09 Thread bradyh
Uh...you do mean "form-property" (with a "t") right?

Though I like form-properly...it's more polite.  :-)

Brady
 
> Found my error! I seem to have problems with spelling ("form-properly"?
> hehe)
> 
> Sorry for the spam :)
> 
> Jin Lee
> -Original Message-
> From: Jin Lee [mailto:[EMAIL PROTECTED] 
> Sent: Friday, April 09, 2004 11:16 AM
> To: [EMAIL PROTECTED]
> Subject: no getter method found for property - using DynaActionForms
> 
> Hey all,
> 
>  
> 
> I have a very simple form and a DynaActionForm associated with it. When I
> try to load the page I get the following error:
> 
>  
> 
> javax.servlet.ServletException: No getter method for property SelectCourseID
> of bean org.apache.struts.taglib.html.BEAN
>  
> org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextI
> mpl.java:867)
>  
> org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImp
> l.java:800)
>  
> org.apache.jsp.pages.course.welcome_jsp._jspService(welcome_jsp.java:154)
> 
> .
> 
> .
> 
> .
> 
>  
> 
> Here is my DynaActionForm:
> 
>  
> 
> 
>  
> name="CourseWorksheetForm"
> 
>  
> type="org.apache.struts.action.DynaActionForm">
> 
>  
> 
>  
>  initial="false"/>
> 
>  
>  initial="false"/>
> 
>  
>  initial="false"/>
> 
>  
>  initial="false"/>
> 
>  
>  initial="false"/>
> 
>  
> 
> 
>  
> 
>  
> 
> 
>  
> 
> 
>  
> 
> 
>  
> 
> 
>  
> 
> 
>  
> 
>  
> 
> Here is my action mapping:
> 
>  
> 
>  
>  
> path="/course/CourseWorksheet"
> 
>  
> parameter="method"
> 
>  
> scope="request"
> 
>  
> name="CourseWorksheetForm"
> 
>  
> validate="false"
> 
>  
> type="edu.unex.exquery.course.CourseWorksheetAction">
> 
> 
> 
>  
> 
> 
>  
> 
> 
> 
> 
>  
> 
> Note: I have a separate struts config file for just my form beans and I
> reference both config files in my web.xml (comma delimited).
> 
>  
> 
> Any help?
> 
>  
> 
> Thanks,
> 
>  
> 
> Jin Lee (newbie struts developer - first post)
> 
> 
> 
> -
> 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]



[solved] RE: no getter method found for property - using DynaActionForms

2004-04-09 Thread Jin Lee

Found my error! I seem to have problems with spelling ("form-properly"?
hehe)

Sorry for the spam :)

Jin Lee
-Original Message-
From: Jin Lee [mailto:[EMAIL PROTECTED] 
Sent: Friday, April 09, 2004 11:16 AM
To: [EMAIL PROTECTED]
Subject: no getter method found for property - using DynaActionForms

Hey all,

 

I have a very simple form and a DynaActionForm associated with it. When I
try to load the page I get the following error:

 

javax.servlet.ServletException: No getter method for property SelectCourseID
of bean org.apache.struts.taglib.html.BEAN
 
org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextI
mpl.java:867)
 
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImp
l.java:800)
 
org.apache.jsp.pages.course.welcome_jsp._jspService(welcome_jsp.java:154)

.

.

.

 

Here is my DynaActionForm:

 

   

 

 


 


 


 


 


 


 

 


 


 


 


 


 

 

Here is my action mapping:

 





 


 




 

Note: I have a separate struts config file for just my form beans and I
reference both config files in my web.xml (comma delimited).

 

Any help?

 

Thanks,

 

Jin Lee (newbie struts developer - first post)



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



RE: html:text for Date property

2004-04-09 Thread Slattery, Tim - BLS
> ActionForm has a object that has a Date property that I want to set.
> 
> So I have
> 
> 
> 
> If I populate the that property in the Action like this:
> 
> MyObject obj = new MyObject();
> obj.setDate(new Date());
> form.setObject(obj);
> 
> The html:text tag does a toString() on the object.date property.  How 
> can I get it to display in the MM/DD/ format instead?  
> Likewise, how 
> do I make it so the user can enter a date in the format of MM/DD/ 
> and have it correctly set the Date property?

I'd have the getter format the Date as a string (use
SimpleDateFormat.format(), you can specify any of a wide variety of
formats). Likewise, the setter should accept a string and use
SimpleDateFormat.parse() to turn it into a Date. If parse() returns null
then the String could not be turned into a Date, and you need to display an
error message.


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



Re: DynaBeans with struts faces

2004-04-09 Thread Joe Hertz


Craig McC writes:

> Could you refresh us on what your JSP code looks like now?

I've since gone to a datatable. Below is struts-faces and non-struts versions

I did recognize that the nested form bean approach wasn't the optimal way of 
doing once I could put my "real" object into the UI, so I've since modified 
the populating Action to take the objects it gets out of the database and 
stash them into List property (items) of the (Session Scoped, per struts-
config.xml) Dynabean. Still doesn't work any better though. Thinking, "Oh, 
I'm trying to session scope it. Maybe it belongs in faces-config too." didn't 
seem to help.

MaintenanceListForm is the DynaBean which contains a List named "items".

In thinking about it now, it's no great horror to make that one DynaBean 
a "POB". My dependence on DynaBeans came from Struts' need for Form Beans 
with String Properties, and my wanting a fast way to declare them.

One thing I am wondering about (and watch this show all sorts of light on the 
subject) is how is it that JSF knows what actual class "item" is an instance 
of?

JSF snippet:



  

 



  
  

 


  
< 

 

  
  
  
  
  
  

  

 


  
  

 


  



Struts snippet:


Credit Cost Management

Cost Per Credit
Minimum Purchase
Currency
Begin Date
End Date






  
  
  
  









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



html:text for Date property

2004-04-09 Thread Paul Barry
What is the best way to deal with a Date property in an ActionForm?  My 
ActionForm has a object that has a Date property that I want to set.

So I have



If I populate the that property in the Action like this:

MyObject obj = new MyObject();
obj.setDate(new Date());
form.setObject(obj);
The html:text tag does a toString() on the object.date property.  How 
can I get it to display in the MM/DD/ format instead?  Likewise, how 
do I make it so the user can enter a date in the format of MM/DD/ 
and have it correctly set the Date property?

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


controller cache="false" and client cache

2004-04-09 Thread Paulo Alvim
Hi!

I'm trying to implement a Filter that tells the Browser to cache images for
a few URLs as the article from

http://www.onjava.com/pub/a/onjava/2004/03/03/filters.html

...but it isn't working with my Struts apps.

I'd like to know if the cache="false" attribute in the controller section
could be the cause.

Thanks a lot!

Paulo Alvim
Powerlogic
Brazil


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



Re: Question about throwing an exception in the ValidatorForm validate method.

2004-04-09 Thread Niall Pemberton
Do you want to do this on a form by form basis or for all forms?

If you want to do it for all forms then you could either customise
RequestProcessor (maybe in the processPreprocess(request, response) method)
or use a Filter.

If you need to do it on a form by form basis, then why not skip validation
if its expired and let the Action check your session and throw the
Exception.

Niall


- Original Message - 
From: "Stephan Jones" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, April 09, 2004 7:06 PM
Subject: Question about throwing an exception in the ValidatorForm validate
method.


> I have a problem I need advice solving.
>
> The Validate method does not allow me to check if the session has expired
> and throw a suitable exception.
> I have the possible scenario where a user calls up a page. Leaves it idle
> long enough to expire the session. Then hits the update button.
>
> What happens is the validate method is called and the record is validated.
> Since the session has timed out when the  input page with an error is
> presented some of the values on my page, (like the current logged in user)
> are no longer available.
>
> Ideally I would like to check the session in the validate method, throw my
> usual SessionExpiredException if the session is blank but the validate
> method does not allow me to override the ValidatorForm validate method.
>
> Any advice on how to elegantly solve this?
>
>
>
>
>



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



RE: Hiding the .do part in the site address

2004-04-09 Thread MARU, SOHIL (SBCSI)
Use the  to specify the home page in your web.xml.
That should allow you to get to the home page without .do.

-Original Message-
From: Erez Efrati [mailto:[EMAIL PROTECTED] 
Sent: Friday, April 09, 2004 2:33 PM
To: 'Struts Users Mailing List'
Subject: Hiding the .do part in the site address


Hi,
 
Like all Struts application I have the index.jsp redirecting the user
client to my "home.do" struts action. 
 
Is it possible to get rid of the "home.do" in the address bar so at
least in the site home page the site address will show a clean address
of www.mysite.com   ?
 
Thanks in advance,
 
Erez
 
 

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



Hiding the .do part in the site address

2004-04-09 Thread Erez Efrati
Hi,
 
Like all Struts application I have the index.jsp redirecting the user
client to my "home.do" struts action. 
 
Is it possible to get rid of the "home.do" in the address bar so at
least in the site home page the site address will show a clean address
of www.mysite.com   ?
 
Thanks in advance,
 
Erez
 
 


no getter method found for property - using DynaActionForms

2004-04-09 Thread Jin Lee
Hey all,

 

I have a very simple form and a DynaActionForm associated with it. When I
try to load the page I get the following error:

 

javax.servlet.ServletException: No getter method for property SelectCourseID
of bean org.apache.struts.taglib.html.BEAN
 
org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextI
mpl.java:867)
 
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImp
l.java:800)
 
org.apache.jsp.pages.course.welcome_jsp._jspService(welcome_jsp.java:154)

.

.

.

 

Here is my DynaActionForm:

 

   

 

 


 


 


 


 


 


 

 


 


 


 


 


 

 

Here is my action mapping:

 





 


 




 

Note: I have a separate struts config file for just my form beans and I
reference both config files in my web.xml (comma delimited).

 

Any help?

 

Thanks,

 

Jin Lee (newbie struts developer - first post)



Question about throwing an exception in the ValidatorForm validate method.

2004-04-09 Thread Stephan Jones
I have a problem I need advice solving.

The Validate method does not allow me to check if the session has expired
and throw a suitable exception.
I have the possible scenario where a user calls up a page. Leaves it idle
long enough to expire the session. Then hits the update button.

What happens is the validate method is called and the record is validated.
Since the session has timed out when the  input page with an error is
presented some of the values on my page, (like the current logged in user)
are no longer available.

Ideally I would like to check the session in the validate method, throw my
usual SessionExpiredException if the session is blank but the validate
method does not allow me to override the ValidatorForm validate method.

Any advice on how to elegantly solve this?






Re: DynaBeans with struts faces

2004-04-09 Thread Craig McClanahan
Joe Hertz wrote:

Matthias-

I've tried it both ways. I suspect the problem is my JSTL Knowledge. Code 
follows.

The problem, I believe boils down to, "How do I get at the item var declared 
in the datatable/foreach? I can't use a ".", right?

 

Actually, you can, in JSF expressions ("#{foo.bar}").  The struts-faces 
integration library includes a customized PropertyResolver class that 
makes JSF understand what a DynaBean is.  However, you're going to find 
that  and JSF components don't interoperate well, so 
Matthias's advice about using  is well advised.

Then again, it could be something very different FAIK. I'm getting the 
wonderfully helpful exception,"One or more parameters are null", so I'm sure 
it's something obvious I am doing wrong in my JSP. None of the values in my 
beans are null.

 

Could you refresh us on what your JSP code looks like now?

Going back to your earlier comment "both the list and the component 
Objects are declared as Dynabeans in struts-config", this doesn't sound 
like quite the right strategy in general -- dynabeans in Struts are 
focused on being *form* beans, not general purpose data objects.  For 
that, you might want to investigate how managed beans work in JSF, which 
is somewhat a generalization on how Struts creates form beans on 
demand.  You declare such a bean in faces-config.xml, and it gets 
instantiated on demand the first time it is referenced in an EL expression.

For example, let's say that you need to dynamically populate the set of 
options for an .  Let's include the following code 
snippet in the JSP page:

 
   
 
Note that we're using a single tag inside, pointing at a property getter 
that will return the dynamically calculated list, instead of trying to 
manually list the items in the page.  This is analogous to using the 
Struts  tag instead of a bunch of  tags to 
construct the options list.

This exampe assumes that "item" is a bean (either a real JavaBean or a 
DynaBean if you're using struts-faces.jar) that has a "currency" 
property of type String.  Note also that I put the expression in the 
*value* attribute ... one of your snippets had it in the "id", which 
isn't going to work.  In the faces-config.xml file, create an entry like 
this:

 
   currencies
   
com.mycompany.CurrenciesListFactory
   application
 

which says "the first time any JSF EL expression mentions "currencies", 
instantiate a CurrenciesListFactory object and stick it in application 
scope".  (This assumes you want to share the list across all users -- if 
the list is unique to each user, stick it in session scope instead and 
each user will get their own instance.)

Now, the factory class might look something like this:

   package com.mycompany;
   import java.util.ArrayList;
   import java.util.List;
   import javax.faces.model.SelectItem;
   public class CurrenciesListFactory {
   private List currencyList = null;
   public List getCurrencyList() {
   if (currencyList == null) {
   currencyList = new ArrayList();
   Iterator items  = ... iterate over database rows or 
whatever ...
   while (items.hasNext()) {
   Item item = items.next();
   currencyList.add(new SelectItem(item.getValue(), 
item.getName());
   }
   }
   return currencyList;
   }

   }

Using this strategy, your list of available currencies will be 
auto-magically created the first time someone uses the expression 
"#{currencies.currencyList}".  It also nicely separates the business 
logic needed to construct the options list out of your page, and lets 
the page author focus on the look and feel issues.  The factory bean is 
also easily unit testable ... it's only dependence on JSF APIs is the 
SelectItem class, which is a real simple JavaBean that represents an 
individual selection option.

-Joe, hoping the answer isn't *too* embarrassing.

 

Craig



 
   
	 
   
   
   
 
 
   
	 
   
   
 
< 
   
	 
   
 
 

You probably want a value attribute here, with an expression like 
"#{item.currency}".

 
 
 
 
 

 
   
 
   
   
 
 
   
 
   
   
 



 

-Original Message-
From: Matthias Wessendorf [mailto:[EMAIL PROTECTED] 
Sent: Friday, April 09, 2004 8:19 AM
To: [EMAIL PROTECTED]
Subject: RE: DynaBeans with struts faces 

Joe,
can you provide some code ?
btw.
i would use -Tag for "forEach" in JSF
and  for rendering 
like this:

 
   
 
   
   

   
  
   
 

note with  you can "group" components logicaly. 
dataTable has a "footer" and a "header" it renders  
and  for a HTML-Table

and look at http://myfaces.sf.net
they have a nice example for editing table
-->Master/Detail-Example
hope that was helpful
Cheers
Matthias

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


   

---

Re: Custom ActionForward subclass in web.xml

2004-04-09 Thread Niall Pemberton
Well there is for global forwards, but it seems to be missing for the
forwards in an action. For global forwards you can create your own
ModuleConfigFactory, in which you can set the global forward class name (as
well as the Action Mapping class). But from what I see, you can't change the
default class for forwards in the action.

I'm going to ask about this on the devlopers list because it looks like an
oversight to me.

Niall

- Original Message - 
From: "Kumar M" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Thursday, April 08, 2004 11:35 PM
Subject: Re: Custom ActionForward subclass in web.xml


> Deprecated in 1.1
> Not sure if there is a replacement mechanism other than adding
> "className" to each forward element.
>
> [EMAIL PROTECTED] wrote:
>
> >Deprecated in 1.2 or in 1.1?  Is there a replacement mechanism?
> >
> >-Original Message-
> >From: Kumar M [mailto:[EMAIL PROTECTED]
> >Sent: Thursday, April 08, 2004 4:45 PM
> >To: Struts Users Mailing List
> >Subject: Re: Custom ActionForward subclass in web.xml
> >
> >
> >
> >You could use the "forward" param for ActionServlet:
> >
> >
> >  forward
> >  com.this.is.my.CustomActionForward
> >
> >
> >But, I think this is deprecated.
> >
> >[EMAIL PROTECTED] wrote:
> >
> >
> >
> >>I ready how to do this once, and I can't seem to find the
> >>doc/article/email I read it in.
> >>
> >>I want to make my subclass of ActionForward the default used by the
> >>entire application, so I don't have to do:
> >>
> >>
> >>
> >>Every time I want to use it.  I know there's something you can put in
> >>web.xml that tells struts which class to use, can anyone send me a
> >>snippet or point me to something you have bookmarked?
> >>
> >>Chip Paul
> >>Sr Software Engineer
> >>ComFrame Software Corporation
> >>
> >>Listen.Understand.Innovate
> >>www.comframe.com
> >>
> >>
> >>-
> >>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]
> >
> >-
> >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]



Re: Slightly OT: Preventing of buffer flush with tiles:insert

2004-04-09 Thread Richard Yee
Shahak,
Why won't a filter work in you Servlet 2.3
environment? Filters exist in the Servlet 2.3 spec.
They don't exist in the Servlet 2.2 spec.

Regards,

Richard

--- [EMAIL PROTECTED] wrote:
> I'm trying to use a custom tag to gzip (compress)
> pages (filter won't work because I'm in a servlet
> 2.3 environment).  On straightforward JSP's, it
> works fine.  But in "layout" JSP's which employ the
>  
> tag, I get IOExceptions and the container complains
> "Illegal to flush within a custom tag," pointing to
>
javax.servlet.jsp.tagext.BodyContent.flush(BodyContent.java:115).
> 
> Looking at the J2EE API docs, it looks like the
> pageContext.include() method (which the tiles:insert
> tag uses) flushes the content before including the
> specified tile/resource.
> 
> I've already tried:
> 
> - Returning EVAL_BODY_BUFFERED in the tag's
> doStartTag() method, in the hopes of flushing the
> "temporary" buffer instead.
> - Setting the tiles:insert "flush" attribute to
> "false", but it looks like from the source code that
> only performs an additional flush before handing
> control over to the pageContent.include(), which
> flushes on its own.
> - Using the page directive to set the buffer size
> extremely high (4096kb) and autoFlush to "false".
> 
> Any ideas?
> 
> Thanks,
> 
> Shahak Nagiel
> Software Engineer
> Northrop Grumman Mission Systems
> 
>
-
> To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> For additional commands, e-mail:
> [EMAIL PROTECTED]
> 


__
Do you Yahoo!?
Yahoo! Small Business $15K Web Design Giveaway 
http://promotions.yahoo.com/design_giveaway/

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



RE: No Suitable Driver problem

2004-04-09 Thread MARU, SOHIL (SBCSI)
Never mind, even though I am using jdk1.4 and tomcat5.0, I had to
replace ojdbc14.jar with classes version to get it to work.

-Original Message-
From: MARU, SOHIL (SBCSI) 
Sent: Friday, April 09, 2004 11:29 AM
To: 'Struts Users Mailing List'
Subject: RE: No Suitable Driver problem


I managed to solve this one, my database url was missing the schema
name, that was causing the problem. I changed it from
jdbc:oracle:[EMAIL PROTECTED] To jdbc:oracle:thin:[EMAIL PROTECTED] But it is still
throwing an exception though a different one. Any pointers?

java.lang.NullPointerException
at
org.apache.commons.dbcp.DelegatingConnection.close(DelegatingConnecti
on.java:195)
at
org.apache.commons.dbcp.PoolableConnection.reallyClose(PoolableConnec
tion.java:129)
at
org.apache.commons.dbcp.PoolableConnectionFactory.destroyObject(Poola
bleConnectionFactory.java:311)
at
org.apache.commons.dbcp.BasicDataSource.validateConnectionFactory(Bas
icDataSource.java:842)
at
org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSou
rce.java:821)
at
org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource
.java:518)
at
com.sbc.hrtech.framework.utility.InitializerPlugin.init(InitializerPl
ugin.java:41)
at
org.apache.struts.action.ActionServlet.initModulePlugIns(ActionServle
t.java:1158)
at
org.apache.struts.action.ActionServlet.init(ActionServlet.java:473)
at javax.servlet.GenericServlet.init(GenericServlet.java:256)
at
org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.
java:1044)
at
org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:88
7)
at
org.apache.catalina.core.StandardContext.loadOnStartup(StandardContex
t.java:3960)
at
org.apache.catalina.core.StandardContext.start(StandardContext.java:4
283)
at
org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1125)

at
org.apache.catalina.core.StandardHost.start(StandardHost.java:832)
at
org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1125)

at
org.apache.catalina.core.StandardEngine.start(StandardEngine.java:518
)
at
org.apache.catalina.core.StandardService.start(StandardService.java:5
19)
at
org.apache.catalina.core.StandardServer.start(StandardServer.java:234
5)
at org.apache.catalina.startup.Catalina.start(Catalina.java:598)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at
org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:297)
at
org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:398)
Excpetion in InitializerPlugin

-Original Message-
From: Jose Rubio [mailto:[EMAIL PROTECTED] 
Sent: Friday, April 09, 2004 10:41 AM
To: Struts Users Mailing List
Subject: Re: No Suitable Driver problem


Do you have your client driver installed?

In DB2 I have to install the driver in my local machine and that also
sets the
path up (Db2 uses some native dll stuff) in order to get the driver to
load.

I used to get the same error.

I hope it helps.

Jose


Quoting "MARU, SOHIL (SBCSI)" <[EMAIL PROTECTED]>:

> Hello All,
> I have been scouring the mailing list archives and lot of other
> places. I am seeing a problem configuring a datasource with Tomcat. I
> saw a lot of posts where the drivername was not being picked up but
none
> where the driver name was being picked up and yet people were getting
> the same error. Thanks for your help in advance.
> 
> I have put the following entry in my server.xml
> 
>docBase="C:\software\eclipse\workspace\HRTechnology\TOMCAT_ROOT"
> reloadable="true">
>auth="Container" type="javax.sql.DataSource"/>
>name="jdbc/loacenet">
>   .
>   .
>   .
>   .
>   
>   
> username
>   
> user
>   
>   
>   
> password
>   
> databasepassword
>   
>   
>   url
>   
> jdbc:oracle:[EMAIL PROTECTED]:1521:[sid]
>   
>   
>   
> driverClassName
>   
> oracle.jdbc.driver.OracleDriver
>

RE: No Suitable Driver problem

2004-04-09 Thread MARU, SOHIL (SBCSI)
I managed to solve this one, my database url was missing the schema
name, that was causing the problem. I changed it from
jdbc:oracle:[EMAIL PROTECTED] To jdbc:oracle:thin:[EMAIL PROTECTED] But it is still
throwing an exception though a different one. Any pointers?

java.lang.NullPointerException
at
org.apache.commons.dbcp.DelegatingConnection.close(DelegatingConnecti
on.java:195)
at
org.apache.commons.dbcp.PoolableConnection.reallyClose(PoolableConnec
tion.java:129)
at
org.apache.commons.dbcp.PoolableConnectionFactory.destroyObject(Poola
bleConnectionFactory.java:311)
at
org.apache.commons.dbcp.BasicDataSource.validateConnectionFactory(Bas
icDataSource.java:842)
at
org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSou
rce.java:821)
at
org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource
.java:518)
at
com.sbc.hrtech.framework.utility.InitializerPlugin.init(InitializerPl
ugin.java:41)
at
org.apache.struts.action.ActionServlet.initModulePlugIns(ActionServle
t.java:1158)
at
org.apache.struts.action.ActionServlet.init(ActionServlet.java:473)
at javax.servlet.GenericServlet.init(GenericServlet.java:256)
at
org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.
java:1044)
at
org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:88
7)
at
org.apache.catalina.core.StandardContext.loadOnStartup(StandardContex
t.java:3960)
at
org.apache.catalina.core.StandardContext.start(StandardContext.java:4
283)
at
org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1125)

at
org.apache.catalina.core.StandardHost.start(StandardHost.java:832)
at
org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1125)

at
org.apache.catalina.core.StandardEngine.start(StandardEngine.java:518
)
at
org.apache.catalina.core.StandardService.start(StandardService.java:5
19)
at
org.apache.catalina.core.StandardServer.start(StandardServer.java:234
5)
at org.apache.catalina.startup.Catalina.start(Catalina.java:598)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at
org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:297)
at
org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:398)
Excpetion in InitializerPlugin

-Original Message-
From: Jose Rubio [mailto:[EMAIL PROTECTED] 
Sent: Friday, April 09, 2004 10:41 AM
To: Struts Users Mailing List
Subject: Re: No Suitable Driver problem


Do you have your client driver installed?

In DB2 I have to install the driver in my local machine and that also
sets the
path up (Db2 uses some native dll stuff) in order to get the driver to
load.

I used to get the same error.

I hope it helps.

Jose


Quoting "MARU, SOHIL (SBCSI)" <[EMAIL PROTECTED]>:

> Hello All,
> I have been scouring the mailing list archives and lot of other
> places. I am seeing a problem configuring a datasource with Tomcat. I
> saw a lot of posts where the drivername was not being picked up but
none
> where the driver name was being picked up and yet people were getting
> the same error. Thanks for your help in advance.
> 
> I have put the following entry in my server.xml
> 
>docBase="C:\software\eclipse\workspace\HRTechnology\TOMCAT_ROOT"
> reloadable="true">
>auth="Container" type="javax.sql.DataSource"/>
>name="jdbc/loacenet">
>   .
>   .
>   .
>   .
>   
>   
> username
>   
> user
>   
>   
>   
> password
>   
> databasepassword
>   
>   
>   url
>   
> jdbc:oracle:[EMAIL PROTECTED]:1521:[sid]
>   
>   
>   
> driverClassName
>   
> oracle.jdbc.driver.OracleDriver
>   
>   
>   
> However when I try to load my plugin in the struts application, I get
> the following exception. I looked at everything on archives and on
there
> people were complaining about NULL

Re: can iframe include files in web-info folder

2004-04-09 Thread Richard Yee
No, an iframe cannot access resources under WEB-INF.
Note that 'WEB-INF' is case-sensitive. You will
eventually encounter problems if you don't use
'WEB-INF' in your paths.

Files located under the WEB-INF directory are only
accessible from within the web application (ie. from
servlets).

Regards,

Richard
 
--- dream_and_yang <[EMAIL PROTECTED]>
wrote:
> 1.in my jsp page information.jsp I do this:
>   scrolling="Auto" src="/web-inf/test.jsp">
>   but when the Tomcat 5.0 just tell me that such
> page is not available.
> 2.Then i try another way.
>   i created another page called import page,in this
> page:
>   
>   <%jsp:include page="information.jsp" %> 
>   Here HTMLUrl comes from my Struts Action,and refer
> the URL in want to import in
>   the iframe.
>   This time,I do get it worked and have HTMLUrl page
> in the iframe,The problem
>  is when the HTMLUrl has changed,The page in the
> iframe didn't changed at the 
>  same time.
>I use ,i can see this
> also changed.
> 
>   Hoping someone to help me,Thank you very much!
>   
> 
> dream_and_yang
> [EMAIL PROTECTED]
> 2004-04-09
> 


__
Do you Yahoo!?
Yahoo! Small Business $15K Web Design Giveaway 
http://promotions.yahoo.com/design_giveaway/

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



RE: [50% SOLVED] Resetting Multibox problems

2004-04-09 Thread Wendy Smoak
> From: Mathieu Grimault [mailto:[EMAIL PROTECTED] 
> I've found a way of bypassing the problem by using a logic:equal and
> logic:notEqual inside the jsp and testing my row value. This way, the
> display is correct... it's just not clean.

You really shouldn't need to do all that.  Here's a working example of
multibox from my project.  In my case 'accountMap' is not a form
property, it's a Map sitting in session scope.  I'm not sure if the code
you posted is wrapped in a  or not?  Stuts will
pre-select the correct checkboxes based on the values in the String[]
form property.

In the JSP





The Form property is a String[]:
 
   
   

And the reset method, which only resets if the form is actually being
submitted:
public void reset( ActionMapping mapping, HttpServletRequest request )
   {
  log.debug( "reset: begin" );
  if ( request.getMethod().equals( "POST" ) ) {
 log.debug( "reset: request was POSTed, resetting" );
 set( "accounts", new String[]{} );
 set( "includeDetail", Boolean.FALSE );
  }
   }

I put this on my Wiki because it comes up often:  
http://wiki.wendysmoak.com/cgi-bin/wiki.pl?StrutsMultiBox

If anyone has suggestions, just edit the page...

Hope that helps!

-- 
Wendy Smoak
Application Systems Analyst, Sr.
ASU IA Information Resources Management 

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



RE: No Suitable Driver problem

2004-04-09 Thread MARU, SOHIL (SBCSI)
I am using oracle. And my driver jar(ojdbc14.jar) is in
tomcat_home/commom/lib

-Original Message-
From: Jose Rubio [mailto:[EMAIL PROTECTED] 
Sent: Friday, April 09, 2004 10:41 AM
To: Struts Users Mailing List
Subject: Re: No Suitable Driver problem


Do you have your client driver installed?

In DB2 I have to install the driver in my local machine and that also
sets the
path up (Db2 uses some native dll stuff) in order to get the driver to
load.

I used to get the same error.

I hope it helps.

Jose


Quoting "MARU, SOHIL (SBCSI)" <[EMAIL PROTECTED]>:

> Hello All,
> I have been scouring the mailing list archives and lot of other
> places. I am seeing a problem configuring a datasource with Tomcat. I
> saw a lot of posts where the drivername was not being picked up but
none
> where the driver name was being picked up and yet people were getting
> the same error. Thanks for your help in advance.
> 
> I have put the following entry in my server.xml
> 
>docBase="C:\software\eclipse\workspace\HRTechnology\TOMCAT_ROOT"
> reloadable="true">
>auth="Container" type="javax.sql.DataSource"/>
>name="jdbc/loacenet">
>   .
>   .
>   .
>   .
>   
>   
> username
>   
> user
>   
>   
>   
> password
>   
> databasepassword
>   
>   
>   url
>   
> jdbc:oracle:[EMAIL PROTECTED]:1521:[sid]
>   
>   
>   
> driverClassName
>   
> oracle.jdbc.driver.OracleDriver
>   
>   
>   
> However when I try to load my plugin in the struts application, I get
> the following exception. I looked at everything on archives and on
there
> people were complaining about NULL for driverClassName, in my case, it
> reads the drivername and url properly and still blows up. Please help.
I
> am using Tomcat 5.0 with the latest ojdbc14.jar(oracle driver for
> jdk1.4, I am running on 1.4.2_03)/commons-dbcp-1.1.jar in common/lib
and
> am trying to connect to oracle 8.1.7. 
> 
> org.apache.commons.dbcp.SQLNestedException: Cannot create JDBC driver
of
> class '
> oracle.jdbc.driver.OracleDriver' for connect URL
> 'jdbc:oracle:[EMAIL PROTECTED]
> :1521:[sid]', cause:
> java.sql.SQLException: No suitable driver
> at java.sql.DriverManager.getDriver(DriverManager.java:243)
> at
> org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSou
> rce.java:743)
> at
> org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource
> .java:518)
> at
> com.sbc.hrtech.framework.utility.InitializerPlugin.init(InitializerPl
> ugin.java:41)
> at
> org.apache.struts.action.ActionServlet.initModulePlugIns(ActionServle
> t.java:1158)
> at
> org.apache.struts.action.ActionServlet.init(ActionServlet.java:473)
> at javax.servlet.GenericServlet.init(GenericServlet.java:256)
> at
> org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.
> java:1044)
> at
> org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:88
> 7)
> at
> org.apache.catalina.core.StandardContext.loadOnStartup(StandardContex
> t.java:3960)
> at
> org.apache.catalina.core.StandardContext.start(StandardContext.java:4
> 283)
> at
> org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1125)
> 
> at
> org.apache.catalina.core.StandardHost.start(StandardHost.java:832)
> at
> org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1125)
> 
> at
> org.apache.catalina.core.StandardEngine.start(StandardEngine.java:518
> )
> at
> org.apache.catalina.core.StandardService.start(StandardService.java:5
> 19)
> at
> org.apache.catalina.core.StandardServer.start(StandardServer.java:234
> 5)
> at
org.apache.catalina.startup.Catalina.start(Catalina.java:598)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
> java:39)
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
> sorImpl.java:25)
> at java.lang.reflect.Method.invoke(Method.java:324)
> at
> org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:297)
> at
> 

Re: No Suitable Driver problem

2004-04-09 Thread Jose Rubio
Do you have your client driver installed?

In DB2 I have to install the driver in my local machine and that also sets the
path up (Db2 uses some native dll stuff) in order to get the driver to load.

I used to get the same error.

I hope it helps.

Jose


Quoting "MARU, SOHIL (SBCSI)" <[EMAIL PROTECTED]>:

> Hello All,
> I have been scouring the mailing list archives and lot of other
> places. I am seeing a problem configuring a datasource with Tomcat. I
> saw a lot of posts where the drivername was not being picked up but none
> where the driver name was being picked up and yet people were getting
> the same error. Thanks for your help in advance.
> 
> I have put the following entry in my server.xml
> 
>docBase="C:\software\eclipse\workspace\HRTechnology\TOMCAT_ROOT"
> reloadable="true">
>auth="Container" type="javax.sql.DataSource"/>
>name="jdbc/loacenet">
>   .
>   .
>   .
>   .
>   
>   
> username
>   
> user
>   
>   
>   
> password
>   
> databasepassword
>   
>   
>   url
>   
> jdbc:oracle:[EMAIL PROTECTED]:1521:[sid]
>   
>   
>   
> driverClassName
>   
> oracle.jdbc.driver.OracleDriver
>   
>   
>   
> However when I try to load my plugin in the struts application, I get
> the following exception. I looked at everything on archives and on there
> people were complaining about NULL for driverClassName, in my case, it
> reads the drivername and url properly and still blows up. Please help. I
> am using Tomcat 5.0 with the latest ojdbc14.jar(oracle driver for
> jdk1.4, I am running on 1.4.2_03)/commons-dbcp-1.1.jar in common/lib and
> am trying to connect to oracle 8.1.7. 
> 
> org.apache.commons.dbcp.SQLNestedException: Cannot create JDBC driver of
> class '
> oracle.jdbc.driver.OracleDriver' for connect URL
> 'jdbc:oracle:[EMAIL PROTECTED]
> :1521:[sid]', cause:
> java.sql.SQLException: No suitable driver
> at java.sql.DriverManager.getDriver(DriverManager.java:243)
> at
> org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSou
> rce.java:743)
> at
> org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource
> .java:518)
> at
> com.sbc.hrtech.framework.utility.InitializerPlugin.init(InitializerPl
> ugin.java:41)
> at
> org.apache.struts.action.ActionServlet.initModulePlugIns(ActionServle
> t.java:1158)
> at
> org.apache.struts.action.ActionServlet.init(ActionServlet.java:473)
> at javax.servlet.GenericServlet.init(GenericServlet.java:256)
> at
> org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.
> java:1044)
> at
> org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:88
> 7)
> at
> org.apache.catalina.core.StandardContext.loadOnStartup(StandardContex
> t.java:3960)
> at
> org.apache.catalina.core.StandardContext.start(StandardContext.java:4
> 283)
> at
> org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1125)
> 
> at
> org.apache.catalina.core.StandardHost.start(StandardHost.java:832)
> at
> org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1125)
> 
> at
> org.apache.catalina.core.StandardEngine.start(StandardEngine.java:518
> )
> at
> org.apache.catalina.core.StandardService.start(StandardService.java:5
> 19)
> at
> org.apache.catalina.core.StandardServer.start(StandardServer.java:234
> 5)
> at org.apache.catalina.startup.Catalina.start(Catalina.java:598)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
> java:39)
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
> sorImpl.java:25)
> at java.lang.reflect.Method.invoke(Method.java:324)
> at
> org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:297)
> at
> org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:398)
> Excpetion in InitializerPlugin
> 
> 
> The java code in the plugin is as follows
>   Context init = new InitialContext();
>   Context ctx = (Context)
> init

No Suitable Driver problem

2004-04-09 Thread MARU, SOHIL (SBCSI)
Hello All,
I have been scouring the mailing list archives and lot of other
places. I am seeing a problem configuring a datasource with Tomcat. I
saw a lot of posts where the drivername was not being picked up but none
where the driver name was being picked up and yet people were getting
the same error. Thanks for your help in advance.

I have put the following entry in my server.xml




.
.
.
.


username

user



password

databasepassword


url

jdbc:oracle:[EMAIL PROTECTED]:1521:[sid]



driverClassName

oracle.jdbc.driver.OracleDriver



However when I try to load my plugin in the struts application, I get
the following exception. I looked at everything on archives and on there
people were complaining about NULL for driverClassName, in my case, it
reads the drivername and url properly and still blows up. Please help. I
am using Tomcat 5.0 with the latest ojdbc14.jar(oracle driver for
jdk1.4, I am running on 1.4.2_03)/commons-dbcp-1.1.jar in common/lib and
am trying to connect to oracle 8.1.7. 

org.apache.commons.dbcp.SQLNestedException: Cannot create JDBC driver of
class '
oracle.jdbc.driver.OracleDriver' for connect URL
'jdbc:oracle:[EMAIL PROTECTED]
:1521:[sid]', cause:
java.sql.SQLException: No suitable driver
at java.sql.DriverManager.getDriver(DriverManager.java:243)
at
org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSou
rce.java:743)
at
org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource
.java:518)
at
com.sbc.hrtech.framework.utility.InitializerPlugin.init(InitializerPl
ugin.java:41)
at
org.apache.struts.action.ActionServlet.initModulePlugIns(ActionServle
t.java:1158)
at
org.apache.struts.action.ActionServlet.init(ActionServlet.java:473)
at javax.servlet.GenericServlet.init(GenericServlet.java:256)
at
org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.
java:1044)
at
org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:88
7)
at
org.apache.catalina.core.StandardContext.loadOnStartup(StandardContex
t.java:3960)
at
org.apache.catalina.core.StandardContext.start(StandardContext.java:4
283)
at
org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1125)

at
org.apache.catalina.core.StandardHost.start(StandardHost.java:832)
at
org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1125)

at
org.apache.catalina.core.StandardEngine.start(StandardEngine.java:518
)
at
org.apache.catalina.core.StandardService.start(StandardService.java:5
19)
at
org.apache.catalina.core.StandardServer.start(StandardServer.java:234
5)
at org.apache.catalina.startup.Catalina.start(Catalina.java:598)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at
org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:297)
at
org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:398)
Excpetion in InitializerPlugin


The java code in the plugin is as follows
Context init = new InitialContext();
Context ctx = (Context)
init.lookup("java:comp/env");
DataSource dataSource = (DataSource)
ctx.lookup("jdbc/loacenet");
c = dataSource.getConnection(); -- line which
blows up
st = c.createStatement();

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



Re: about and "response already committed" exception

2004-04-09 Thread Kumar M

Two things come to mind:

1. Try increasing the buffer size on myjsp.jsp. Default is 8kb
2. Make sure that you are not changing the header portion of the
response in your included jsp page.

[EMAIL PROTECTED] wrote:

> Buddies, Can anyone help with my below problem?
>
>
>> From: "Mu Mike" <[EMAIL PROTECTED]>
>> Reply-To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
>> To: [EMAIL PROTECTED]
>> Subject: about  and "response already committed" exception
>> Date: Fri, 09 Apr 2004 01:45:22 +
>>
>> Hi,all
>>
>> I m using a  in my jsp file(myjsp.jsp), the file
>> contains also a form, when I submit the form, the action will
>> actually foward back to this jsp---the included content in the
>>  will have been changed thus display new content, the
>> fact is , it throws response already committed exception constanly,
>> but not always, why?
>>
>> and what can I do to solve or avoid this problem? somebody suggested
>> using  but  brought much more problems to me(because
>> of my specific code), I tried <%@ include file="<%=myvariable %>",
>> yet seems that tag doesnt allow jsp variables
>>
>> Thanks&Regards
>>
>> _
>> 与联机的朋友进行交流,请使用 MSN Messenger: http://messenger.msn.com/cn
>>
>>
>> -
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>>
>
> _
> 与联机的朋友进行交流,请使用 MSN Messenger: http://messenger.msn.com/cn
>
> -
> 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]



can iframe include files in web-info folder

2004-04-09 Thread dream_and_yang
1.in my jsp page information.jsp I do this:
 
  but when the Tomcat 5.0 just tell me that such page is not available.
2.Then i try another way.
  i created another page called import page,in this page:
  
  <%jsp:include page="information.jsp" %> 
  Here HTMLUrl comes from my Struts Action,and refer the URL in want to import in
  the iframe.
  This time,I do get it worked and have HTMLUrl page in the iframe,The problem
 is when the HTMLUrl has changed,The page in the iframe didn't changed at the 
 same time.
   I use ,i can see this also changed.

  Hoping someone to help me,Thank you very much!


dream_and_yang
[EMAIL PROTECTED]
  2004-04-09


can iframe include files in web-info folder

2004-04-09 Thread dream_and_yang
1.in my jsp page information.jsp I do this:
 
  but when the Tomcat 5.0 just tell me that such page is not available.
2.Then i try another way.
  i created another page called import page,in this page:
  
  <%jsp:include page="information.jsp" %> 
  Here HTMLUrl comes from my Struts Action,and refer the URL in want to import in
  the iframe.
  This time,I do get it worked and have HTMLUrl page in the iframe,The problem
 is when the HTMLUrl has changed,The page in the iframe didn't changed at the 
 same time.
   I use ,i can see this also changed.

  Hoping someone to help me,Thank you very much!


dream_and_yang
[EMAIL PROTECTED]
  2004-04-09


[50% SOLVED] Resetting Multibox problems

2004-04-09 Thread Mathieu Grimault
I've found a way of bypassing the problem by using a logic:equal and
logic:notEqual inside the jsp and testing my row value. This way, the
display is correct... it's just not clean.


New jsp :


" checked="checked">


">


Old jsp :







- Original Message - 
From: "Mathieu Grimault" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Friday, April 09, 2004 3:10 PM
Subject: Resetting Multibox problems


Re-Hello !

In addition to my question, i've seen that spy the reset() and constructor
call of my actionForm :

life cylcle :
- constructor -> first access on the jsp
- reset -> first access on the jsp
- display of the jsp and submit
- constructor -> after submiting
- reset -> after submiting
- the form is transmitted to an action who forward to another jsp

Each time i came back to the jsp :
- reset -> each time a leave the jsp

As i mention before, i used combo box. They are correctly initalised the
first time but never changed whatever the reset method does (normally) and
whatever is set in the String[]...

Regards.


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



Re: Custom attribute on

2004-04-09 Thread James Mitchell
Are you trying to map your text field to a database column?


--
James Mitchell
Software Engineer / Open Source Evangelist
EdgeTech, Inc.
678.910.8017
AIM: jmitchtx
MSN: [EMAIL PROTECTED]
Yahoo IM:[EMAIL PROTECTED]



- Original Message - 
From: "Igor Antonacci" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, April 09, 2004 9:49 AM
Subject: Custom attribute on 


Hi All,
again with an issue :).

I'd like to put a new (non-standard) attribute on 
 tag.

Whenever I try, Struts raise an error saying there's no
setter method for that attribute.

Here an example:



The "datafld" attribute is used just on client-side (on resulting
 tag). 

Is there any solution than implementing a new Taglib (inheriting by
TextTag class)?

Thanks,
Igor.


-
Callidus Software 
Igor Antonacci
Core Engineer
[EMAIL PROTECTED]
-


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



Custom attribute on

2004-04-09 Thread Igor Antonacci
Hi All,
again with an issue :).

I'd like to put a new (non-standard) attribute on 
 tag.

Whenever I try, Struts raise an error saying there's no
setter method for that attribute.

Here an example:



The "datafld" attribute is used just on client-side (on resulting
 tag). 

Is there any solution than implementing a new Taglib (inheriting by
TextTag class)?

Thanks,
Igor.


-
Callidus Software 
Igor Antonacci
Core Engineer
[EMAIL PROTECTED]
-


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



Re: DynaValidatorForm help

2004-04-09 Thread Brad Balmer
Thanks for the responses.  I was using the way that you showed.  I 
figured out that my problem was with my struts-config.xml where I should 
have been using:org.apache.struts.validator.DynaValidatorForm instead of 
org.apache.struts.action.DynaValidatorForm.

Adam Hardy wrote:

DynaValidatorForm dynaForm = (DynaValidatorForm) form;
String value = (String) dynaForm.get("myFieldName");


On 04/09/2004 02:52 PM Brad Balmer wrote:

Using the DynaValidatorForm, how do you get the form variable data 
out of the form inside the action?  All examples I've seen are purely 
the setup and none show the action getting the values.

My struts-config.xml:
   
   
   
   
My validation.xml:
 
   
 
   
   
 
   
 
-
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]


[SOLVED} RE: DynaValidatorActionForm client-side validation

2004-04-09 Thread Igor Antonacci
Hi,
I solved with your advice.

Thanks a lot! 
Igor.

> -Original Message-
> From: Saul Q Yuan [mailto:[EMAIL PROTECTED] 
> Sent: Thursday, April 08, 2004 10:03 PM
> To: 'Struts Users Mailing List'
> Subject: RE: DynaValidatorActionForm client-side validation
> 
> Hmmm, I don't seem to have that problem. Did you specify
> method="validateYourActionForm" in addition to:
> formName="/yourActionPath" in your  function generated will be validateYourActionForm. I could be 
> wrong, but
> don't have time now to dig deep into the code.
> 
> HTH,
> Saul
> 


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



can not retrieve action mapping?

2004-04-09 Thread Mu Mike
I have this.jsp under the dir /this, it has a form defined like the below


...

while in struts-that-config.xml, I have that.do defined
yet it tells can not retrieve the action mapping, why?
_
与联机的朋友进行交流,请使用 MSN Messenger:  http://messenger.msn.com/cn  

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


Resetting Multibox problems

2004-04-09 Thread Mathieu Grimault
Re-Hello !

In addition to my question, i've seen that spy the reset() and constructor call of my 
actionForm :

life cylcle : 
- constructor -> first access on the jsp
- reset -> first access on the jsp
- display of the jsp and submit
- constructor -> after submiting
- reset -> after submiting
- the form is transmitted to an action who forward to another jsp

Each time i came back to the jsp : 
- reset -> each time a leave the jsp

As i mention before, i used combo box. They are correctly initalised the first time 
but never changed whatever the reset method does (normally) and whatever is set in the 
String[]...

Regards.

Re: DynaValidatorForm help

2004-04-09 Thread Adam Hardy
DynaValidatorForm dynaForm = (DynaValidatorForm) form;
String value = (String) dynaForm.get("myFieldName");


On 04/09/2004 02:52 PM Brad Balmer wrote:
Using the DynaValidatorForm, how do you get the form variable data out 
of the form inside the action?  All examples I've seen are purely the 
setup and none show the action getting the values.

My struts-config.xml:
   
   
   
   
My validation.xml:
 
   
 
   
   
 
   
 
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



--
struts 1.2 + tomcat 5.0.19 + java 1.4.2
Linux 2.4.20 Debian
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: DynaValidatorForm help

2004-04-09 Thread Niall Pemberton
Cast the ActionForm to a DynaBean and then use get(String property)

Niall


- Original Message - 
From: "Brad Balmer" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, April 09, 2004 1:52 PM
Subject: DynaValidatorForm help


> Using the DynaValidatorForm, how do you get the form variable data out 
> of the form inside the action?  All examples I've seen are purely the 
> setup and none show the action getting the values.
> 
> My struts-config.xml:
>  name="loginForm"
> type="org.apache.struts.action.DynaValidatorForm">
> 
> 
> 
> 
> My validation.xml:
>   
> 
>   
> 
> 
>   
> 
>   
> 
> 
> -
> 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]



Re: Validation.xml form name parameter

2004-04-09 Thread Adam Hardy
Are you sure that it is validating? It doesn't sound like it should.
Have you got javascript error notifications turned on in your browser?
If you don't, you might be getting javascript errors that you never see.
The javascript function that is executed when you hit the submit button
is specified by the attribute on the html:form tag.
I don't believe that the name of the submit button that you press can 
have any effect on the validation process.

On 04/09/2004 01:56 PM Prasad, Kamakshya wrote:
Hi,

ValidatorActionForm

KP

-Original Message- From: Adam Hardy 
[mailto:[EMAIL PROTECTED] Sent: Friday, April 09, 
2004 8:33 PM To: Struts Users Mailing List Subject: Re: 
Validation.xml form name parameter

and which form class? ValidatorForm or ValidatorActionForm

On 04/09/2004 12:53 PM Prasad, Kamakshya wrote:

Hi,

I am using 1.1 version.

KP

-Original Message- From: Adam Hardy 
[mailto:[EMAIL PROTECTED] Sent: Friday, April 09, 
2004 7:48 PM To: Struts Users Mailing List Subject: Re: 
Validation.xml form name parameter

Kamakshya Which version of Validator and which Form class are you 
using?

Adam

On 04/09/2004 10:08 AM Prasad, Kamakshya wrote:


HI,

Is it a bug or has been intentionally done like that?

I have a form with lots of CRUD buttons. The action path is 
"/maintainEmployeeDetails". I am using DispatchAction class for 
the same. But each of these buttons has specific javascript 
validations. So in the validation.xml insted of giving the name
as

< form name=" maintainEmployeeDetails">

I have given

< form name=" maintainEmployeeDetailsCreate">

and similarly for other buttons. This is not throwing any error 
but in the struts site documentation it's written that the name 
should be
same


as the path.

It's good for me as I can use these specific javascript functions
 for each of these buttons.
Will it be changed in coming release?

KP









--
struts 1.2 + tomcat 5.0.19 + java 1.4.2
Linux 2.4.20 Debian
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


DynaValidatorForm help

2004-04-09 Thread Brad Balmer
Using the DynaValidatorForm, how do you get the form variable data out 
of the form inside the action?  All examples I've seen are purely the 
setup and none show the action getting the values.

My struts-config.xml:
   
   
   
   
My validation.xml:
 
   
 
   
   
 
   
 
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


RE: DynaBeans with struts faces

2004-04-09 Thread Joe Hertz
Matthias-

I've tried it both ways. I suspect the problem is my JSTL Knowledge. Code 
follows.

The problem, I believe boils down to, "How do I get at the item var declared 
in the datatable/foreach? I can't use a ".", right?

Then again, it could be something very different FAIK. I'm getting the 
wonderfully helpful exception,"One or more parameters are null", so I'm sure 
it's something obvious I am doing wrong in my JSP. None of the values in my 
beans are null.

-Joe, hoping the answer isn't *too* embarrassing.



  

 



  
  

 


  
< 

 

  
  
  
  
  
  

  

 


  
  

 


  
 -Original Message-
> From: Matthias Wessendorf [mailto:[EMAIL PROTECTED] 
> Sent: Friday, April 09, 2004 8:19 AM
> To: [EMAIL PROTECTED]
> Subject: RE: DynaBeans with struts faces 
> 
> 
> Joe,
> can you provide some code ?
> 
> btw.
> i would use -Tag for "forEach" in JSF
> and  for rendering 
> 
> like this:
> 
> 
>   
> 
>
> 
> 
> 
> 
> 
>
> 
>   
> 
> 
> note with  you can "group" components logicaly. 
> dataTable has a "footer" and a "header" it renders  
> and  for a HTML-Table
> 
> and look at http://myfaces.sf.net
> they have a nice example for editing table
> -->Master/Detail-Example
> 
> 
> hope that was helpful
> Cheers
> 
> Matthias
> 
> 
> -
> 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]



RE: DynaBeans with struts faces

2004-04-09 Thread Matthias Wessendorf
Joe,
can you provide some code ?

btw.
i would use -Tag for "forEach" in JSF
and  for rendering 

like this:


  

 





   

  


note with  you can "group" components logicaly.
dataTable has a "footer" and a "header"
it renders  and  for a HTML-Table

and look at http://myfaces.sf.net
they have a nice example for editing table
-->Master/Detail-Example


hope that was helpful
Cheers

Matthias


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



RE: Validation.xml form name parameter

2004-04-09 Thread Prasad, Kamakshya

Hi,

ValidatorActionForm

KP

-Original Message-
From: Adam Hardy [mailto:[EMAIL PROTECTED] 
Sent: Friday, April 09, 2004 8:33 PM
To: Struts Users Mailing List
Subject: Re: Validation.xml form name parameter

and which form class? ValidatorForm or ValidatorActionForm

On 04/09/2004 12:53 PM Prasad, Kamakshya wrote:
> Hi,
> 
> I am using 1.1 version. 
> 
> KP
> 
> -Original Message-
> From: Adam Hardy [mailto:[EMAIL PROTECTED] 
> Sent: Friday, April 09, 2004 7:48 PM
> To: Struts Users Mailing List
> Subject: Re: Validation.xml form name parameter
> 
> 
> Kamakshya
> Which version of Validator and which Form class are you using?
> 
> 
> Adam
> 
> On 04/09/2004 10:08 AM Prasad, Kamakshya wrote:
> 
>>HI,
>> 
>>Is it a bug or has been intentionally done like that?
>> 
>>I have a form with lots of CRUD buttons. The action path is
>>"/maintainEmployeeDetails". I am using DispatchAction class for the
>>same. 
>>But each of these buttons has specific javascript validations. So in
> 
> the
> 
>>validation.xml insted of giving the name as 
>> 
>>< form name=" maintainEmployeeDetails">
>> 
>>I have given
>> 
>>< form name=" maintainEmployeeDetailsCreate">
>> 
>>and similarly for other buttons. This is not throwing any error but in
>>the struts site documentation it's written that the name should be
> 
> same
> 
>>as the path. 
>> 
>>It's good for me as I can use these specific javascript functions for
>>each of these buttons.
>> 
>>Will it be changed in coming release?
>> 
>>KP
>> 
>>
> 
> 
> 


-- 
struts 1.2 + tomcat 5.0.19 + java 1.4.2
Linux 2.4.20 Debian


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



Re: DynaValidatorActionForm client-side validation

2004-04-09 Thread Niall Pemberton
A patch recently went into the various flavours of validator forms which
split out the logic which determines the validation "key" into a separate
method - so if you look at the current versions of either
ValidatorActionForm or DynaValidatorActionForm - they now only contain a
very simple getValidationKey(request, mapping) method.

http://cvs.apache.org/viewcvs.cgi/jakarta-struts/src/share/org/apache/struts/validator/

I use a version of  DynaValidatorActionForm which removes the leading "/" -
for Adam's problem (where he has "/esurvey/survey/update") he could do that
and replace the other slashes with underscores:

public class MyDynaValidatorActionForm extends DynaValidatorForm
  implements DynaBean, Serializable {

  public String getValidationKey(ActionMapping mapping,
   HttpServletRequest request) {

mapping.getPath().substring(1).replace('/', '_');

  }
}

Then, in validation.xml

   

 


and on the jsp page:



If you can't use the latest build of struts, then copy the validate() method
which calls getValidationKey() - when the next proper "release" of struts
comes out, you can then delete the validate() method just leaving
getValidationKey().

Niall


- Original Message - 
From: "Adam Hardy" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Thursday, April 08, 2004 8:02 PM
Subject: Re: DynaValidatorActionForm client-side validation


> Hmmm, good question. I had this problem, but never managed to solve it.
> I thought I was doing something wrong but I couldn't work it out.
> Eventually I changed to DynaValidatorForm, which wasn't a big problem
> because there were only 2 or 3 forms where I wanted to use the same
> DynaForm but different validation.
>
> Perhaps someone actually knows if there is a solution?
>
>
>
> On 04/08/2004 11:16 AM Igor Antonacci wrote:
> > Hi All,
> > I'm working on DynaValidatorActionForm client-side validation but I've
> > some problems about.
> >
> > Everything is working but, as DynaValidatorActionForm maps validation
> > rules with Action path attribute, Struts generates a client side
> > validation method name with a "/" character.
> >
> > It is because Action path has a "/" as first character.
> >
> > How do I solve this issue ?
> >
> > Thanks,
> > Igor.
> >
> > --
> > Callidus Software
> > Igor Antonacci
> > Core Engineer
> > [EMAIL PROTECTED]
> > --
> >
> >
> >
> > -
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
>
>
> -- 
> struts 1.2 + tomcat 5.0.19 + java 1.4.2
> Linux 2.4.20 Debian
>
>
> -
> 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]



RE: DynaBeans with struts faces

2004-04-09 Thread Joe Hertz
Matthias-

I had most of the struts-cfg changes you mention, because they came in the 
struts-faces docs.

Maybe my problem is my JSTL knowledge (surely it is, the question is, "Is it 
now?").

Maybe if it iss just easier if I explain what I am trying to accomplish.

I have List of Objects that I want to forEach on and provide input into each 
Object's properties. Both the List and it's component Objects are declared as 
Dynabeans in Struts-Config. I have a feeling that the component object is the 
hangup here since there's nothing to my knowledge saying, "Yo! It's a 
dynabean!" to JSF.

Once I get that working (or maybe not if that concept is flawed, it's not the 
actual goal, it's just an analog of what I was doing without JSF), I'd 
instead want to populate the List with the actual object I got out of the 
database via hibernate. Let the user modify that (complete with it's non-
string properties), and resave it.

Once I get this "proof of concept" working, I should be s off and 
running...

TIA

-Joe


> -Original Message-
> From: Matthias Wessendorf [mailto:[EMAIL PROTECTED] 
> Sent: Friday, April 09, 2004 4:27 AM
> To: 'Struts Users Mailing List'
> Subject: RE: DynaBeans with struts faces [Was Right Back in 
> My Struts Face]
> 
> 
> Hi Joe,
> 
> the thing with  was noticed in the "online" 
> release-notes that where shiped with the beta.(not more 
> online, i guess) In Early_Access_X there where the 
> -Tag. however, you must add the following to 
> struts-cfg.xml: 
>   
> 
> value="org.apache.struts.faces.application.FacesTilesRequestPr
> ocessor"/>
> 
> note, i use the tiles-candidate for supporting tiles in my 
> jsf-sturts-apps there is also a FacesRequestProcessor-class
> 
> the dynaBeans are supported via struts-faces.jar.
> The class "PropertyResolverImpl" decorates the default 
> PropertyResolver shiped with implementation you use : RI, 
> MyFAces,... (decorator-pattern //Gamma//)
> 
> the value of field 'id' has the restrictions:
> -Must not be a zero-length String
> -First character must be a letter or an underscore ('_') 
> -Subsequent characters must be a letter, a digit, an 
> underscore ('_'), or a dash ('-')
> 
> so no dot ('.')
> 
> and use #{} instead of ${}
> 
> 
> hope that helps you.
> 
> :)
> Cheers,
> Matthias
> 
> 
> 
> 
> -Original Message-
> From: Joe Hertz [mailto:[EMAIL PROTECTED] 
> Sent: Friday, April 09, 2004 4:43 AM
> To: [EMAIL PROTECTED]
> Subject: DynaBeans with struts faces [Was Right Back in My 
> Struts Face]
> 
> 
> James-
> 
> Thank you. I had already grabbed faces-console, but many of 
> those links 
> actually had (more) current examples. Still there's nothing 
> explicit that 
> would make one realize f:view replaced f:use_faces, but I 
> figured it out.
> 
> Is there anything special I need to do to use a struts-config defined 
> DynaBean inside of JSF? The struts-faces examples have one 
> dynabean declared, 
> but if you look in the corresponding class, it turns out not 
> to be a DynaBean 
> after all (story of my life).
> 
> The following snippet bombs, claiming it can't find the items 
> property of 
> MaintenanceListForm, which is definitely there in the struts-config.
> 
> TIA
> 
> -Joe
> 
> 
>  
>  value="# {item.creditCost}"/>   id="item.minPurchase" size="6" maxlength="6" value="# 
> {item.minPurchase}"/>   id="item.currency">
>   
>   
>   
>   
>   
> 
>  value="${item.beginDate}"/>   id="item.endDate" value="${item.endDate}" /> 
> 
> 
> 
> > -Original Message-
> > From: James Holmes [mailto:[EMAIL PROTECTED]
> > Sent: Thursday, April 08, 2004 8:42 AM
> > To: Struts Users Mailing List
> > Subject: Re: [OT-rant] Right Back in My Struts Face
> > 
> > 
> > Joe,
> > 
> > My guess is that you are trying to make a pre-1.0 example work with 
> > the 1.0 Final release of JSF.  In most scenarios, that will 
> not work 
> > because there have been significant changes to JSF throughout its 
> > release cycle. I would suggest trying out another example 
> application
> > instead of the one you're working with.  You can find several 
> > tutorials on my websiate at:
> > 
> > http://www.jamesholmes.com/JavaServerFaces/
> > 
> > You may also want to try posting issues like this to the JSF forum:
> > 
> > http://forum.java.sun.com/forum.jsp?forum=427
> > 
> > Hope that helps,
> > 
> > James
> > http://www.jamesholmes.com/
> > 
> > >
> > >
> > > I picked up JSF today, never having touched JSF in the 
> first place.
> > >
> > > So far, struts faces seems fine, but as far as the JSF1.0 
> Reference 
> > > goes, I am...well..it's easier to show you.
> > >
> > > My experience went something like this.
> > >
> > > Jasper can't find the  tag. Hmmm. This is kind of a 
> > > critical thing, so I'm lead to believe. Try to find what I
> > did wrong.
> > > No joy. Googling doesn't mention this gotcha. Neither does the 
> > > Kurniawan book on JSF. Release notes don't mention it. 
> Must not be 
> > > finding the taglibs???
> > Nope. Maybe
> 

RE: Tiles basics

2004-04-09 Thread Mainguy, Mike
You'll want to go to http://struts.apache.org, but the tiles stuff is
included with struts (at least 1.1).   I'd suggest downloading a new copy of
struts (especially if you're using the old 1.0 version).  I believe there is
even an example webapp that uses tiles included if you download the proper
copy. 

The download page for binaries is at:
http://jakarta.apache.org/site/binindex.cgi

<>

-Original Message-
From: Mario St-Gelais [mailto:[EMAIL PROTECTED] 
Sent: Thursday, April 08, 2004 4:15 PM
To: Struts Users Mailing List
Subject: Re: Tiles basics


Mathew, Manoj wrote:

>where can i find the down load of Tile binaries? I spend soem time in 
>www.apache.org  but couldn't figure it out..?
>
>Thank-you,
>Manoj Mathew
>
>
>
>-Original Message-
>From: yoge [mailto:[EMAIL PROTECTED]
>Sent: Wednesday, April 07, 2004 9:27 AM
>To: Struts Users Mailing List
>Subject: Re: Tiles basics
>
>
>http://www.javaworld.com/javaworld/jw-01-2002/jw-0104-tilestrut.html
>
>Mathew, Manoj wrote:
>
>  
>
>>I been working on struts for the more than a year now. I am more in to 
>>Dyna action forms and validator stuffs. But never got a chance to work 
>>on Tiles. So thought of trying it out. I need some basics on that 
>>like.
>>
>>1. Which bundle I need to install
>>2. what are entries I need in the class path to work in my WSAD 3. 
>>some good documents and examples for a beginner.
>>
>>thanks in Advance
>>Manoj
>>
>>
>>
>>
>>-
>>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]
>
>
>-
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>
>
>  
>
Tiles are a subcomponent of Struts. 
Useful links at the bottom of this page : 
http://jakarta.apache.org/struts/userGuide/dev_tiles.html

-- 
_
Mario St-Gelais
www.gestionti.com
"Good judgment comes from
experience- usually experience
which was the result of poor judgment"
Bill Putnam



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

-
This message and its contents (to include attachments) are the property of Kmart 
Corporation (Kmart) and may contain confidential and proprietary information. You are 
hereby notified that any disclosure, copying, or distribution of this message, or the 
taking of any action based on information contained herein is strictly prohibited. 
Unauthorized use of information contained herein may subject you to civil and criminal 
prosecution and penalties. If you are not the intended recipient, you should delete 
this message immediately.


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



multibox not resetting

2004-04-09 Thread Mathieu Grimault
 Hello !

Multibox made me crazy !! After having each problem detailled on the mailing
list i've got another not detailled...

I've got a jsp page with a multibox inside an iterate. the initial display
is correct and i can correctly retrieve the selected or unselected values
and, then write to the database some infos. The problem is when i come back
to the multibox page, the display doesn't take care of what has been changed
! Even if i call the reset method... Datas used by the reset method are
correct but it seems that the multiboxes are not been replaced. The only
solution i found is having a new session... where are placed the multibox ??
the form is request scoped...

I've noticed that reset is called at the first generation of the form and
when i leave the page but even if a forced it after i'm sure that it use
correct datas, it doesn't work.

The display is generated via the form's reset method with session scoped
datas written in page1 (see below).

how can i forcing the use of a totally new form ? Any solution ?

Best regards, mathieu.

scenario :

page1(request on the database) ---> page2 (with the multibox and writing to
the database) ---> page3 (confirmation and a link t page1)

Here are the problem :
struts-config.xml : -


jsp : -











form : -

public void reset(ActionMapping mapping, HttpServletRequest request) {
HttpSession session = request.getSession();
ArrayList unitesEnseignements =
(ArrayList)session.getAttribute("unitesEnseignements");
valeurs = new String[unitesEnseignements.size()];
for(int i=0;i

Re: Validation.xml form name parameter

2004-04-09 Thread Adam Hardy
and which form class? ValidatorForm or ValidatorActionForm

On 04/09/2004 12:53 PM Prasad, Kamakshya wrote:
Hi,

I am using 1.1 version. 

KP

-Original Message-
From: Adam Hardy [mailto:[EMAIL PROTECTED] 
Sent: Friday, April 09, 2004 7:48 PM
To: Struts Users Mailing List
Subject: Re: Validation.xml form name parameter

Kamakshya
Which version of Validator and which Form class are you using?
Adam

On 04/09/2004 10:08 AM Prasad, Kamakshya wrote:

HI,

Is it a bug or has been intentionally done like that?

I have a form with lots of CRUD buttons. The action path is
"/maintainEmployeeDetails". I am using DispatchAction class for the
same. 
But each of these buttons has specific javascript validations. So in
the

validation.xml insted of giving the name as 

< form name=" maintainEmployeeDetails">

I have given

< form name=" maintainEmployeeDetailsCreate">

and similarly for other buttons. This is not throwing any error but in
the struts site documentation it's written that the name should be
same

as the path. 

It's good for me as I can use these specific javascript functions for
each of these buttons.
Will it be changed in coming release?

KP







--
struts 1.2 + tomcat 5.0.19 + java 1.4.2
Linux 2.4.20 Debian
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


RE: Validation.xml form name parameter

2004-04-09 Thread Prasad, Kamakshya
Hi,

I am using 1.1 version. 

KP

-Original Message-
From: Adam Hardy [mailto:[EMAIL PROTECTED] 
Sent: Friday, April 09, 2004 7:48 PM
To: Struts Users Mailing List
Subject: Re: Validation.xml form name parameter


Kamakshya
Which version of Validator and which Form class are you using?


Adam

On 04/09/2004 10:08 AM Prasad, Kamakshya wrote:
> HI,
>  
> Is it a bug or has been intentionally done like that?
>  
> I have a form with lots of CRUD buttons. The action path is
> "/maintainEmployeeDetails". I am using DispatchAction class for the
> same. 
> But each of these buttons has specific javascript validations. So in
the
> validation.xml insted of giving the name as 
>  
> < form name=" maintainEmployeeDetails">
>  
> I have given
>  
> < form name=" maintainEmployeeDetailsCreate">
>  
> and similarly for other buttons. This is not throwing any error but in
> the struts site documentation it's written that the name should be
same
> as the path. 
>  
> It's good for me as I can use these specific javascript functions for
> each of these buttons.
>  
> Will it be changed in coming release?
>  
> KP
>  
> 


-- 
struts 1.2 + tomcat 5.0.19 + java 1.4.2
Linux 2.4.20 Debian


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



Re: Validation.xml form name parameter

2004-04-09 Thread Adam Hardy
Kamakshya
Which version of Validator and which Form class are you using?
Adam

On 04/09/2004 10:08 AM Prasad, Kamakshya wrote:
HI,
 
Is it a bug or has been intentionally done like that?
 
I have a form with lots of CRUD buttons. The action path is
"/maintainEmployeeDetails". I am using DispatchAction class for the
same. 
But each of these buttons has specific javascript validations. So in the
validation.xml insted of giving the name as 
 
< form name=" maintainEmployeeDetails">
 
I have given
 
< form name=" maintainEmployeeDetailsCreate">
 
and similarly for other buttons. This is not throwing any error but in
the struts site documentation it's written that the name should be same
as the path. 
 
It's good for me as I can use these specific javascript functions for
each of these buttons.
 
Will it be changed in coming release?
 
KP
 



--
struts 1.2 + tomcat 5.0.19 + java 1.4.2
Linux 2.4.20 Debian
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: DynaValidatorActionForm client-side validation

2004-04-09 Thread Adam Hardy
Yes I know, and it's for a reason. DynaValidatorActionForm doesn't exist 
by chance.

Regarding the javascript function names, it's not the main validation 
function name that's the problem - it's the secondary functions which 
instantiate the arrays for the different validations, e.g. 
surveyForm_required(), surveyForm_IntegerValidations(), 
surveyForm_DateValidations()

Under ValidatorActionForm, they become

/esurvey/survey/update_required()
etc
which are invalid.

If nobody says anything different, I'm going to log this as a bug, if 
it's not there already.

I'm not sure why, but I've just realised this thread was going to both 
user and dev lists, which is totally unnecessary! I'm just sending this 
reply to user.



On 04/09/2004 08:43 AM Kunal H. Parikh wrote:
I may be a little off here, but why are you using the
DynaValidatorActionForm ?
Try using the DynaValidatorForm and u should have client-side and
server-side validation working.
This is because, the DynaValidatorActionForm.getValidationKey returns the
mapping PATH, whereas the DynaValidatorForm.getValidationKey returns the
mapping NAME!
HTH,

KP

-Original Message-
From: Saul Q Yuan [mailto:[EMAIL PROTECTED] 
Sent: Friday, 9 April 2004 06:03
To: 'Struts Users Mailing List'
Subject: RE: DynaValidatorActionForm client-side validation

Hmmm, I don't seem to have that problem. Did you specify
method="validateYourActionForm" in addition to:
formName="/yourActionPath" in your 
HTH,
Saul

-Original Message-
From: Adam Hardy [mailto:[EMAIL PROTECTED] 
Sent: Thursday, April 08, 2004 3:02 PM
To: Struts Users Mailing List
Subject: Re: DynaValidatorActionForm client-side validation

Hmmm, good question. I had this problem, but never managed to 
solve it. 
I thought I was doing something wrong but I couldn't work it out. 
Eventually I changed to DynaValidatorForm, which wasn't a big problem 
because there were only 2 or 3 forms where I wanted to use the same 
DynaForm but different validation.

Perhaps someone actually knows if there is a solution?



On 04/08/2004 11:16 AM Igor Antonacci wrote:

Hi All,
I'm working on DynaValidatorActionForm client-side 
validation but I've 

some problems about.

Everything is working but, as DynaValidatorActionForm maps 
validation 

rules with Action path attribute, Struts generates a client side 
validation method name with a "/" character.

It is because Action path has a "/" as first character.

How do I solve this issue ?

Thanks,
Igor.
--
Callidus Software
Igor Antonacci
Core Engineer
[EMAIL PROTECTED]
--



-

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



--
struts 1.2 + tomcat 5.0.19 + java 1.4.2
Linux 2.4.20 Debian
-
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]




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



--
struts 1.2 + tomcat 5.0.19 + java 1.4.2
Linux 2.4.20 Debian
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


RE: about and "response already committed" exception

2004-04-09 Thread Mu Mike
Buddies, Can anyone help with my below problem?


From: "Mu Mike" <[EMAIL PROTECTED]>
Reply-To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED]
Subject: about  and "response already committed" exception
Date: Fri, 09 Apr 2004 01:45:22 +
Hi,all

I m using a  in my jsp file(myjsp.jsp), the file 
contains also a form, when I submit the form, the action will 
actually foward back to this jsp---the included content in the 
  will have been changed thus display new content, the 
fact is , it throws response already committed exception constanly, 
but not always, why?

and what can I do to solve or avoid this problem? somebody suggested 
using  but  brought much more problems to 
me(because of my specific code), I tried <%@ include 
file="<%=myvariable %>", yet seems that tag doesnt allow jsp 
variables

Thanks&Regards

_
与联机的朋友进行交流,请使用 MSN Messenger:  
http://messenger.msn.com/cn

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
_
与联机的朋友进行交流,请使用 MSN Messenger:  http://messenger.msn.com/cn  

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


RE: DynaBeans with struts faces [Was Right Back in My Struts Face]

2004-04-09 Thread Matthias Wessendorf
Hi Joe,

the thing with  was noticed in the "online" release-notes
that where shiped with the beta.(not more online, i guess) In
Early_Access_X there where the -Tag.
however, you must add the following to struts-cfg.xml:

  
  

note, i use the tiles-candidate for supporting tiles in my
jsf-sturts-apps
there is also a FacesRequestProcessor-class

the dynaBeans are supported via struts-faces.jar.
The class "PropertyResolverImpl" decorates the default PropertyResolver
shiped with implementation you use : RI, MyFAces,...
(decorator-pattern //Gamma//)

the value of field 'id' has the restrictions:
-Must not be a zero-length String
-First character must be a letter or an underscore ('_')
-Subsequent characters must be a letter, a digit, an underscore ('_'),
or a dash ('-')

so no dot ('.')

and use #{} instead of ${}


hope that helps you.

:)
Cheers,
Matthias




-Original Message-
From: Joe Hertz [mailto:[EMAIL PROTECTED] 
Sent: Friday, April 09, 2004 4:43 AM
To: [EMAIL PROTECTED]
Subject: DynaBeans with struts faces [Was Right Back in My Struts Face]


James-

Thank you. I had already grabbed faces-console, but many of those links 
actually had (more) current examples. Still there's nothing explicit
that 
would make one realize f:view replaced f:use_faces, but I figured it
out.

Is there anything special I need to do to use a struts-config defined 
DynaBean inside of JSF? The struts-faces examples have one dynabean
declared, 
but if you look in the corresponding class, it turns out not to be a
DynaBean 
after all (story of my life).

The following snippet bombs, claiming it can't find the items property
of 
MaintenanceListForm, which is definitely there in the struts-config.

TIA

-Joe




  
  
  
  
  

 





> -Original Message-
> From: James Holmes [mailto:[EMAIL PROTECTED]
> Sent: Thursday, April 08, 2004 8:42 AM
> To: Struts Users Mailing List
> Subject: Re: [OT-rant] Right Back in My Struts Face
> 
> 
> Joe,
> 
> My guess is that you are trying to make a pre-1.0 example
> work with the 1.0 Final release of JSF.  In most scenarios, 
> that will not work because there have been significant 
> changes to JSF throughout its release cycle. 
> I would suggest trying out another example application 
> instead of the one you're working with.  You can find several 
> tutorials on my websiate at:
> 
> http://www.jamesholmes.com/JavaServerFaces/
> 
> You may also want to try posting issues like this to the JSF forum:
> 
> http://forum.java.sun.com/forum.jsp?forum=427
> 
> Hope that helps,
> 
> James
> http://www.jamesholmes.com/
> 
> >
> >
> > I picked up JSF today, never having touched JSF in the first place.
> >
> > So far, struts faces seems fine, but as far as the JSF1.0 Reference
> > goes, I am...well..it's easier to show you.
> >
> > My experience went something like this.
> >
> > Jasper can't find the  tag. Hmmm. This is kind of a
> > critical thing, so I'm lead to believe. Try to find what I 
> did wrong.
> > No joy. Googling doesn't mention this gotcha. Neither does the
> > Kurniawan book on JSF. Release
> > notes don't mention it. Must not be finding the taglibs??? 
> Nope. Maybe
> > they
> > camelized it like some of the other tags and forgot to say
> so? Nope. After
> > double and triple checking myself, I look into the taglibs
> themselves.
> > Whoa --
> >  It's really not there! Hoookay...so I check the struts
> faces examples.
> > and
> > sure enough, it is not used there either. Must be gone...
> Failing that, if
> > Craig doesn't need it, neither do I. Huzzah...I think. So I
> crib off of
> > the
> > examples. Obviously the docs aint current at all...I
> think/hope/wonder.
> >
> > Then I find a number of tags have changed ever so slightly,
> but that I
> > had found in the release note
> > 
> (http://java.sun.com/j2ee/javaserverfaces/docs/ReleaseNotes.ht
ml) even 
> though the link to the README file is 404.
>
> So, with my newly found faith in the release notes and book I bought,
> I continue using "the braille system" to get a compile. Lo, more 
> discoveries. Am I to understand that  ^H^H^H^H^H 
> inputDate> is gone too
> As is ?? I kinda thought they were the point 
> here... Guess I have to use  and use a converter?? I 
> guess. Maybe. Or do I? No amount of googling is providing me an answer

> about this either, and
> this time the best source of documentation I have (the struts faces
> examples)
> don't have a case where non-text input it gathered from the user.
>
> I'm not as annoyed as I sound (not much anyway), but it's quite
> frustrating to have this happen when you really did RTFM -- Lots of 
> them.
>
> Watch it turn out to all be documented some place obvious I didn't
> think to look...
>
> -Joe
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


-
To unsubscribe, 

multibox not resetting

2004-04-09 Thread Mathieu Grimault
Hello !

Multibox made me crazy !! After having each problem detailled on the mailing
list i've got another not detailled...

I've got a jsp page with a multibox inside an iterate. the initial display
is correct and i can correctly retrieve the selected or unselected values
and, then write to the database some infos. The problem is when i come back
to the multibox page, the display doesn't take care of what has been changed
! Even if i call the reset method... Datas used by the reset method are
correct but it seems that the multiboxes are not been replaced. The only
solution i found is having a new session... where are placed the multibox ??
the form is request scoped...

I've noticed that reset is called at the first generation of the form and
when i leave the page but even if a forced it after i'm sure that it use
correct datas, it doesn't work.

The display is generated via the form's reset method with session scoped
datas written in page1 (see below).

how can i forcing the use of a totally new form ? Any solution ?

Best regards, mathieu.

scenario :

page1(request on the database) ---> page2 (with the multibox and writing to
the database) ---> page3 (confirmation and a link t page1)

Here are the problem :
struts-config.xml : -


jsp : -











form : -

public void reset(ActionMapping mapping, HttpServletRequest request) {
HttpSession session = request.getSession();
ArrayList unitesEnseignements =
(ArrayList)session.getAttribute("unitesEnseignements");
valeurs = new String[unitesEnseignements.size()];
for(int i=0;i

RE: DynaBeans with struts faces [Was Right Back in My Struts Face]

2004-04-09 Thread Matthias Wessendorf
Hi Joe,

the thing with  was noticed in the "online" release-notes
that where shiped with the beta.(not more online, i guess) In
Early_Access_X there where the -Tag.
however, you must add the following to struts-cfg.xml:

  
  

note, i use the tiles-candidate for supporting tiles in my
jsf-sturts-apps
there is also a FacesRequestProcessor-class

the dynaBeans are supported via struts-faces.jar.
The class "PropertyResolverImpl" decorates the default PropertyResolver
shiped with implementation you use : RI, MyFAces,...
(decorator-pattern //Gamma//)

the value of field 'id' has the restrictions:
-Must not be a zero-length String
-First character must be a letter or an underscore ('_')
-Subsequent characters must be a letter, a digit, an underscore ('_'),
or a dash ('-')

so no dot ('.')

and use #{} instead of ${}


hope that helps you.

:)
Cheers,
Matthias



-Original Message-
From: Joe Hertz [mailto:[EMAIL PROTECTED] 
Sent: Friday, April 09, 2004 4:43 AM
To: [EMAIL PROTECTED]
Subject: DynaBeans with struts faces [Was Right Back in My Struts Face]


James-

Thank you. I had already grabbed faces-console, but many of those links 
actually had (more) current examples. Still there's nothing explicit
that 
would make one realize f:view replaced f:use_faces, but I figured it
out.

Is there anything special I need to do to use a struts-config defined 
DynaBean inside of JSF? The struts-faces examples have one dynabean
declared, 
but if you look in the corresponding class, it turns out not to be a
DynaBean 
after all (story of my life).

The following snippet bombs, claiming it can't find the items property
of 
MaintenanceListForm, which is definitely there in the struts-config.

TIA

-Joe




  
  
  
  
  

 





> -Original Message-
> From: James Holmes [mailto:[EMAIL PROTECTED]
> Sent: Thursday, April 08, 2004 8:42 AM
> To: Struts Users Mailing List
> Subject: Re: [OT-rant] Right Back in My Struts Face
> 
> 
> Joe,
> 
> My guess is that you are trying to make a pre-1.0 example
> work with the 1.0 Final release of JSF.  In most scenarios, 
> that will not work because there have been significant 
> changes to JSF throughout its release cycle. 
> I would suggest trying out another example application 
> instead of the one you're working with.  You can find several 
> tutorials on my websiate at:
> 
> http://www.jamesholmes.com/JavaServerFaces/
> 
> You may also want to try posting issues like this to the JSF forum:
> 
> http://forum.java.sun.com/forum.jsp?forum=427
> 
> Hope that helps,
> 
> James
> http://www.jamesholmes.com/
> 
> >
> >
> > I picked up JSF today, never having touched JSF in the first place.
> >
> > So far, struts faces seems fine, but as far as the JSF1.0 Reference
> > goes, I am...well..it's easier to show you.
> >
> > My experience went something like this.
> >
> > Jasper can't find the  tag. Hmmm. This is kind of a
> > critical thing, so I'm lead to believe. Try to find what I 
> did wrong.
> > No joy. Googling doesn't mention this gotcha. Neither does the
> > Kurniawan book on JSF. Release
> > notes don't mention it. Must not be finding the taglibs??? 
> Nope. Maybe
> > they
> > camelized it like some of the other tags and forgot to say
> so? Nope. After
> > double and triple checking myself, I look into the taglibs
> themselves.
> > Whoa --
> >  It's really not there! Hoookay...so I check the struts
> faces examples.
> > and
> > sure enough, it is not used there either. Must be gone...
> Failing that, if
> > Craig doesn't need it, neither do I. Huzzah...I think. So I
> crib off of
> > the
> > examples. Obviously the docs aint current at all...I
> think/hope/wonder.
> >
> > Then I find a number of tags have changed ever so slightly,
> but that I
> > had found in the release note
> > 
> (http://java.sun.com/j2ee/javaserverfaces/docs/ReleaseNotes.ht
ml) even 
> though the link to the README file is 404.
>
> So, with my newly found faith in the release notes and book I bought,
> I continue using "the braille system" to get a compile. Lo, more 
> discoveries. Am I to understand that  ^H^H^H^H^H 
> inputDate> is gone too
> As is ?? I kinda thought they were the point 
> here... Guess I have to use  and use a converter?? I 
> guess. Maybe. Or do I? No amount of googling is providing me an answer

> about this either, and
> this time the best source of documentation I have (the struts faces
> examples)
> don't have a case where non-text input it gathered from the user.
>
> I'm not as annoyed as I sound (not much anyway), but it's quite
> frustrating to have this happen when you really did RTFM -- Lots of 
> them.
>
> Watch it turn out to all be documented some place obvious I didn't
> think to look...
>
> -Joe
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


-
To unsubscribe, e

Validation.xml form name parameter

2004-04-09 Thread Prasad, Kamakshya
HI,
 
Is it a bug or has been intentionally done like that?
 
I have a form with lots of CRUD buttons. The action path is
"/maintainEmployeeDetails". I am using DispatchAction class for the
same. 
But each of these buttons has specific javascript validations. So in the
validation.xml insted of giving the name as 
 
< form name=" maintainEmployeeDetails">
 
I have given
 
< form name=" maintainEmployeeDetailsCreate">
 
and similarly for other buttons. This is not throwing any error but in
the struts site documentation it's written that the name should be same
as the path. 
 
It's good for me as I can use these specific javascript functions for
each of these buttons.
 
Will it be changed in coming release?
 
KP