Re: FOP and strus

2002-02-16 Thread Nick Pellow

John,
We wrote a servlet that took the name of a URI as a parameter.
That URI, essentially mapped to a JSP, whose output was FOP.
The servlet:
requested the URI, got the FOP, formatted the FOP, then sent that back to
the browser. This may not be ideal for all situations, but it worked nicely
for us.

You could look at using something like webmacro/velocity as it would be
neater than a JSP for
this. It depends on what you are doing.

Regards,
Nick

- Original Message -
From: "John Ng" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Sunday, February 17, 2002 3:16 PM
Subject: FOP and strus


> Hi, I am looking into FOP in generating PDF in
> struts...  the examples so far that I have seen are
> only taking static XML files and XLS files.  Can
> someone tell me how to use FOP to generate pdf with
> dynamic XML string (generated by some java objects) on
> the fly?
>
> I would apprecaite if you could even provide me with
> some sample code.
>
> Thanks
> John
>
>
> __
> Do You Yahoo!?
> Yahoo! Sports - Coverage of the 2002 Olympic Games
> http://sports.yahoo.com
>
> --
> To unsubscribe, e-mail:

> For additional commands, e-mail:

>
>


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




Re: Multiple struts-config.xml files?

2002-02-13 Thread Nick Pellow

I just had one ActionServlet, and for each action
defined in it's struts-config.xml, there is a separate
forward defined per role (prefixed by role name).
"role1_success"
"role2_success" etc.

All forward name strings (e.g. "success") get intercepted essentially by a
super
class Action and then the user's role is added to the forward name.
The actual ActionForward is then looked up in the action mapping and
returned to the Struts ActionServlet.

Regards,
Nick

- Original Message -
From: "Press, Michael" <[EMAIL PROTECTED]>
To: "'Struts User List'" <[EMAIL PROTECTED]>
Sent: Thursday, February 14, 2002 8:28 AM
Subject: Multiple struts-config.xml files?


> I want to have multiple workflows, with users mapped to a particular
> workflow based on their role.  I know that Struts doesn't support this
now.
> Is there an intent to support this in the future?
>
> In the meantime, I'm interested in suggestions on the best way to
implement
> this.
>
> Right now, I've done this:
>1) I've created multiple ActionServlets, each of which reads it's own
> struts-config file.  Each pair is the workflow for one role.
>2)  I've got a RoleDispatcherServlet that intercepts all Struts URLs,
> converts the URL to call the appropriate ActionServlet for the user's
role,
> and forwards to that URL.
>
> Any additional suggestions or alternative methods are appreciated.
>
> Michael
>
> --
> To unsubscribe, e-mail:

> For additional commands, e-mail:

>
>


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




Re: From action class perform straight to servlet?

2001-03-21 Thread Nick Pellow



Phillip Rhodes wrote:
> 
> In the action class  perform method, there is a return type of a
> ActionForward object.
> 
> But I want to go straight to a servlet  in this method (FOP, generating a
> PDF).  (Wondering, can ActionForwards refer to servlets?)
> 
> I know I can return a ActionForward object that points to to a jsp that
> would include the servlet, but this seems wrong.  Can someone tell me what
> would be the best way to go from ActionForward perform method straight to a
> servlet?

Define a forward such as, 



where create is an action like:

 
 

Cheers, 
Nick

> 
> Thanks!!!
> Phillip



Back Button,

2001-03-21 Thread Nick Pellow

Hello, 
I have developed my own struts web-app, that
invloves a form and then a confirmation screen.

There is validation done on the form, in the
ActionForm's, validate() method.

The following behaviour is occuring:

1) A user makes a number of errors (say 3) on the form
and is returned to the same form page with the errors each time.
(Note, the user has hit the submit button 3 times.)

2) The user finally makes it to the confirmation screen
and is presented with their data.

3) When the user now hits the back button, they stay on the
confirmation screen. They need to hit the back button another
2 times before they see the form screen again.

Has anyone experienced this before?

Cheers, 

Nick



Re: select options

2001-03-08 Thread Nick Pellow



Martin Cooper wrote:
> 
> It seems the documentation is wrong. It should be something like this
> instead:
> 
> - 8< -
> The attribute name of the bean whose properties are consulted to determine
> which option should be pre-selected when rendering this input field. If not
> specified, the bean associated with the form tag we are nested within is
> utilized. [RT Expr]
> - 8< -
> 
> As with the other form-related tags, I have never had to specify the name
> attribute, because I've always been able to use the default, meaning "use
> the form's bean".


> 
> Hope this helps.


Yes, that helps a lot. 
I want to do the above as I have a DataBean that stores commonly used 
lists of data. (credit card types, category names, brand names etc).

I want to be able to use the same bean every time I want to display that
data.
Yet have my FormBean store the result of the users selection.
Will the value on my FormBean be updated or the value on the DataBean be
updated
with the users selection?

Cheers, 
Nick

> 
> --
> Martin Cooper
> 
> - Original Message -
> From: "Nick Pellow" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Wednesday, March 07, 2001 5:01 PM
> Subject: select options
> 
> > Hi,
> > Looking at:
> >
> > http://jakarta.apache.org/struts/struts-html.html#select
> >
> > I notice that for the name attribute, the following description is
> > given:
> > name   The fully-qualified java class name of the bean containing the
> > underlying property. [RT Expr]
> > Is this correct? I thought 'type' was usually used for class names and
> > 'name' was used for variable names.
> >
> > Could someone please tell me what the name attribute means and when it
> > should/shouldn't be used
> > with select boxes?
> >
> > Cheers,
> > Nick



Re: Dynamic selections from Option tag

2001-03-07 Thread Nick Pellow



> Cameron Ingram0 wrote:
> 
> Hi All,
> 
> The scenario is this, I have 2 option boxes I would like to make what
> is available in the 2nd option box dependent on what is selected in
> the first option box, is this possible? If not how can I achieve the
> same affect.

This is possible, and i believe you have two options for this.

1) write a java script function that changes the values of the second
box after an onchange event of the first.
   You can populate arrays of data using the struts logic:iterate tag.

2) If you have a lot of data, do a post back to the server after the
first box onchange event fires, then resend the page with the second box
populated.

Regards, 
Nick


> 
> Thanks in advance Cameron Ingram



select options

2001-03-07 Thread Nick Pellow

Hi, 
Looking at:

http://jakarta.apache.org/struts/struts-html.html#select

I notice that for the name attribute, the following description is
given:
name   The fully-qualified java class name of the bean containing the
underlying property. [RT Expr]
Is this correct? I thought 'type' was usually used for class names and
'name' was used for variable names.

Could someone please tell me what the name attribute means and when it
should/shouldn't be used
with select boxes?

Cheers, 
Nick



Re: Tomcat 3.2.1

2001-03-06 Thread Nick Pellow



[EMAIL PROTECTED] wrote:
> 
> I'm a new member to your group and am having a strange problem.
> 
> I was happily writing struts code when suddenly I was unable to find
> applicationresources.properties and struts-config.xml from my app.  I went back
> to the struts-example and it fails too.  The only way I can make it work the
> example work again is to add
> c:\jakarta-tomcat\webapps\struts-example\WEB-INF\classes to my classpath and
> restart Tomcat.  Of course, this is not the correct way to do this and only
> works for the current application.  Any ideas, before I start uninstalling
> everything from my hard disk.
> 

Have you tried completely removing the struts-example directory that
tomcat
creates after unpacking the original .war file? Then overwite the
struts-example.war
and restart tomcat.

Nick


> Thanks,
> Donnie Hall
> Enron Broadband Services.



Re: Question about iterate tag

2001-03-01 Thread Nick Pellow



Shamdasani Nimmi-ANS004 wrote:
> 
> IT IS UNBELIEVABLE!
> 
> I have wasted so much time trying to get this to work and all that was missing in my 
>JSP was this line:
> 
> <%@ taglib uri="/Web-inf/struts-logic.tld" prefix="logic" %>
> 
> The strange part is that I was not getting any error in the log files saying 
>undefined tag or anything.

nope, not that strange.
if you viewed the source of your page, you should be able to see your
logic tags, still sitting there, unprocessed as text.

The container will only complain about undefined tags if there is a .tld
defined with
a prefix at the top of the page (ie the struts-logic tags). Otherwise it
treats everything
else as plain text.

Cheers, 
Nick

> I appreciate all the help I received :)
> 
> -Nimmi
> 
> -Original Message-
> From: Shamdasani Nimmi-ANS004 [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, March 01, 2001 11:04 AM
> To: '[EMAIL PROTECTED]'
> Subject: RE: Question about iterate tag
> 
> Craig,
> 
> I did try this way but it still does not work. Since supplier.value is of type 
>SupplierBean, do I have to specify that anywhere?
> --
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> -
> but this code which I am trying to replace with tags works:
> 
> 
> 
> 
> <%
> Hashtable hashTable = (Hashtable) user.getSuppliers();
> for (Enumeration e = hashTable.elements(); e.hasMoreElements(); )
> {
>SupplierBean supplier = (SupplierBean) e.nextElement();
> %>
> 
> supplier.getCode() %>
> <%= supplier.getName() %>
> <%= supplier.getCountryName() %>
> 
> 
> <% } %>
> 
> 
> -Original Message-
> From: Craig R. McClanahan [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, February 28, 2001 11:30 PM
> To: [EMAIL PROTECTED]
> Subject: Re: Question about iterate tag
> 
> Shamdasani Nimmi-ANS004 wrote:
> 
> > Hi,
> >
> > Could someone please tell me what I am doing wrong below:
> >
> > user is a bean in session scope in my JSP and its getSuppliers() method returns a 
>hashtable where keys are Suppliers Ids and elements are Supplier beans.
> >
> > type="com.motorola.mms.msqc.beans.SupplierBean">
> >
> > 
> > 
> > 
> > 
> > 
> >
> > 
> >
> 
> When you iterate over a Hashtable (or any other implementation of the Map 
>interface), the object get for the "id" variable is actually an implementation of
> the "Map.Entry" class, not the class of the value of the bean.  From this 
>"Map.Entry" instance, however, you can easily get to the real information:
> 
> 
> 
> This works because a MapEntry has two properties -- key and value -- so we are using 
>the nested property syntax to effectively call getValue().getSeq_nbr().
> 
> >
> > Thanks in advance.
> >
> > -Nimmi
> 
> Craig



Re: recursive tag

2001-02-28 Thread Nick Pellow

Wayne, 
I had this same idea as well.
However, the user will then have to
wait for the new jsp to compile, which
can be quite slow.
There may also be secrutiy issues with file
persmissions etc in your webapp directory.?

What I want to know however, is why you can't just output
the form elements with the first tag? 

Regards,
Nick

David Winterfeldt wrote:
> 
> I haven't followed all of the responses and I'm not
> sure if this would work, but could you generate your
> struts tags to a separate file and then call a struts
> template page that would dynamically include the file
> you generated?
> 
> David
> 
> --- "Young, Wayne" <[EMAIL PROTECTED]> wrote:
> > Martin,
> >
> > Thanks for your response. I'm think I can get this
> > done if I start modifying
> > struts, but I am looking for a simpler solution.
> >
> > I am trying go dynamically create form elements
> > based on a schema. I've been
> > using XALAN with FOP & came up with the idea that a
> > tag could execute XALAN
> > & transform my schema into STRUTS tags. The issue is
> > HOW to get the
> > generated STRUTS tags processed. An alternate
> > solution is to build an editor
> > to edits the schema that regenerates portions of the
> > JSP file. But this
> > would require redeploying the WAR, which isn't
> > really a something we want
> > our customers doing.
> >
> > In the following example, I have a schema named
> > test.xsd. The
> >  tag would examine the schema and
> > generate the 
> > tags, which would then render to HTML.
> >
> > test.xsd
> >  > xmlns:xsd="http://www.w3.org/1999/XMLSchema">
> > 
> >   
> >   
> > 
> > 
> > 
> >   
> >   
> > 
> > 
> >
> > So the tag: 
> > is processed and returns
> >  > maxlength="16"/>
> >  > maxlength="16"/>
> >
> > which is then processed to HTML.
> >
> > I'm keeping a close eye on this thread & if/when I
> > find a solution I'll post
> > it.
> >
> > Thanks for all the responses.
> >
> > Wayne
> >
> >
> >
> > -Original Message-
> > From: [EMAIL PROTECTED]
> > [mailto:[EMAIL PROTECTED]]
> > Sent: Tuesday, February 27, 2001 9:45 PM
> > To: [EMAIL PROTECTED]
> > Subject: RE: recursive tag
> >
> >
> > Actually, the  tag doesn't produce
> > tags, although it does
> > iterate over the tags in its body.
> >
> > What Wayne wants to do, as I understand it, is have
> > a tag that can actually
> > generate some JSP containing other tags (in this
> > case Struts tags). Those
> > tags would then be evaluated, and may in fact
> > produce yet more tags, and so
> > on until there were no more tags to process.
> >
> > My guess now, after Nick Pellow pointed out the bug
> > in my thinking (thank
> > you, Nick! :-) ), is that you just can't do this, at
> > least not this way.
> >
> > Wayne, can you tell us what it is you're trying to
> > do? Maybe we can come up
> > with an alternative approach.
> >
> > --
> > Martin Cooper
> > Tumbleweed Communications
> >
> >
> > At 11:00 PM 2/27/01 -0500, Mallari Kulkarni wrote:
> >
> > >Hi,
> > >
> > >Struts "enumerate"  tag does that
> > >-Original Message-  From:   Young, Wayne
> > >[SMTP:[EMAIL PROTECTED]]  Sent:   Tuesday,
> > February 27, 2001 8:22
> > >AM  To: Struts-Dev@Jakarta. Apache. Org
> > >(E-mail)  Subject:recursive tag
> > >
> > >Does anyone know how to create a tag that produces
> > struts tags &
> > >then  recursively processes them.
> > >
> > >Something like:  
> > is processed and
> > >returns   > >maxlength="16"/>   > size="16"
> > >maxlength="16"/>  which is then processed to HTML.
> > >
> > >Any help would be appreciated.
> > >
> > >Thanks.
> > >
> > >Wayne  [EMAIL PROTECTED]
> >
> 
> __
> Do You Yahoo!?
> Get email at your own domain with Yahoo! Mail.
> http://personal.mail.yahoo.com/



Re: Validating bean properties (WAS: Re: Stupd question aboutStruts and EJB.)

2001-02-27 Thread Nick Pellow

Martin, 


[EMAIL PROTECTED] wrote:
> 
> Actually, the plan is to build exactly this type of validation into Struts
> 1.1. In particular, I am hoping to incorporate it into the automated bean
> creation tool, one way or another.

Yup, I minutes after my lost post, I received the post for Volunteer for
Validation
Framework. Wish I had read that first! The validation stuff sure could
be interesting.

> The idea is to define your bean(s) in an XML file, and have the tool
> generate the actual bean code for you. When you define a bean, you can
> specify its type, along with some other validation rules (yet to be
> determined). The tool will create a validate() method, and that method will
> populate ActionErrors as appropriate.

> My original thought was to generate code based on the validation rules.
> However, David Winterfeldt has written an interesting validator that runs
> off an XML spec directly. This may be a better approach, in that you can
> modify the rules later without recreating the bean, among other things.

I was considering an approach where coders wrote validation code in Java
(we all know java!)
yet the Struts framework executed it. You would extend or implement a
common java class/interface defining a single method, 
public ValidationErrors validate();  say.
That is then mapped to the form field in an xml file somewhere.

Struts, however could ship all the standard validations (such as Strings
to ints)
together.

It is something I have not given much thought to yet, but would be
interested in
exploring further.


> I'm not sure how this will all fall out in the end, but I will be very
> surprised if Struts 1.1 does not include ways of automating the creation of
> form beans, and ways of specifying validation rules without writing code.
> There are several people interested in working on each of these topics, so
> I expect lots of interesting discussion on each and on how to integrate them.

Sounds great!


> Martin Cooper
> Tumbleweed Communications
> 
> At 02:46 PM 2/28/01 +1100, Nick Pellow wrote:
> >Martin,
> >
> >[EMAIL PROTECTED] wrote:
> > >
> > > At 11:17 AM 2/28/01 +1100, Nick Pellow wrote:
> > > >I am very new to struts as is, but as I far as I can tell from reading
> > > >the implementation of the above method,
> > > >the ActionForm can only have String properties. Is this correct?
> > > >
> > > >If so, it would be nice if the ActionForm could support types other than
> > > >String and the
> > > >struts engine would convert these in a similar fashion as Ant does to
> > > >the attributes in the xml build file.
> > >
> > > Actually, Struts will attempt to convert values as it populates a form
> > > bean. This is done in BeanUtils.populate(), which is called right at the
> > > end of RequestUtils.populate().
> >
> >Ooops, thats what I was looking for but did not find.
> >
> > > However, the problem is what to do if it
> > > can't be converted. For example, if I define a form bean property as an
> > > int, and the request contains "abc", what should Struts do?
> >
> >Struts could create an ActionErrors object with an ActionError for each
> >conversion error.
> >If an error does get raised at that early stage, then one will no doubt
> >be raised later on
> >in the Action. The difference is that the coder has to
> >a) check for the conversion error again,
> >b) raise an error again.
> >It also means that checking for such user mistakes is spread across
> >mulitple layers in the application
> >and also across multiple components within the system. I think it would
> >be nice to centralize
> >such type checking in one part of the system.
> >
> >
> >The error message strings could be defined in a similar fashion to
> >errors.header and errors.footer.
> >Maybe something like:
> >errors.conversion.NumberFormatException=You must enter a number for the
> >{0} field, not {1}.
> >
> >Then when Struts comes across a type error, it raises the error then and
> >there, using a resource
> >such as the one above to report to the user.
> >
> >As mentioned earlier in this thread this option could be configurable in
> >Struts as it may not
> >always be desirable.
> >
> > > In 1.0, it will set the property to a (configurable) default value, but
> > > that's not a good solution when there's no obvious candidate meaning
> > > "invalid" (e.g. for a boolean). It also destroys the original user input,
> > > so when validate() fails and returns the user to the input form, you can no
> 

Re: Stupd question about Struts and EJB.

2001-02-27 Thread Nick Pellow

Martin, 

[EMAIL PROTECTED] wrote:
> 
> At 11:17 AM 2/28/01 +1100, Nick Pellow wrote:
> >I am very new to struts as is, but as I far as I can tell from reading
> >the implementation of the above method,
> >the ActionForm can only have String properties. Is this correct?
> >
> >If so, it would be nice if the ActionForm could support types other than
> >String and the
> >struts engine would convert these in a similar fashion as Ant does to
> >the attributes in the xml build file.
> 
> Actually, Struts will attempt to convert values as it populates a form
> bean. This is done in BeanUtils.populate(), which is called right at the
> end of RequestUtils.populate(). 

Ooops, thats what I was looking for but did not find.

> However, the problem is what to do if it
> can't be converted. For example, if I define a form bean property as an
> int, and the request contains "abc", what should Struts do?

Struts could create an ActionErrors object with an ActionError for each
conversion error.
If an error does get raised at that early stage, then one will no doubt
be raised later on
in the Action. The difference is that the coder has to 
a) check for the conversion error again, 
b) raise an error again.
It also means that checking for such user mistakes is spread across
mulitple layers in the application
and also across multiple components within the system. I think it would
be nice to centralize
such type checking in one part of the system. 


The error message strings could be defined in a similar fashion to
errors.header and errors.footer.
Maybe something like: 
errors.conversion.NumberFormatException=You must enter a number for the
{0} field, not {1}.

Then when Struts comes across a type error, it raises the error then and
there, using a resource
such as the one above to report to the user.

As mentioned earlier in this thread this option could be configurable in
Struts as it may not
always be desirable.

> In 1.0, it will set the property to a (configurable) default value, but
> that's not a good solution when there's no obvious candidate meaning
> "invalid" (e.g. for a boolean). It also destroys the original user input,
> so when validate() fails and returns the user to the input form, you can no
> longer display to them the mistake they made. (By default, in the situation
> I described above, the user would see "0" where they entered "abc".)
> 
> So it's really best if form bean properties are all strings. What you *can*
> do, though, is have your validate() method check that the value can be
> converted to what you want, and return an error if it can't. For example,
> you might use Integer.parseInt() to ensure that a valid integer was entered.

If the validate() method does the type checking then we must implement
type
conversion code and type checking code in every single form bean we
write!
On large systems, this is sometimes very unfun.

Any thoughts?

Regards, 
Nick



> 
> --
> Martin Cooper
> Tumbleweed Communications



Re: Stupd question about Struts and EJB.

2001-02-27 Thread Nick Pellow



[EMAIL PROTECTED] wrote:
> 
> This is the approach that I am using, but to simplify the design I have
> interconnected the view and model. I would like to eliminate this coupling-
> so if anyone has some suggestions or could recommend a pattern I could apply
> please let me know :) What I am doing is creating entity beans that resemble
> the ActionForm as much as possible- for the most part there is a loose 1 to
> 1 relationship between entity EJB and ActionForm. There are some exceptions,
> but this is how 80% of the app is designed. I use session EJBs to manage the
> entity EJBs and map these to appropriate ActionForms (using the Struts
> copyProperties util). So, the session EJB must be aware of the ActionForm,
> since this is the object that it returns. To persist data, the ActionServlet
> obtains a reference to the session EJB and would send a save() method I have
> implemented the ActionForm which then is copied to an entity EJB. Ideally
> there should be a proxy between the EJB tier and the Struts tier, so the
> session EJB does not need to be aware of the ActionForm. But, I am not about
> to create another intermediate object with the same properties and
> setters/getters. Some of my forms have up to 30 properties so this is way
> too much work! I think this should be done automatically.
> 
> One more thing- the copyProperties requires that properties are the same
> type. But, the view is basically just String-based where the ejb tier
> consists of real Date, BigDecimal, etc... So what I find myself doing is
> creating additional methods in the ActionForm that make this transformation.
> For example setCustomerId(BigDecimal) and setCustomerIdStr(String). Then use
> the string version for Struts, and when copyProperties is invoked it will
> map the BigDecimal value to the EJB. Perhaps I should extend copyProperties
> to support basic type conversions- or has this already been done elsewhere?
> 
> thoughts or suggestions?

Bob, 
I can see what you mean. The 
RequestUtils.populate(Object bean, String prefix, String suffix, 
HttpServletRequest request)
methods do no type conversions.
So do you call the additional conversion methods during the validate()
method on the ActionForm?

I am very new to struts as is, but as I far as I can tell from reading
the implementation of the above method, 
the ActionForm can only have String properties. Is this correct?

If so, it would be nice if the ActionForm could support types other than
String and the
struts engine would convert these in a similar fashion as Ant does to
the attributes in the xml build file.
An error message could be returned to the user if they entered a String
into an Integer field, say.
This behavour may not be always desired, so it could be switched on and
off in the .
 This may open a can of worms however, Date formats spring to mind.
However, comming from a background of using tags in anger, I wrote a lot
of code
converting Strings to other objects, (mostly Longs, ints, (B)booleans ).

Just my 2 Bobs worth.


cheers, 
Nick



> 
> Thanks,
> Bob
> 
> -Original Message-
> From: Nick Pellow [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, February 27, 2001 5:23 PM
> To: [EMAIL PROTECTED]
> Subject: Re: Stupd question about Struts and EJB.
> 
> Hello,
> 
> Robert Leland wrote:
> >
> > As far as struts 1.0, the Form bean is used only to redisplay
> > information to the jsp page. Typically the EJB might be loaded/unloaded in
> the
> > action class. If you search www.mail-archives.co,m Craig talked more about
> this in detail.
> 
> My understanding is that with struts you should keep your EJBs entirely
> independant of
> anything to do with struts or servlets. You can and should however have
> a standard naming
> convention for the getters and setters across the EJB, the ActionForm
> and the html form elements.
> this allows you to call PropertyUtils.copyProperties(java.lang.Object
> dest, java.lang.Object orig)
> when you are ready to store the details entered by the user.
> 
> Please let me know if this does not sound right.
> 
> Cheers,
> Nick
> 
> > In future version of struts this may be enhanced.
> >
> > -Rob
> >
> > > Cameron Ingram0 wrote:
> > >
> > > I am in the process of convincing my company to go with MVC and Struts.
> As with any thing new,
> > > people are sometimes resistant
> > > to change. One of the opposition questions I am getting is, how will
> this work with EJB(problem is
> > > I don't know too much about EJB currently).  Do the EJB's references
> just go in the Form and
> > > Action Bean and every thing else behaves the same? Are there any obvious
> points that I can bring
> > > up on the subject?
> > > Any help on this subject would be much appreciated!
> > >
> > > Thanks, Cameron Ingram



Re: Stupd question about Struts and EJB.

2001-02-27 Thread Nick Pellow


Hello, 

Robert Leland wrote:
> 
> As far as struts 1.0, the Form bean is used only to redisplay
> information to the jsp page. Typically the EJB might be loaded/unloaded in the
> action class. If you search www.mail-archives.co,m Craig talked more about this in 
>detail.

My understanding is that with struts you should keep your EJBs entirely
independant of
anything to do with struts or servlets. You can and should however have
a standard naming
convention for the getters and setters across the EJB, the ActionForm
and the html form elements.
this allows you to call PropertyUtils.copyProperties(java.lang.Object
dest, java.lang.Object orig)
when you are ready to store the details entered by the user.

Please let me know if this does not sound right.

Cheers, 
Nick

> In future version of struts this may be enhanced.
> 
> -Rob
> 
> > Cameron Ingram0 wrote:
> >
> > I am in the process of convincing my company to go with MVC and Struts. As with 
>any thing new,
> > people are sometimes resistant
> > to change. One of the opposition questions I am getting is, how will this work 
>with EJB(problem is
> > I don't know too much about EJB currently).  Do the EJB's references just go in 
>the Form and
> > Action Bean and every thing else behaves the same? Are there any obvious points 
>that I can bring
> > up on the subject?
> > Any help on this subject would be much appreciated!
> >
> > Thanks, Cameron Ingram



Re: Struts Installation Problem

2001-02-25 Thread Nick Pellow



Wayne Ohm wrote:
> 
> I just installed Struts with Tomcat 3.2.1, but when I start Tomcat, I
> keep getting this  java.lang.NoSuchMethodError and startup.bat exits.
> Can anyone help plez??

I am rather new to both Tomcat and Struts myself, however managed
to install both without a hiccup on NT 4 with jdk1.2.2.

Just before your stack trace however, the line:
 Guessed home=c:\tomcat
does not look good.
Where have you installed tomcat?

Nick

> 
> 
> New org.apache.struts.action.ActionMapping
> Set org.apache.struts.action.ActionMapping properties
> Call
> org.apache.struts.action.ActionServlet.addMapping(ActionMapping[path=/admin
> 
> /removeMapping, type=org.apache.struts.actions.RemoveMappingAction])
> Pop org.apache.struts.action.ActionMapping
> Guessed home=c:\tomcat
> java.lang.reflect.InvocationTargetException: java.lang.NoSuchMethodError
> 
> at
> org.apache.struts.action.ActionServlet.initServlet(ActionServlet.java
> :1377)
> at
> org.apache.struts.action.ActionServlet.init(ActionServlet.java:473)
> at javax.servlet.GenericServlet.init(GenericServlet.java:266)
> at
> org.apache.tomcat.facade.ServletHandler.doInit(ServletHandler.java:41
> 0)
> at
> org.apache.tomcat.facade.ServletHandler.init(ServletHandler.java:265)
> 
> at
> org.apache.tomcat.facade.LoadOnStartupInterceptor.contextInit(LoadOnS
> tartupInterceptor.java:137)
> at org.apache.tomcat.core.Context.init(Context.java:540)
> at
> org.apache.tomcat.core.ContextManager.init(ContextManager.java:527)
> at
> org.apache.tomcat.startup.EmbededTomcat.initContextManager(EmbededTom
> cat.java:245)
> at org.apache.tomcat.startup.Tomcat.start(Tomcat.java:150)
> at org.apache.tomcat.startup.Tomcat.execute(Tomcat.java:93)
> at java.lang.reflect.Method.invoke(Native Method)
> at org.apache.to
> ===