Log4J - Log file gets overwritten

2002-02-20 Thread Praveer Mathur
Hi !

I am using Log4J version 1.1.3 downloaded from jakarta.apache.org.
Everything seems to be working fine with it except that even if i set

log4j.appender.R.MaxFileSize = 100KB
log4j.appender.R.MaxBackupIndex = 10

I get only one log file and when it rolls over the 100K limit, it gets
overwritten.

According to documentation on the site, it should rename the old copy and
start with a new file with the same name.

Has anybody faced this problem before?Any solution?

Regards,
Praveer



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


where download struts javadoc?

2002-02-20 Thread @Basebeans.com

Subject: where download struts javadoc?
From: zb cong [EMAIL PROTECTED]
 ===
hello
where can i download struts javadoc?
i only find the online version on apache website .



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




RE: How do I init a Form bean via business logic?

2002-02-20 Thread Ian Beaumont

I've been trying to get an answer to how to initialise a form bean from this
list, but with no success.
See Re: Can this be done at all using Form objects within struts fram
ework

The reason why I don't think you can pre-populate a form from the beam
(other than possibly breaking MVC) is that if the form fails to validate
correctly, when it is re-displayed it will wipe out all values the user has
entered - which wouldn't be the desired behaviour.

Can someone please give some guidance to the best practise for this
initialising a form bean via business logic.



-Original Message-
From: Barr, Scott [IBM GSA] [mailto:[EMAIL PROTECTED]]
Sent: 20 February 2002 03:27
To: 'Struts Users Mailing List'
Subject: RE: How do I init a Form bean via business logic?



The best reason I can give as to why you should use form objects, is that
you will pretty much always provide String getter and setters, rather than
the 'real' data object types. eg Timestamp


 -Original Message-
 From: Jakkampudi, ChandraseKhar [SMTP:[EMAIL PROTECTED]]
 Sent: Wednesday, February 20, 2002 1:03 PM
 To:   'Struts Users Mailing List'
 Subject:  RE: How do I init a Form bean via business logic?
 
 Scott,
 I need to clarify this further. 
 I am not suggesting you do away with an action. You use the action to get
 the data that is required as a value object. Since this is a value object,
 it can be re-used to serve another client. Instead of creating a form bean
 in the action, you set the retrieved value object from your DAO as a bean
 in
 your request. Thus, you avoid additional mapping code like
 form.setValue(valueObject.getValue()) and so on.
 Then if need be, you pre-populate the form, or display the data outside of
 the form in the jsp as a table or what not. 
 
 An instance of where this would be particularly useful. Let us say that
 some
 fields are not editable but are display only. (like your ID). Initializing
 the form in the action causes part of your display to be populated from
 the
 action while the rest is in the jsp.
 
 Your argument about jsp not creating and initialising objects is not true
 because that is exactly what jsp:useBean, bean:define and other tags
 (which
 is the right way to do things) do. Also, if you do not initialise a form
 in the action, or dont need to pre-fill data, the jsp IS the place where
 these objects are created.
 
 Nothing in what I suggested, implies that you need to catch errors and
 exceptions in the jsp. I agree with you that they shouldn't and with the
 approach I outlined they dont have to. All of this is done in the action.
 I
 am only asking about the additional step of creating the form bean which I
 think is not necessary.
 
 The action creates the Business Objects. You are right. But it does not
 NEED
 to create the Form objects. It can. But I cannot see an overriding reason
 why it SHOULD. 
 
 
 Thanks
 JC
 
 
 
 -Original Message-
 From: Barr, Scott [IBM GSA] [mailto:[EMAIL PROTECTED]]
 Sent: Tuesday, February 19, 2002 7:47 PM
 To: 'Struts Users Mailing List'
 Subject: RE: How do I init a Form bean via business logic?
 
 
 
 1. If you are doing something other than creating a new view component and
 allowing it to set its own default values, I would imagine that you are
 doing an Action.
 
 2. No it doesn't break MVC if the Action initialises the Form. If an
 action
 cannot deal with a form, where exactly is this supposed to be performed? 
 An Action populating a form object does not mean it requires knowing how
 the
 data will be presented, it is just data. What the jsp does with it is not
 the concern of the action. The Action does not care if property X is
 displayed as static text, or in a text field.
 The jsp is a presentation layer, and should not be creating and
 initialising
 objects. By the time you get to your presentation layer, you should not
 have
 to be catching errors, and redirecting to error pages etc. 
 The Action creates business objects. These objects can throw exceptions.
 eg.
 error while getting a new ID from a database. If an error occurs, I add
 error to the errors, and this will be displayed...
 If you init a Form bean in a jsp, and an exception occurs, you must deal
 with it in the page.
 
 3. What additional code? If your action deals with your business layer,
 but
 should not contain business logic itself. If it does, you cannot use your
 business object model to provide a different interface
 
 4. I don't see that filling a jsp with debug code makes for easier
 debugging. 
 If something is populated incorrectly, you would look at your Action
 object.
 I have toString() method in my business objects, and these objects log to
 file. Each layer provides its own logging (I'm using log4j), so while
 developing I can switch log levels quite easily. 
 Once a layer is debugged, I shouldn't have to debug it from a different
 layer. This makes for simple unit testing, and does away with the need for
 a
 gui debugger
 
 Scott
 
  

form looses valuse when validation maps back

2002-02-20 Thread Oliver Reflé

Hello All,
i have for me a real strange problem. When i validate my form and there are
missing
fields then it is mapped back to the input page. All the error messages are
shown correctly.
The only thing is that my form is empty and the user has to reenter all
values,  which is
really annoying.

This is my entry in the struts-config.xml

action path=/admin/createCompany

type=com.transwide.services.uma.web.action.admin.CreateCompanyAction
name=companyForm
scope=session
input=/uma/admin/create-company-step1.jsp
validate=false
  forward name=success
   path=/uma/admin/create-company-step2.jsp
  /forward
  forward name=failure
   path=/uma/admin/failure.jsp
  /forward
/action

The validation is done in the action class(business reason), but i tried it
also in the Form which
makes no difference. Here is part of my Action which handles the validation

ActionErrors errors = new ActionErrors();

try{

CompanyForm companyForm = (CompanyForm)form;

// some validations
if (companyForm.getAccountName()==null ||
StringUtils.isEmpty(companyForm.getAccountName())) {
errors.add(accountname, new
ActionError(error.accountname));
}
if (companyForm.getCompanyName()==null ||
StringUtils.isEmpty(companyForm.getCompanyName())) {
errors.add(companyname, new
ActionError(error.companyname));
}
if (companyForm.getPrefix()==null ||
StringUtils.isEmpty(companyForm.getPrefix())) {
errors.add(prefixlength, new ActionError(error.prefix));
} else if (companyForm.getPrefix().length() != 3) {
errors.add(prefixlength, new
ActionError(error.prefixlength));
}
if(companyForm.getCompanyTypes()==null ||
StringUtils.isEmpty(companyForm.getCompanyTypes())) {
errors.add(companytypes, new
ActionError(error.companytypes));
}
if(companyForm.getVatNumber()==null ||
StringUtils.isEmpty(companyForm.getVatNumber())) {
errors.add(vatnumber, new ActionError(error.vatnumber));
}
if (!errors.empty()) {
saveErrors(request, errors);
return (new ActionForward(mapping.getInput()));
}

I can take the form data out of the session with a scriptlet and display the
values, but
struts don't fills out the form automaticly. First thing i took a look on
it, that i maybe
configured the scope of the form incorrect and when mapping back to input he
trys to generate
a new form which is only stored in the request. But there all settings seem
to be correct.

Any idea ??

oliver


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




How to read the application.resoureces file in JSP

2002-02-20 Thread Arun_Kumar_N



Hello,
 How to read the application.resources file in the JSP file.
I need this urgently.Please look inot this.

Regards
Arun



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




RE: How to read the application.resoureces file in JSP

2002-02-20 Thread Arik Levin ( Tikal )


What is the goal ?

Maybe there's alternative. 


-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] 
Sent: Wednesday, February 20, 2002 11:25 AM
To: Struts Users Mailing List
Subject: How to read the application.resoureces file in JSP



Hello,
 How to read the application.resources file in the JSP file.
I need this urgently.Please look inot this.

Regards
Arun



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



Re: Why don't tiles cascade?

2002-02-20 Thread Cedric Dumoulin



  It is an expected behavior ! Tiles can be seen like functions : they takes
parameters, and parameters are only visible inside the function, not outside,
neither in called functions.

  This behavior allows to write a Tile without taking care about possible
conflicts with attribute names.
  Imagine that you write a complex page with several nested Tiles, and several
time the same Tile with different values for the same attribute. If you cascade
attributes, you will have names clashing. Furthermore, while developing a Tile
you will need to thing about the names used in the whole page and in other Tiles,
to avoid possible conflict ! This will forbid reusable Tiles.

  If you want to use an attribute value inside another inserted Tile, you have to
pass it explicitly. In your example, you could write something like :
layout.jsp
-- CUT --
tiles:insert path=/header.jsp
  put beanName=title beanScope=template /
 // In future release, beanScope will accept tiles also (same as
template)
/tiles:insert
tiles:insert attribute=content/
tiles:insert path=/footer.jsp/
-- CUT --

Reading your example, I think you should better not cut a tag into two separate
files (body and /body). Putting a start and end tag in the same file improve
legibility, and minimize potential errors (forget the closing tags, forget to
insert the corresponding file, ...).

  Cedric

Jim Crossley wrote:

 Apparently it's not possible to access attributes of any tiles other
 than your immediate parent.  IMHO, this restricts my ability to
 partition my presentation code into simple, reusable chunks.

 Here's a semi-practical example.

 Consider this snippet from a definitions file...

   definition name=training path=/layout.jsp
 put name=content value=/training.jsp/
 put name=title   value=Training/
   /definition

 layout.jsp
 -- CUT --
 tiles:insert path=/header.jsp/
 tiles:insert attribute=content/
 tiles:insert path=/footer.jsp/
 -- CUT --

 header.jsp
 -- CUT --
 html
   head
 titletiles:getAsString name=title//title
   /head
   body
 -- CUT --

 footer.jsp
 -- CUT --
   /body
 /html
 -- CUT --

 The above example, as simple as it is, won't work, because header.jsp
 can't find the attribute named title.

 Have I completely misunderstood the intent behind Tiles, or is it
 simply not quite ready for prime time?  Is there a better (simpler)
 approach than the one taken in the above example?

 -- Jim

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


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




Re: Displaying Test if html:errors is free of errors...

2002-02-20 Thread Sean Willson

I played with this same thing for a while, and I came up with the 
following tag combinations to do something what you want:

html:messages id=error header=errors.header 
footer=errors.footerbean:write name=error 
filter=false//html:messages
html:messages id=message header=messages.header 
footer=messages.footer message=truebean:write name=message 
filter=false//html:messages

You can remove the references to errors.header/footer and 
messages.header/footer if you don't want them. Basically the first tag 
set only gets executed when there are errors, and the second only when 
there are messages. So what we do is put a success message in the 
request that we obviously want rendered differently then errors.

Another way of doing it, which may be more what you were looking for 
would be:

html:errors/
logic:messagesNotPresentPUT SOMETHING HERE/logic:messagesNotPresent

Those should also do what you want, just depends on what you want to 
display when there are no errors. Hope this helps.

Sean

Mattos, John wrote:

 Hi
 
 In a jsp, I want to display some text if there are no errors present, that
 is, that html:errors hasn't been populated with any errors in my 
 perform()
 method.
 
 What's the best way to do this?
 
 John
 
 John Mattos
 Sr. Developer and Architect
 iNDEMAND
 345 Hudson St. 16th Floor
 New York, New York
 10014
 
 -- 
 To unsubscribe, e-mail:   
 mailto:[EMAIL PROTECTED]
 For additional commands, e-mail: 
 mailto:[EMAIL PROTECTED]
 




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




My problems with Struts...

2002-02-20 Thread kothapallibc

Hi,

I'm a newbie to Struts and trying to fit it into an application 
that's modeled after Blueprints. I feel frustrated at many 
places...It could be just that I don't understand Struts properly 
yet.I feel like just using the classes that I like and leaving those 
features I don't prefer.

I agree that it provides a nice working framework, but I find too 
many limitations...

1.Struts automatically read your form data into request/session scope 
as specified in struts-config.xml.

My problems with this are

Firstly, I need to transform the data types other than Strings.
And then it gets funny when using arrays...
If you have a 'String[] str', you don't have to initialize it in your 
form bean.
But if you have an object array like 'Monkey[] monkeys', you need to 
initilize it in the form bean, or else it throws NullPointerException.
How am I supposed to know the number of 'monkeys' the user wants to 
key in?

One more thing is, for 'String[] str', the HTML parameter names 
should be just 'str'. All the parameters with the same name will
be read into 'str[]'.

But with 'Monkey[] monkeys', the parameter names should have the index
like 'monkey[0].name','monkey[1].name' etc. 
Why is it so? And this indexed naming makes the javascript difficult 
to code and read.

With such problems with transformation and nested bean arrays, I feel 
like reading the HTML data on my own. I fail to see how this feature 
adds much value.

2.Provides form validation. 

This is a good feature to have, but anyway, generally we push as much 
validation as we can into Javascript and if there are any real 
business validation to be done, I'd prefer doing it in  business tier 
rather than in Form bean.

Again it adds value, but in a large application, I don't feel it is 
that much.

3.Internationalization - again good, but it's not that difficult to 
implement on our own.

4.Tag libraries - I never really used tag libraries in JSPs, so 
cannot comment on the usefulness of them. Do people find the tag 
libraries so useful? I want to know where this feature stands the 
list of good things about struts.

There seem to be many experienced Struts users on this list. Could 
you please tell me the features you find very useful and the kind of 
applications you are building using them? And if I'm missing 
something badly in my understanding?

Regards,
Choudary.




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




Night Build size?

2002-02-20 Thread neil

I notice that the last 2 struts nightly builds (binaries) are about 10th of
the normal size. This has happened before also.

Neil



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




RE: How do I init a Form bean via business logic?

2002-02-20 Thread Keith

IMHO - MVC means the flow of data between the presentation  business layers is
controlled by the controller (a struts Action).
It's hard to prove this is the best way.  I'm among the many people that feel
struts is designed to help us write well designed MVC apps.
A formBean is designed to be a utility to simplify/standardise the coding for
passing data between HTML forms  Action classes, it has no controller
functions.

I praise your scepticism!
In my early days I was sceptical of the amount of extra code required to
seperate the layers cleanly (ie. stop the view going directly to the model) but
I support it now - especially for apps that update data.

In an enquiry only app I think it may be good to combine the view  controller
functions into 1 function - only if there is hardly anything for the controller
to do.

A typical app displays some things  updates others, I think it is better to
make all data go through the controller (Action). Form data goes via the
formBean, display only data is placed by the controller (Action) in the request
for the view (jsp) to fetch. This requires slightly more code than having the
jsp fetch data from the model (business layer) or even directly from the
persistence layer (the database).
But the benefit is the number of different routes of data between the view 
business logic is less  this is highly beneficial for ease of maintenance,
testing etc.

It seems to me a lot of people follow design patterns a bit too dogmatically -
It is good to analyse the cost of using a pattern or framework compared to it's
benefits. Struts is designed for writing dozens or hundreds or more jsp's. It
takes time to learn but is worth it.
I'd guess your first 5 or 10 pages will take longer but beyond that they get
faster  faster, like a production line cranking up the speed.
I must confess to not being highly experienced in struts but am in large
systems design  I quickly recognised struts as being an excellent usable
product functionally. It design is practical  pragmatic a sign that using it
in the way it's designers intended is right.
Blimey these discussions should not be done by email - takes too long. Was this
of any use?
K.
- To be a bit more specific
- The Action class decides the values to be displayed, gets the data  makes it
available for the jsp - in the formBean or the request. This includes the
values to initialise forms. 
- The jsp displays it.
Simple!

--- Jakkampudi, ChandraseKhar [EMAIL PROTECTED] wrote:
 My reasons are as follows. I do not know if they are right or wrong, but
 would appreciate comments.
 
 1. Consistency. All of the dynamic data that is presented in a jsp is via
 bean:write tags or scriptlets which access a value object. I think
 pre-populating or initializing a form should be no different.
 2. Breaks MVC(IMHO). Action is a controller component. Initialization of
 forms is a presentation issue.
 3. Additional code. A value object is generated anyway by the DAO(which you
 use to get the data). If you use the action for initialization, all you are
 doing is copying the data into the form bean. It ensures clean separation of
 data when you do it the other way around (i.e copying data from form bean to
 value object even if they are similar) because you do not want the rest of
 your code to know about action forms etc which are html specific. But it
 does not make sense (to me) to copy pure java objects/value beans into
 identical form beans just for pre-population.
 4. Easier debugging. If your value is populated wrong, you can look at the
 jsp to figure out which values are being written from which bean. If you do
 init in the action, you have to debug java code to find out presentation
 issues especially for things like multiple selects of dropdowns etc.
 
 Again, I am not saying init in the action is wrong. But I saw a lot of
 emails saying that it is the right thing to do without  giving any reason.
 For the above mentioned reasons, I opted not to do the init in the action. I
 am trying to understand why this approach is recommended over the other one?
 What have I missed?
 
 TIA,
 JC
 
 -Original Message-
 From: Barr, Scott [IBM GSA] [mailto:[EMAIL PROTECTED]]
 Sent: Tuesday, February 19, 2002 6:45 PM
 To: 'Struts Users Mailing List'
 Subject: RE: How do I init a Form bean via business logic?
 
 
 
 Hi JC
 
 If the data is dynamic, and we are talking about web apps here, why not
 populate it in the action?
 The form is a view component, and I don't give it any more 'smarts' than is
 possible. This as a neat way of separating the layers your application, one
 of the benefits of clean MVC design
 
 Scott
 
  -Original Message-
  From:   Jakkampudi, ChandraseKhar [SMTP:[EMAIL PROTECTED]]
  Sent:   Wednesday, February 20, 2002 10:59 AM
  To: 'Struts Users Mailing List'
  Subject:RE: How do I init a Form bean via business logic?
  
  Why should pre-populating a form be done in the preceding action? When you
  want to display some 

Error Messages and tags

2002-02-20 Thread Eddie Fung

We have the text for error messages declared in the 
ApplicationResources.properties file as per standard. We have the header 
and footer text as required. Now is it possible to display the error 
messages WITHOUT the header and footer in certain situations ? We'd like to 
re-use the messages and display them on the page without the header and 
footer on a couple of pages. In one case the message is actually a warning 
rather than error and to have the standard header (which indicates an 
error) is a bit misleading.

TIA

Eddie 


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




Struts + Tiles..

2002-02-20 Thread Tuomo Syvänperä

Hi..
I know you must be sick and tired of these stupid questions about struts 
 tiles but I have a problem (imagine that).
I keep getting java.lang.IllegalStateException from tomcat when using 
tiles. At first I thought I had just done something wrong when using 
tiles, but it seems that even a simple page as described below throws 
this exception.
I have a test.jsp file:
%@ taglib uri=/WEB-INF/tiles.tld prefix=tiles%

html
body
tiles:insert page=foo.jsp/
/body
/html

And foo.jsp only includes the line 'foo' in it.

Now when I access the page test.jsp I get the following error:
[12:46:48,164,EmbeddedCatalinaServiceSX] 
ApplicationDispatcher[/emedia.war] Servlet.service() for servlet default 
threw exception
java.lang.IllegalStateException
at 
org.apache.jasper.runtime.ServletResponseWrapperInclude.getOutputStream(ServletResponseWrapperInclude.java:109)
at 
org.apache.catalina.servlets.DefaultServlet.serveResource(DefaultServlet.java:1143)
at org.apache.catalina.servlets.DefaultServlet.doGet(DefaultServlet.java:519)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at 
org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:679)
at 
org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:570)
at 
org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:493)
at 
org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimeLibrary.java:818)
at 
org.apache.jasper.runtime.PageContextImpl.include(PageContextImpl.java:390)
at 
org.apache.struts.taglib.tiles.InsertTag$InsertHandler.doEndTag(InsertTag.java:757)
at org.apache.struts.taglib.tiles.InsertTag.doEndTag(InsertTag.java:369)
at org.apache.jsp.test$jsp._jspService(test$jsp.java:73)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at 
org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:202)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:382)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:474)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
[SNIP]

I'm using JBoss 2.4.4 with embedded Tomcat 4.0.1 and using the latest 
(20020219) nightly build of struts and latest development build of tiles 
which I downloaded from tiles homepage.
I have defined the controller as TilesRequestProcessor in 
struts-config.xml and in web.xml I have ActionComponentServlet as the 
action component.

Thanks.
Tuomo


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




Re: FORM ELEMENTS MAPPING WITH JAVA BEAN

2002-02-20 Thread Keith

No  why would you want to? Struts imposes a nice useful standard.
Why not follow the capitalisation styles in the struts example ( everywhere
else!).

--- Amit Sharma [EMAIL PROTECTED] wrote:
 Hi ,
 
 Struts framework says that the form element names should be same as form
 beam attribute names. Is there a way I could define different names .Let say
 FORM_NAME_USERNAME in the form is supposed to be mapped to username in Java
 Form Bean.
 
 Thanks,
  --
 To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
 For additional commands, e-mail: mailto:[EMAIL PROTECTED]


=
~~
Search the archive:-
http://www.mail-archive.com/struts-user%40jakarta.apache.org/
~~
Keith Bacon - Looking for struts work - South-East UK.
phone UK 07960 011275

__
Do You Yahoo!?
Yahoo! Sports - Coverage of the 2002 Olympic Games
http://sports.yahoo.com

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




Re: sessions

2002-02-20 Thread Keith

Hi Bill,
This has been answered but I couldn't find the answer in the archive!
I'm not the expert here but - it's when a new session is created.
Struts doesn't know if the browser accepts cookies (where the session id is to
be stored) so puts it in the URL (URL re-writing). On the next request struts
knows the cookie is accepted so doesn't need to put the sessionId inthe URL.
So every time you see that it's the symptom of a new session being created - no
the cause.

--- Bill Page [EMAIL PROTECTED] wrote:
 I'm having a problem with sessions using JRun.  I have noticed that the
 address line sometimes has a url;jsessionid=n and sometimes it doesn't.
 When it doesn't I seem to end up with a new session id.  Any thoughts?
 
 thanks
 
   bill page
   [EMAIL PROTECTED]
   Digital Garden Software, Inc.
   856 US Hwy 206 Bldg B Ste 15
   Hillsborough, NJ 08844
   908.904.0664
 
 
 
 --
 To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
 For additional commands, e-mail: mailto:[EMAIL PROTECTED]
 


=
~~
Search the archive:-
http://www.mail-archive.com/struts-user%40jakarta.apache.org/
~~
Keith Bacon - Looking for struts work - South-East UK.
phone UK 07960 011275

__
Do You Yahoo!?
Yahoo! Sports - Coverage of the 2002 Olympic Games
http://sports.yahoo.com

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




Re: Error Messages and tags

2002-02-20 Thread Keith

1 - There is a new Messages tag in the nightly build. If you only need 1 mesage
it's easy to code it yourself.
2 - Don't do this - Use a blank string for header/footer  add your errors with
a wrapper class that adds a special string for the 1st  last message. The
order of the errors is not preserved (in this release of struts) so you're
header might come out last.

--- Eddie Fung [EMAIL PROTECTED] wrote:
 We have the text for error messages declared in the 
 ApplicationResources.properties file as per standard. We have the header 
 and footer text as required. Now is it possible to display the error 
 messages WITHOUT the header and footer in certain situations ? We'd like to 
 re-use the messages and display them on the page without the header and 
 footer on a couple of pages. In one case the message is actually a warning 
 rather than error and to have the standard header (which indicates an 
 error) is a bit misleading.
 
 TIA
 
 Eddie 
 
 
 --
 To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
 For additional commands, e-mail: mailto:[EMAIL PROTECTED]
 


=
~~
Search the archive:-
http://www.mail-archive.com/struts-user%40jakarta.apache.org/
~~
Keith Bacon - Looking for struts work - South-East UK.
phone UK 07960 011275

__
Do You Yahoo!?
Yahoo! Sports - Coverage of the 2002 Olympic Games
http://sports.yahoo.com

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




Re: Struts + Tiles..

2002-02-20 Thread Tuomo Syvänperä

Okay... Seems to be a problem with tomcat. I tried the same thing with 
orion and it works like a charm. Anybody now about this kind of bug in 
tomcat ? Or is it a bug or a feature :)

/tuomo

Tuomo Syvänperä wrote:
 Hi..
 I know you must be sick and tired of these stupid questions about struts 
  tiles but I have a problem (imagine that).
 I keep getting java.lang.IllegalStateException from tomcat when using 
 tiles. At first I thought I had just done something wrong when using 
 tiles, but it seems that even a simple page as described below throws 
 this exception.
 I have a test.jsp file:
 %@ taglib uri=/WEB-INF/tiles.tld prefix=tiles%
 
 html
 body
 tiles:insert page=foo.jsp/
 /body
 /html
 
 And foo.jsp only includes the line 'foo' in it.
 
 Now when I access the page test.jsp I get the following error:
 [12:46:48,164,EmbeddedCatalinaServiceSX] 
 ApplicationDispatcher[/emedia.war] Servlet.service() for servlet default 
 threw exception
 java.lang.IllegalStateException
 at 
 
org.apache.jasper.runtime.ServletResponseWrapperInclude.getOutputStream(ServletResponseWrapperInclude.java:109)
 
 
 at 
 org.apache.catalina.servlets.DefaultServlet.serveResource(DefaultServlet.java:1143) 
 
 at 
 org.apache.catalina.servlets.DefaultServlet.doGet(DefaultServlet.java:519)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
 at 
 
org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:679) 
 
 at 
 
org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:570)
 
 
 at 
 
org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:493)
 
 
 at 
 org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimeLibrary.java:818) 
 
 at 
 org.apache.jasper.runtime.PageContextImpl.include(PageContextImpl.java:390)
 at 
 org.apache.struts.taglib.tiles.InsertTag$InsertHandler.doEndTag(InsertTag.java:757) 
 
 at 
 org.apache.struts.taglib.tiles.InsertTag.doEndTag(InsertTag.java:369)
 at org.apache.jsp.test$jsp._jspService(test$jsp.java:73)
 at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
 at 
 org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:202) 
 
 at 
 org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:382)
 at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:474)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
 [SNIP]
 
 I'm using JBoss 2.4.4 with embedded Tomcat 4.0.1 and using the latest 
 (20020219) nightly build of struts and latest development build of tiles 
 which I downloaded from tiles homepage.
 I have defined the controller as TilesRequestProcessor in 
 struts-config.xml and in web.xml I have ActionComponentServlet as the 
 action component.
 
 Thanks.
 Tuomo
 
 
 -- 
 To unsubscribe, e-mail:   
 mailto:[EMAIL PROTECTED]
 For additional commands, e-mail: 
 mailto:[EMAIL PROTECTED]
 
 




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




Re: Error Messages and tags

2002-02-20 Thread Eddie Fung

Keith,

not sure what you mean here re:

1- Do you mean don't bother using the ApplicationResources.properties and 
just return a String if we want only a single message ?
2- Can you explain how to set a special string for the 1st and last message 
? The errors I have are coming out in FIFO order at the moment (order SEEMS 
to be preserved) . Only with each message preceded by the header and 
followed by a footer..

Eddie
===
At 10:19 PM 20/02/2002, Keith wrote:
1 - There is a new Messages tag in the nightly build. If you only need 1 
mesage
it's easy to code it yourself.
2 - Don't do this - Use a blank string for header/footer  add your errors 
with
a wrapper class that adds a special string for the 1st  last message. The
order of the errors is not preserved (in this release of struts) so you're
header might come out last.

--- Eddie Fung [EMAIL PROTECTED] wrote:
  We have the text for error messages declared in the
  ApplicationResources.properties file as per standard. We have the header
  and footer text as required. Now is it possible to display the error
  messages WITHOUT the header and footer in certain situations ? We'd 
 like to
  re-use the messages and display them on the page without the header and
  footer on a couple of pages. In one case the message is actually a warning
  rather than error and to have the standard header (which indicates an
  error) is a bit misleading.
 
  TIA
 
  Eddie
 
 
  --
  To unsubscribe, 
 e-mail:   mailto:[EMAIL PROTECTED]
  For additional commands, e-mail: 
 mailto:[EMAIL PROTECTED]
 


=
~~
Search the archive:-
http://www.mail-archive.com/struts-user%40jakarta.apache.org/
~~
Keith Bacon - Looking for struts work - South-East UK.
phone UK 07960 011275

__
Do You Yahoo!?
Yahoo! Sports - Coverage of the 2002 Olympic Games
http://sports.yahoo.com

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


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




Re: Night Build stable?

2002-02-20 Thread Ted Husted

The nightly builds represent the ongoing development effort; it is our
actual alpha CVS, there is no other. We try to keep it in a buildable,
usable state, but there can be no guarantees.

The latest builds includes a number of new features which are still
settling in. This includes 

+ the execute signature and declarative exceptions
+ role based security 
+ multiple-configuration support
+ dynabeans

If you are not ready to explore those, then I would suggest trying the
build for 12 Jan, which I tucked away and have been using myself.
(Though now that we have Tiles for the latest 1.1, I can start moving
forward.)

http://husted.com/struts/resources/jakarta-struts-20020112.zip

-- Ted Husted, Husted dot Com, Fairport NY US
-- Developing Java Web Applications with Struts
-- Tel: +1 585 737-3463
- Web: http://husted.com/about/services


Struts Newsgroup (@Basebeans.com) wrote:
 
 Subject: Night Build stable?
 From: Nav Sandhu [EMAIL PROTECTED]
  ===
 I am thinking about updating my Struts from a November 01 nightly build.  I
 am thinking about moving to a more recent nightly build.  Is there anywhere
 I can find out if the nightly build is stable?  Is there any tests that are
 done before the jar files are published?
 
 Thanks,
 Nav Sandhu
 
 --
 To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
 For additional commands, e-mail: mailto:[EMAIL PROTECTED]

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




Re: How do I init a Form bean via business logic?

2002-02-20 Thread kothapallibc

Hi, 

How nice! I've been mulling over this for the last few days and here 
is a chance to discuss it!

Let me try to summarize---
Option1(Struts model):- Controller updates model, retrieves the 
updated data and sets it in Request/Session(which JSPs use to 
generate the HTML). Controllers manage(set/remove data in) Session. 
Here Controllers act as Mediators between View and Model.

Option2(Blueprints model):-Controller updates the model, notifies the 
updated model proxy objects(XXXWebImpl of PetStore that live in web 
tier) and those proxy objects update themselves. JSPs get the data 
from these proxy objects.

In a variation of Option2, notification is not necessary and not all 
proxy objects are in Session. Proxy objects, when created in request 
scope in JSPs, get the data from model(EJBs). Here Controller doesn't 
set any data in Request, but may need to manage Session.

For almost 2 years, I've been a believer of Option1! It's simple, 
works great, Session is maintained thin and View knows nothing about 
Model. Low coupling and it looked great. I was flaming Blueprints 
model in another list and here is the most convincing reason I got in 
favor of Option2 from one Hardy Henneberg ...
Quote
MVC says that views should update themselves. I think the most 
important argument may be, that views are considered the most 
volatile layer and models the most stable. So it is OK for views to 
depend stongly on models, but it is not OK for controllers to depend 
strongly on views, because the frequent changes in the view layer 
would generate changes in the more stable (and often more 
complicated) control layer. In the blueprint architecture this would 
also be the case, if a controller should update the views.
/Quote
That discussion is at 
http://groups.yahoo.com/group/scea_j2ee/message/2829

Recently we implemented a large project for an insurance company 
using a customized Blueprints architecture. The project needs heavy 
design because of the complexity of the system. We went for Option1 
in that. The result is a bloated Controller class. It was difficult 
to divide it into smaller classes because of the system requirements. 
If I look back at the Controller class I very much like Option2! By 
going for Option2, I'm increasing coupling, but my code gets lot 
cleaner and easier to maintain. This kind of coupling is not so 
dangerous, I feel(and recently I was reading Craig Larman who almost 
quotes Hardy).

From my experience, I feel that for small and less complex 
applications, Option1 is fine. But when you are looking at an
application that needs centralized control and where the Controller
is complex by nature, it may be a good idea to go for Option2. 
BTW, our system doesn't have 100s of JSPs. They are just around 30.
But for some insurance products all those screens need to be used in
one user session to complete a single transaction and that involves
lot of business logic too.

Currently I'm playing with the variation of Option2 I mentioned above 
(I still couldn't 100% agree with that Sun's model :-)).

Thanks for reading...hope to see more discussion on this.

Regards,
Choudary.

--- In [EMAIL PROTECTED], Keith [EMAIL PROTECTED] wrote:
 IMHO - MVC means the flow of data between the presentation  
business layers is
 controlled by the controller (a struts Action).
 It's hard to prove this is the best way.  I'm among the many people 
that feel
 struts is designed to help us write well designed MVC apps.
 A formBean is designed to be a utility to simplify/standardise the 
coding for
 passing data between HTML forms  Action classes, it has no 
controller
 functions.
 
 I praise your scepticism!
 In my early days I was sceptical of the amount of extra code 
required to
 seperate the layers cleanly (ie. stop the view going directly to 
the model) but
 I support it now - especially for apps that update data.
 
 In an enquiry only app I think it may be good to combine the view  
controller
 functions into 1 function - only if there is hardly anything for 
the controller
 to do.
 
 A typical app displays some things  updates others, I think it is 
better to
 make all data go through the controller (Action). Form data goes 
via the
 formBean, display only data is placed by the controller (Action) in 
the request
 for the view (jsp) to fetch. This requires slightly more code than 
having the
 jsp fetch data from the model (business layer) or even directly 
from the
 persistence layer (the database).
 But the benefit is the number of different routes of data between 
the view 
 business logic is less  this is highly beneficial for ease of 
maintenance,
 testing etc.
 
 It seems to me a lot of people follow design patterns a bit too 
dogmatically -
 It is good to analyse the cost of using a pattern or framework 
compared to it's
 benefits. Struts is designed for writing dozens or hundreds or more 
jsp's. It
 takes time to learn but is worth it.
 I'd guess your first 5 or 10 pages will take longer but 

Re: Night Build size?

2002-02-20 Thread Ted Husted

Yes, something went awry with the build Monday morning, and the WARs are
not being generated. Hopefully, we can get this fixed before the builds
prior to that roll off the site. 

[EMAIL PROTECTED] wrote:
 
 I notice that the last 2 struts nightly builds (binaries) are about 10th of
 the normal size. This has happened before also.
 
 Neil
 
 --
 To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
 For additional commands, e-mail: mailto:[EMAIL PROTECTED]

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




Re: url to access a struts app

2002-02-20 Thread Edward Q. Bridges

nevermind.  i've now had my coffee, and realized that i didn't put an 
entry in web.xml for the actionservlet.

thanks anyway :)

--e--


On Wed, 20 Feb 2002 12:58:01 +0100, Edward Q. Bridges wrote:

i have a rather simple problem (i think!) . . . 

given an actionmapping like this:
action path=/login
type=contentdb.view.login.Action
name=loginForm
scope=request
validate=true
input=/WEB-INF/jsp/Login.jsp
  forward name=continue path=/WEB-INF/jsp/Login.jsp/
/action
stored in a .war file named ContentDB.war

how would i access that through a web browser after deploy?
(when deployed to JBoss-2.4.3_Jetty-3.1.1-1).

i've tried these urls:
http://localhost:8080/ContentDB/do/login
http://localhost:8080/ContentDB/login
http://localhost:8080/do/login
http://localhost:8080/login
all to no avail.

when accessing the url:
http://localhost:8080/ContentDBView/
it shows a dir listing for META-INF and WEB-INF (i.e. it was properly 
deployed).

please find a jar tf listing of the war file is below.

thanks in advance

--e--


META-INF/
META-INF/MANIFEST.MF
WEB-INF/
WEB-INF/classes/
WEB-INF/classes/contentdb/
WEB-INF/classes/contentdb/view/
WEB-INF/classes/contentdb/view/base/
WEB-INF/classes/contentdb/view/login/
WEB-INF/classes/contentdb/view/base/ActionBase.class
WEB-INF/classes/contentdb/view/login/Action.class
WEB-INF/classes/contentdb/view/login/Form.class
WEB-INF/lib/
WEB-INF/lib/servlet.jar
WEB-INF/lib/struts.jar
WEB-INF/dtd/
WEB-INF/dtd/ant-project-ext.dtd
WEB-INF/dtd/ant-project.dtd
WEB-INF/dtd/struts-config_1_0.dtd
WEB-INF/dtd/tld-1.1.dtd
WEB-INF/dtd/tld-1.2.dtd
WEB-INF/dtd/web-app_2_2.dtd
WEB-INF/dtd/web-app_2_3.dtd
WEB-INF/struts-config.xml
WEB-INF/tld/
WEB-INF/tld/struts-bean.tld
WEB-INF/tld/struts-form.tld
WEB-INF/tld/struts-html.tld
WEB-INF/tld/struts-logic.tld
WEB-INF/tld/struts-template.tld
WEB-INF/jsp/
WEB-INF/jsp/Login.jsp
WEB-INF/web.xml




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




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




Re: url to access a struts app

2002-02-20 Thread Keith

Hi Edward,
You haven't said what error message you got!
try
http://localhost:8080/ContentDB/login.do
(add .do to the end).

name=loginForm
implies your form bean is called LoginForm.class it's called Form.class

Also I'd name the action as loginAction not just Action.

Ask again if this is no help.


--- Edward Q. Bridges [EMAIL PROTECTED] wrote:
 i have a rather simple problem (i think!) . . . 
 
 given an actionmapping like this:
 action path=/login
 type=contentdb.view.login.Action
 name=loginForm
 scope=request
 validate=true
 input=/WEB-INF/jsp/Login.jsp
   forward name=continue path=/WEB-INF/jsp/Login.jsp/
 /action
 stored in a .war file named ContentDB.war
 
 how would i access that through a web browser after deploy?
 (when deployed to JBoss-2.4.3_Jetty-3.1.1-1).
 
 i've tried these urls:
 http://localhost:8080/ContentDB/do/login
 http://localhost:8080/ContentDB/login
 http://localhost:8080/do/login
 http://localhost:8080/login
 all to no avail.
 
 when accessing the url:
 http://localhost:8080/ContentDBView/
 it shows a dir listing for META-INF and WEB-INF (i.e. it was properly
 deployed).
 
 please find a jar tf listing of the war file is below.
 
 thanks in advance
 
 --e--
 
 
 META-INF/
 META-INF/MANIFEST.MF
 WEB-INF/
 WEB-INF/classes/
 WEB-INF/classes/contentdb/
 WEB-INF/classes/contentdb/view/
 WEB-INF/classes/contentdb/view/base/
 WEB-INF/classes/contentdb/view/login/
 WEB-INF/classes/contentdb/view/base/ActionBase.class
 WEB-INF/classes/contentdb/view/login/Action.class
 WEB-INF/classes/contentdb/view/login/Form.class
 WEB-INF/lib/
 WEB-INF/lib/servlet.jar
 WEB-INF/lib/struts.jar
 WEB-INF/dtd/
 WEB-INF/dtd/ant-project-ext.dtd
 WEB-INF/dtd/ant-project.dtd
 WEB-INF/dtd/struts-config_1_0.dtd
 WEB-INF/dtd/tld-1.1.dtd
 WEB-INF/dtd/tld-1.2.dtd
 WEB-INF/dtd/web-app_2_2.dtd
 WEB-INF/dtd/web-app_2_3.dtd
 WEB-INF/struts-config.xml
 WEB-INF/tld/
 WEB-INF/tld/struts-bean.tld
 WEB-INF/tld/struts-form.tld
 WEB-INF/tld/struts-html.tld
 WEB-INF/tld/struts-logic.tld
 WEB-INF/tld/struts-template.tld
 WEB-INF/jsp/
 WEB-INF/jsp/Login.jsp
 WEB-INF/web.xml
 
 
 
 
 --
 To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
 For additional commands, e-mail: mailto:[EMAIL PROTECTED]
 


=
~~
Search the archive:-
http://www.mail-archive.com/struts-user%40jakarta.apache.org/
~~
Keith Bacon - Looking for struts work - South-East UK.
phone UK 07960 011275

__
Do You Yahoo!?
Yahoo! Sports - Coverage of the 2002 Olympic Games
http://sports.yahoo.com

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




Re: Night Build size?

2002-02-20 Thread Neil McBennett

Oh so is it just the example stuff that is missing? If so then it should
still be ok to use right?

/Neil

 Yes, something went awry with the build Monday morning, and the WARs
 are not being generated. Hopefully, we can get this fixed before the
 builds prior to that roll off the site.

 [EMAIL PROTECTED] wrote:

 I notice that the last 2 struts nightly builds (binaries) are about
 10th of the normal size. This has happened before also.

 Neil

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

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




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




Re: My problems with Struts...

2002-02-20 Thread Ted Husted

Yes, it's very true that Struts does not do anything you could not do
for yourself. The point is that with Struts, you do not have to do it
yourself. It's already been done, documented, and put into production.
Not just by your team, but by hundreds of teams. 

Since the framework is closely aligned with published specifications and
standard components, it is also very easy to swap in your own code
wherever needed.

Many people use the Struts controller and completely ignore the JSP tag
extensions, substituting XLST, Velocity templates, or some other
presentation layer. 

If the Struts ActionForm doesn't serve your every need, the request and
response are provided to the Action, and you can do whatever you want in
any way you want. 

If you need to go to another servlet for something, and don't even need
an Action, go for it. Any URI will do. 

The real question is whether you want to use the Struts configuration
and Actions (at least some of the time). If so, there's no downside in
using Struts in your application. Every option you had before is still
an option, and you gain a great front controller that your application
can use as needed.

-- Ted Husted, Husted dot Com, Fairport NY US
-- Developing Java Web Applications with Struts
-- Tel: +1 585 737-3463
-- Web: http://husted.com/about/services


kothapallibc wrote:
 
 Hi,
 
 I'm a newbie to Struts and trying to fit it into an application
 that's modeled after Blueprints. I feel frustrated at many
 places...It could be just that I don't understand Struts properly
 yet.I feel like just using the classes that I like and leaving those
 features I don't prefer.
 
 I agree that it provides a nice working framework, but I find too
 many limitations...
 
 1.Struts automatically read your form data into request/session scope
 as specified in struts-config.xml.
 
 My problems with this are
 
 Firstly, I need to transform the data types other than Strings.
 And then it gets funny when using arrays...
 If you have a 'String[] str', you don't have to initialize it in your
 form bean.
 But if you have an object array like 'Monkey[] monkeys', you need to
 initilize it in the form bean, or else it throws NullPointerException.
 How am I supposed to know the number of 'monkeys' the user wants to
 key in?
 
 One more thing is, for 'String[] str', the HTML parameter names
 should be just 'str'. All the parameters with the same name will
 be read into 'str[]'.
 
 But with 'Monkey[] monkeys', the parameter names should have the index
 like 'monkey[0].name','monkey[1].name' etc.
 Why is it so? And this indexed naming makes the javascript difficult
 to code and read.
 
 With such problems with transformation and nested bean arrays, I feel
 like reading the HTML data on my own. I fail to see how this feature
 adds much value.
 
 2.Provides form validation.
 
 This is a good feature to have, but anyway, generally we push as much
 validation as we can into Javascript and if there are any real
 business validation to be done, I'd prefer doing it in  business tier
 rather than in Form bean.
 
 Again it adds value, but in a large application, I don't feel it is
 that much.
 
 3.Internationalization - again good, but it's not that difficult to
 implement on our own.
 
 4.Tag libraries - I never really used tag libraries in JSPs, so
 cannot comment on the usefulness of them. Do people find the tag
 libraries so useful? I want to know where this feature stands the
 list of good things about struts.
 
 There seem to be many experienced Struts users on this list. Could
 you please tell me the features you find very useful and the kind of
 applications you are building using them? And if I'm missing
 something badly in my understanding?
 
 Regards,
 Choudary.
 
 
 
 --
 To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
 For additional commands, e-mail: mailto:[EMAIL PROTECTED]

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




Struts vs Template Engine or Both

2002-02-20 Thread Crazy Dave

Hi, 

I'm a new JSP developer (previously been working with
SilverStream pages).

I've been working with Tomcat 4  Struts and find
JSP's to be a little clumsy with the mixing of script
code and html but I am persevering because developing
my JSP skills is the best way to remain employable.

I read a little about templete engines
(velocity/turbine) but don't wish to change to them
just yet as most potential employers are sold on JSP.

I was wondering is it easy to use a combination of
JSP/Struts with a template engine and if so are there
benifits or should I really only pick one or the
other.

Is there any performance issues JSP vs Templates.

Any constructive comments on these points or related
would be appreciated.

Cheers David Cruwys ([EMAIL PROTECTED])

__
Do You Yahoo!?
Yahoo! Sports - Coverage of the 2002 Olympic Games
http://sports.yahoo.com

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




Re: where is my commom-*.jar

2002-02-20 Thread Andrew . Goodnough


Commons jars must have been included with the Struts dist previously but
you can find what you are looking for here:

http://jakarta.apache.org/commons/index.html

I needed the BeanUtils and Collections jars to get started.


Andy


Andrew Goodnough
Dana Commercial Credit
Programmer
(419) 891-2065


   
 
Struts 
 
NewsgroupTo: [EMAIL PROTECTED]
 
(@Basebeans.ccc:   
 
om) struts  Subject: where is my commom-*.jar   
 
   
 
02/20/2002 
 
01:55 AM   
 
Please 
 
respond to 
 
Struts Users  
 
Mailing List  
 
   
 
   
 



Subject: where is my commom-*.jar
From: zb cong [EMAIL PROTECTED]
 ===
hello
in jakarta's tutorial,it say that there a file called commons-*.jar under
the WEB-INF/lib,but in my download bundle,there are only struts.jar and
jdbc2_0-stdext.jar,why?

thank you!



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






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




Re: My problems with Struts...

2002-02-20 Thread Arron Bates

Looking at a Struts app, the code that is outside of Struts itself 
you'll find is only the parts of the app that the Struts developers 
couldn't do for you, all split into nice little managable nuggets.

Business and controlling logic being fired out of the Struts actions, 
and the views to match the models defined by your form beans. Quite tidy.

In reply to the array issues. This is all part of managing your model. 
Arrays and beans are populated according to your business logic, and the 
JSP view presents it. If you have to be ready for a zero length array, 
then you have to handle it in the view markup.

As for the indexed properties... there's no other way to single out a 
reference in a list. More often than not it wont even be a factor. I've 
also written an app where all validation is client-side in JavaScript. 
It's just that the name of the field is specified for you, rather than 
picking names yourself. The truly awesome upshot of this is that you 
don't have to write any server side population logic yourself.

Mid last year I was overhearing people going on about tag libraries and 
so forth and was thinking about why you'd ever want write another tag 
that actually writes out a tag and all such stuff. Moved onto Struts and 
well, I'm not going back. Allows you to write apps faster and cleaner, 
as well as making them easier to manage.

As for who's using it... well, there's the resources link on the struts 
site that lists some. I've been working for Zurich Financial Services 
for 7 months (I'm sure there's teams using Struts with lower numbers in 
the global fortune500 than 97. A developer on a project from Ford gave 
feedback on the nested tags the other day and they're 4th...) and all 
apps written last year and from here in will be Struts powered. And they 
were early adopters. Struts has become much more powerful since then. In 
fact, there's now solutions in Struts itself which covers all the custom 
extensions they felt they had to write themselves. It's becomming more 
and more complete as the project goes on.

Last spiel... the nested tag examples (MonkeyStruts) are only arranged 
to show their ability, not to exemplify the model management itself. Ted 
Husted has a great page of recommended methodologies which will spiel on 
about how to go about the best way to code the MVC paradigm.
Because you picked on my monkey example, I just had to make comment. :)

Well, that's enough of a spiel.

Arron.

Kothapalli Basavaiah Choudary wrote:

Hi, 
I'm a newbie to Struts and trying to fit it into an application that's
modeled after Blueprints. I feel frustrated at many places...It could
be just that I don't understand Struts properly yet.I feel like just 
using the classes that I like and leaving those features I don't prefer.

I agree that it provides a nice working framework, but I find too many
limitations...

1.Struts automatically read your form data into request/session scope
as specified in struts-config.xml.

My problems with this are
   I need to transform the data types other than Strings.
   And it gets funny when using arrays...
   If you have a 'String[] str', you don't have to initialize it in
your form bean.
   But if you have an object array like 'Monkey[] monkeys', you
need to initilize
   it in the form bean, or else it throws NullPointerException.
   How am I supposed to know the number of 'monkeys' the user wants
to
   key in?
   
   One more thing is, for 'String[] str', the HTML parameter names
   should be just 'str'. All the parameters with the same name will
   be read into 'str[]'.
   But with 'Monkey[] monkeys', the parameter names should have the
index
   like 'monkey[0].name','monkey[1].name' etc. 
   Why is it so? And this indexed naming makes the javascript
difficult
   to code and read.
   
With such problems with transformation and nested bean arrays, I feel
like
reading the HTML data on my own. I fail to see how this feature adds
much
value.

2.Provides form validation. 

This is a good feature to have, but anyway, generally we push as much
validation as we can into Javascript and if there are any real business
validation to be done, I'd prefer doing it in  business tier rather
than in Form bean.

Again it adds value, but in a large application, I don't feel it is
that much.

3.Internationalization - again good, but it's not that difficult to
implement on our own.

4.Tag libraries - I never really used tag libraries in JSPs, so cannot
comment on the usefulness of them. Do people find the tag libraries
so useful? I want to know where this feature stands the list of 
good things about struts.

There seem to be many experienced Struts users on this list. Could you
please tell me the features you find very useful and the kind of
applications
you are building using them? And if I'm missing something in my
understanding?

Regards,
Choudary.

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

the nightly build problem

2002-02-20 Thread Christopher Cheng

I got the nightly build from Apache.
Using the new iterate tag with indexed, I am able to put the form
values on the page with get, but set doesn't seem to work with second
level form beans

logic:iterate name=form1 property=object1.object2
html:text name=object2 property=property1 indexed=true
/logic:iterate

Looking at the source from IE, it generates something like
input type=text name=object2[0].property1 value=
input type=text name=object2[1].property1 value=
input type=text name=object2[2].property1 value=
...

Of course object2 is in object1, not in form1. That's why it doesn't
work.

Is there anyway to work around?


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




Class reloading error in Tomcat on Sun Solaris

2002-02-20 Thread @Basebeans.com

Subject: Class reloading error in Tomcat on Sun Solaris
From: Denis A.Vishniakov [EMAIL PROTECTED]
 ===

  Hello!

  I try to use Tomcat 4.0.2 with Struts 1.0.2 on Sun Solaris. After I upload
new Form class or Action class (without tomcat shutdowning) the errore
occure: javax.servlet.ServletException: Parsing error processing resource
path /WEB-INF/struts-config.xml or javax.servlet.ServletException: Cannot
find ActionMappings or ActionFormBeans collection or so on.
  Reloading of application, Start/Stop of application, Removing/Deploing of
application affect no results.

  This problem no appeare on Windows NT 4.0.

  Can You help me?

  WBR, Denis A.Vishniakov.



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




How can I register a DTD in a war or jar

2002-02-20 Thread Benoit Segaert

I want to validate a XML with a DTD in a War application.
I have my DTD available in the war file (or in a jar).

I use a XML file like the following:

?xml version=1.0 encoding=ISO-8859-1 ?
!DOCTYPE Application SYSTEM
file:///C:/java/jakarta-tomcat-4.0.1/webapps/myapplication/WEB-INF/Ldap
Framework.dtd

Application
...

But I want to register my DTD in Tomcat for the using of the following
XML header

 ?xml version=1.0 encoding=ISO-8859-1 ?
 !DOCTYPE Application PUBLIC
   -//Uniway Belgium//DTD Application Configuration 1.0//EN
  http://www.uniway.be/application/dtds/application_1_0.dtd;
 Application
 ...

How can I explain to Servlet Engine (Tomcat) the mapping between this
header 
and the real place of the DTD in the War or Jar?

When I use Struts in my application, I have the struts-config file
  ?xml version=1.0 encoding=ISO-8859-1 ?

  !DOCTYPE struts-config PUBLIC
  -//Apache Software Foundation//DTD Struts Configuration
1.0//EN
  http://jakarta.apache.org/struts/dtds/struts-config_1_0.dtd;
  struts-config

If I look the Tomcat log I can see:

  register('-//Apache Software Foundation//DTD Struts Configuration
1.0//EN',
  'jar:file:C:/java/jakarta-tomcat-4.0.1/webapps/strutsjndi/WEB-INF/
  lib/struts.jar!/org/apache/struts/resources/struts-config_1_0.dtd'

The struts.jar contains the dtd and the the xml file refers to the
following
web file:
http://jakarta.apache.org/struts/dtds/struts-config_1_0.dtd;


I want to reproduce this configuration. 
How can I explain this mapping to the xml parser or servlet engine?


Benoit

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




Re: Error Messages and tags

2002-02-20 Thread Keith

1 - I do mean use ApplicationResources. You can look a message up from an
Action as desribed here:-
http://www.mail-archive.com/struts-user@jakarta.apache.org/msg21986.html
Then use
logic:present name=warningMessage scope=request
   font color=blue size=+1Your request has been accepted but with the
following warning/font
  bean:write name=warningMessage scope=request /
/logic:present
to display it.

With similar but more code you can set up an ArrayList or TreeMap(?) of
messages.

2 - Order is preserved in the later version of Struts. Not sure when it
changed. but must be diff. from release version  the nightly builds. So now
you can have in ApplicationResources.properties an 'error'
common.warning.header=font color=blue size=+1Your request has been
accepted but with the following warning()s/font
 add that before you add your message(s) to ActionErrrors.

Personally I hate this sort of thing! In the world of business software
functionality is worth spending money on not flashness (often not always).

I'd say do it with just 1 message or use the new Messages tag.



--- Eddie Fung [EMAIL PROTECTED] wrote:
 Keith,
 
 not sure what you mean here re:
 
 1- Do you mean don't bother using the ApplicationResources.properties and 
 just return a String if we want only a single message ?
 2- Can you explain how to set a special string for the 1st and last message 
 ? The errors I have are coming out in FIFO order at the moment (order SEEMS 
 to be preserved) . Only with each message preceded by the header and 
 followed by a footer..
 
 Eddie
 ===
 At 10:19 PM 20/02/2002, Keith wrote:
 1 - There is a new Messages tag in the nightly build. If you only need 1 
 mesage
 it's easy to code it yourself.
 2 - Don't do this - Use a blank string for header/footer  add your errors 
 with
 a wrapper class that adds a special string for the 1st  last message. The
 order of the errors is not preserved (in this release of struts) so you're
 header might come out last.
 
 --- Eddie Fung [EMAIL PROTECTED] wrote:
   We have the text for error messages declared in the
   ApplicationResources.properties file as per standard. We have the header
   and footer text as required. Now is it possible to display the error
   messages WITHOUT the header and footer in certain situations ? We'd 
  like to
   re-use the messages and display them on the page without the header and
   footer on a couple of pages. In one case the message is actually a
 warning
   rather than error and to have the standard header (which indicates an
   error) is a bit misleading.
  
   TIA
  
   Eddie
  
  
   --
   To unsubscribe, 
  e-mail:   mailto:[EMAIL PROTECTED]
   For additional commands, e-mail: 
  mailto:[EMAIL PROTECTED]
  
 
 
 =
 ~~
 Search the archive:-
 http://www.mail-archive.com/struts-user%40jakarta.apache.org/
 ~~
 Keith Bacon - Looking for struts work - South-East UK.
 phone UK 07960 011275
 
 __
 Do You Yahoo!?
 Yahoo! Sports - Coverage of the 2002 Olympic Games
 http://sports.yahoo.com
 
 --
 To unsubscribe, e-mail:  
 mailto:[EMAIL PROTECTED]
 For additional commands, e-mail:
 mailto:[EMAIL PROTECTED]
 
 
 --
 To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
 For additional commands, e-mail: mailto:[EMAIL PROTECTED]
 


=
~~
Search the archive:-
http://www.mail-archive.com/struts-user%40jakarta.apache.org/
~~
Keith Bacon - Looking for struts work - South-East UK.
phone UK 07960 011275

__
Do You Yahoo!?
Yahoo! Sports - Coverage of the 2002 Olympic Games
http://sports.yahoo.com

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




Re: Why don't tiles cascade?

2002-02-20 Thread Jim Crossley

Hi Cedric

Cedric Dumoulin [EMAIL PROTECTED] writes:

 It is an expected behavior ! Tiles can be seen like functions : they
 takes parameters, and parameters are only visible inside the
 function, not outside, neither in called functions.

[...]

I agree the potential naming conflicts could be a problem, but at
least they can be reasonably well managed in one place:  the
definitions file.  How about a compromise?

 If you want to use an attribute value inside another inserted Tile, you have to
 pass it explicitly. In your example, you could write something like :

Instead of this...

 tiles:insert path=/header.jsp
   put beanName=title beanScope=template /
 /tiles:insert

Maybe this?

  tiles:insert path=/header.jsp export=true/

An export attribute with a value of true would essentially cause the
tile to inherit the context of its parent[s].

 Reading your example, I think you should better not cut a tag into
 two separate files (body and /body). Putting a start and end tag
 in the same file improve legibility, and minimize potential errors
 (forget the closing tags, forget to insert the corresponding file,
 ...).

You're right: it did hurt to separate the begin/end tags into two
files, but we have fairly complex body and div tags replicated in
multiple layout (and non-layout) HTML files.  For example, would you
want to have to maintain the following muck in multiple files?

body leftmargin=0 topmargin=0 bgproperties=fixed 
  background=%=request.getContextPath()%bean:message key='image.background'/
  onload=javascript:motd();
  bgcolor=bean:message key='html.bgcolor'/

BTW, please don't misunderstand my feedback on this forum.  Tiles is
wonderful, and we're using it quite happily.  The fact that it allows
me to replace a JSP file with a definition tag in a config file is a
beautiful thing.  It's such a beautiful thing that I want to do it
even for files beneath the top tier of defined tiles.

-- Jim

 
   Cedric
 
 Jim Crossley wrote:
 
  Apparently it's not possible to access attributes of any tiles other
  than your immediate parent.  IMHO, this restricts my ability to
  partition my presentation code into simple, reusable chunks.
 
  Here's a semi-practical example.
 
  Consider this snippet from a definitions file...
 
definition name=training path=/layout.jsp
  put name=content value=/training.jsp/
  put name=title   value=Training/
/definition
 
  layout.jsp
  -- CUT --
  tiles:insert path=/header.jsp/
  tiles:insert attribute=content/
  tiles:insert path=/footer.jsp/
  -- CUT --
 
  header.jsp
  -- CUT --
  html
head
  titletiles:getAsString name=title//title
/head
body
  -- CUT --
 
  footer.jsp
  -- CUT --
/body
  /html
  -- CUT --
 
  The above example, as simple as it is, won't work, because header.jsp
  can't find the attribute named title.
 
  Have I completely misunderstood the intent behind Tiles, or is it
  simply not quite ready for prime time?  Is there a better (simpler)
  approach than the one taken in the above example?
 
  -- Jim
 
  --
  To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
  For additional commands, e-mail: mailto:[EMAIL PROTECTED]
 
 
 --
 To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
 For additional commands, e-mail: mailto:[EMAIL PROTECTED]

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




Re: form looses valuse when validation maps back

2002-02-20 Thread Keith

did you search the archive? you should be able to find the solution there.

--- Oliver_Reflé [EMAIL PROTECTED] wrote:
 Hello All,
 i have for me a real strange problem. When i validate my form and there are
 missing
 fields then it is mapped back to the input page. All the error messages are
 shown correctly.
 The only thing is that my form is empty and the user has to reenter all
 values,  which is
 really annoying.
 
 This is my entry in the struts-config.xml
 
 action path=/admin/createCompany
 
 type=com.transwide.services.uma.web.action.admin.CreateCompanyAction
 name=companyForm
 scope=session
 input=/uma/admin/create-company-step1.jsp
 validate=false
   forward name=success
path=/uma/admin/create-company-step2.jsp
   /forward
   forward name=failure
path=/uma/admin/failure.jsp
   /forward
 /action
 
 The validation is done in the action class(business reason), but i tried it
 also in the Form which
 makes no difference. Here is part of my Action which handles the validation
 
 ActionErrors errors = new ActionErrors();
 
 try{
 
 CompanyForm companyForm = (CompanyForm)form;
 
 // some validations
 if (companyForm.getAccountName()==null ||
 StringUtils.isEmpty(companyForm.getAccountName())) {
 errors.add(accountname, new
 ActionError(error.accountname));
 }
 if (companyForm.getCompanyName()==null ||
 StringUtils.isEmpty(companyForm.getCompanyName())) {
 errors.add(companyname, new
 ActionError(error.companyname));
 }
 if (companyForm.getPrefix()==null ||
 StringUtils.isEmpty(companyForm.getPrefix())) {
 errors.add(prefixlength, new ActionError(error.prefix));
 } else if (companyForm.getPrefix().length() != 3) {
 errors.add(prefixlength, new
 ActionError(error.prefixlength));
 }
 if(companyForm.getCompanyTypes()==null ||
 StringUtils.isEmpty(companyForm.getCompanyTypes())) {
 errors.add(companytypes, new
 ActionError(error.companytypes));
 }
 if(companyForm.getVatNumber()==null ||
 StringUtils.isEmpty(companyForm.getVatNumber())) {
 errors.add(vatnumber, new ActionError(error.vatnumber));
 }
 if (!errors.empty()) {
 saveErrors(request, errors);
 return (new ActionForward(mapping.getInput()));
 }
 
 I can take the form data out of the session with a scriptlet and display the
 values, but
 struts don't fills out the form automaticly. First thing i took a look on
 it, that i maybe
 configured the scope of the form incorrect and when mapping back to input he
 trys to generate
 a new form which is only stored in the request. But there all settings seem
 to be correct.
 
 Any idea ??
 
 oliver
 
 
 --
 To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
 For additional commands, e-mail: mailto:[EMAIL PROTECTED]
 


=
~~
Search the archive:-
http://www.mail-archive.com/struts-user%40jakarta.apache.org/
~~
Keith Bacon - Looking for struts work - South-East UK.
phone UK 07960 011275

__
Do You Yahoo!?
Yahoo! Sports - Coverage of the 2002 Olympic Games
http://sports.yahoo.com

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




RE: \No getter method\ error when using Bean:Write

2002-02-20 Thread Yu, Yanhui

Matt,

It seems to me that you have case wrong for userId.  Could you make a small
change, then retry it?  Change the following lines
bean:write name=testMatt property=id /
bean:write name=testMatt property=UserId /
to the following lines:
bean:write name=testMatt property=id /
bean:write name=testMatt property=userId /

Thanks,
Yanhui Yu
=
Information Management
Pioneer Hi-Bred International, Inc
515-253-2122

-Original Message-
From: Matt Petteys [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, February 19, 2002 5:12 AM
To: [EMAIL PROTECTED]
Subject: \No getter method\ error when using Bean:Write



Can someone point out what I am doing wrong here..  Or is this some kind of 
bug??

In my JSP, this code fragement works fine..

jsp:useBean id=testMatt class=test.WebForm scope=session /
%= testMatt.getId() %br
%= testMatt.getUserId() %br

But when I try to use the following code fragement it blows up on the 
property UserId.  If i remove that UserId property, the id property is

retrieved fine.

bean:write name=testMatt property=id /
bean:write name=testMatt property=UserId /

The bean seems to be declared correct for UserId..

...snip...

public java.lang.String getUserId()
{
return this.userId;
}

public void setUserId( java.lang.String userId )
{
this.userId = userId;
}

..snip..

Here is the error message, running tomcat in the NetBeans IDE 3.3.1 (3.x?)
with 
a struts.jar, rel 1.02.  Any ideas?

javax.servlet.jsp.JspException: No getter method for property UserId of bean

testMatt
at org.apache.struts.taglib.template.InsertTag.doEndTag
(InsertTag.java:149)
at 
WEB_0002dINF.templates._0002fWEB_0002dINF_0002ftemplates_0002fsecure_0002ejs
psec
ure_jsp_0._jspService
(_0002fWEB_0002dINF_0002ftemplates_0002fsecure_0002ejspsecure_jsp_0.java:118
)
at
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:119)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service
(JspServlet.java:177)
at org.apache.jasper.servlet.JspServlet.serviceJspFile
(JspServlet.java:318)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:391)
at org.netbeans.modules.web.tomcat.JspServlet.service
(JspServlet.java:91)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.tomcat.core.ServletWrapper.doService
(ServletWrapper.java:404)
at org.apache.tomcat.core.Handler.service(Handler.java:286)
at org.apache.tomcat.core.ServletWrapper.service
(ServletWrapper.java:372)
at org.apache.tomcat.facade.RequestDispatcherImpl.forward
(RequestDispatcherImpl.java:194)
at org.apache.struts.action.ActionServlet.processActionForward
(ActionServlet.java:1692)
at org.apache.struts.action.ActionServlet.process
(ActionServlet.java:1529)
at
org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:487)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.tomcat.core.ServletWrapper.doService
(ServletWrapper.java:404)
at org.apache.tomcat.core.Handler.service(Handler.java:286)
at org.apache.tomcat.core.ServletWrapper.service
(ServletWrapper.java:372)
at org.apache.tomcat.core.ContextManager.internalService
(ContextManager.java:797)
at org.apache.tomcat.core.ContextManager.service
(ContextManager.java:743)
at 
org.apache.tomcat.service.http.HttpConnectionHandler.processConnection
(HttpConnectionHandler.java:210)
at org.apache.tomcat.service.TcpWorkerThread.runIt
(PoolTcpEndpoint.java:416)
at org.apache.tomcat.util.ThreadPool$ControlRunnable.run
(ThreadPool.java:498)
at java.lang.Thread.run(Thread.java:484)



-
This mail sent through IMP: http://horde.org/imp/

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




RE: ActionForm Defaults/Updates Question

2002-02-20 Thread Dua, Amit

Hi
I tried doing the same.

but when there is an error in the page , it does not retreive the values
from the form bean.
I am validating in action class for all type of errors.

Amit


-Original Message-
From: Jakkampudi, ChandraseKhar [mailto:[EMAIL PROTECTED]]
Sent: Thursday, February 14, 2002 8:44 PM
To: 'Struts Users Mailing List'
Subject: RE: ActionForm Defaults/Updates Question


Here is what I do. 

User (Generic Value Object)
UserBean (Extends form bean)

On initial page we have a link to viewUser.do?userId=100
In the Action class correspoding to viewUser.do, in the perform method we
have (maybe through an controller or some such)

User newUser = userDAO.getUserDetails(100);
request.setAttribute(user, User);
mapping.findForward(user.jsp);

In the user.jsp page,
User user = (User)request.getAttribute(user); Use taglibs for this
html:form action=modifyUser.do
html:text property=userName value=%=user.getUserName()%/
html:text property=city value=%=user.getCity()%/
..
..
/html:form


-JC

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Thursday, February 14, 2002 6:52 PM
To: Struts Users Mailing List
Cc: [EMAIL PROTECTED]
Subject: Re: ActionForm Defaults/Updates Question



  In the end, I've just grabbed the Form bean from the pageContext

Pardon my ignorance but can you tell me the syntax in your JSP page to do
just that above?I think I'll need to be doing the same thing.

thanks,
Theron



 

Mark Woon

[EMAIL PROTECTED]To: Struts Users Mailing
List [EMAIL PROTECTED]
nford.EDU   cc:

 Subject: Re: ActionForm
Defaults/Updates Question 
02/14/02 02:22 PM

Please respond to

Struts Users

Mailing List

 

 




[EMAIL PROTECTED] wrote:

 1. What is the best way to load default values into an ActionForm bean
that
 will show up the first time a user visits the site and pulls up a jsp
page?

You know, this question has come up a bunch of times, but I've never seen
any
good responses.

If I've got a form in which users enter contact information, the first time
the
user sees it, I'd like to set the default values for the form to whatever I
know
about the user.

Since I already have a User object, I would think that the best place to do
this
would be in the reset() method of the ActionForm, but there's no way to
pass the
ActionForm the User object (or any information that's not part of the
form)!  In
the end, I've just grabbed the Form bean from the pageContext and called a
setUser() method so that the reset() method will have something to pull
data
from.

Am I missing something?  Is there a better way to do this?

Thanks,
-Mark


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




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

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

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




custom taglib - call tag within tag

2002-02-20 Thread Arik Levin ( Tikal )

Hi.
 
I wanted to know if there's a possibility to call a tag within a
tag and I don't mean by that to extend my tag and use findAncestorWithClass
Or use the scope or something like that. 
 
Say I have some Test1Tag and  Test2Tag
 
Public Test1Tag extends TagSupport{
 
doStartTag(){
 
Test2Tag  test  = new Test2Tag();
test.doStartTag();
}
 
Is it possible, and what method should I call, that I'll get the
result as I'm getting it from calling a regular JSP's tag?
 
Thank you all, bye.



AW: custom taglib - call tag within tag

2002-02-20 Thread Oliver Reflé

i don't understand the question, why don't you write in your jsp
tag1
tag2/
/tag1

-Ursprüngliche Nachricht-
Von: Arik Levin ( Tikal ) [mailto:[EMAIL PROTECTED]]
Gesendet: Mittwoch, 20. Februar 2002 15:44
An: 'Struts Users Mailing List'
Betreff: custom taglib - call tag within tag


Hi.

I wanted to know if there's a possibility to call a tag within a
tag and I don't mean by that to extend my tag and use findAncestorWithClass
Or use the scope or something like that.

Say I have some Test1Tag and  Test2Tag

Public Test1Tag extends TagSupport{

doStartTag(){

Test2Tag  test  = new Test2Tag();
test.doStartTag();
}

Is it possible, and what method should I call, that I'll get the
result as I'm getting it from calling a regular JSP's tag?

Thank you all, bye.


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




RE: sessions

2002-02-20 Thread Bill Page

thanks for the response.

I couldn't find it in the archives either.  I'm pretty new to the server
side java (been client side for the last 5 years), servlets and all that so
I may have some basic misunderstandings.  It looks to me like any anchors in
the HTML result will need to have encodeURL or encodeRedirectURL applied to
them.  Looking at the struts code the ActionServlet, it looks like struts
appends the session only if the redirect flag is on.  I may also not
understand the definition of URL rewriting here, but can not find a
definition.  

If I'm always forwarding through struts using say success and failure how
would I know to do anything?  As I see it the beauty of the forwarding
mechanism is that I don't have to know the destination in the action
subclass.  Yet if I'm understanding this, I'll lose the session id.  I seem
to keep it if I always set the redirect flag in the forward class, but I'm
suspicious that that is not the correct way.

To further complicate this, we're using a menu program to generate the
javascript for a horizontal menu at the top.  Looks like (and what I'm in
the middle of doing now) I'll need to manually append ;jsessionid= in
a javascript function and then do a location=.  As we're both invoking jsp
and *.do actions, I'm parsing to figure out whether to append the session
or not.

If I'm going through a lot of work for something that should be done another
way, I'd love to know.  



 -Original Message-
 From: Keith [mailto:[EMAIL PROTECTED]]
 Sent: Wednesday, February 20, 2002 6:14 AM
 To: Struts Users Mailing List
 Subject: Re: sessions
 
 
 Hi Bill,
 This has been answered but I couldn't find the answer in the archive!
 I'm not the expert here but - it's when a new session is created.
 Struts doesn't know if the browser accepts cookies (where the 
 session id is to
 be stored) so puts it in the URL (URL re-writing). On the 
 next request struts
 knows the cookie is accepted so doesn't need to put the 
 sessionId inthe URL.
 So every time you see that it's the symptom of a new session 
 being created - no
 the cause.
 

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




RE: form looses valuse when validation maps back

2002-02-20 Thread Yu, Yanhui

Hi,

Could you try to specify  validate=true in the struts-config.xml instead?

Yanhui Yu






-Original Message-
From: Oliver Reflé [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, February 20, 2002 3:22 AM
To: Struts-User
Subject: form looses valuse when validation maps back


Hello All,
i have for me a real strange problem. When i validate my form and there are
missing
fields then it is mapped back to the input page. All the error messages are
shown correctly.
The only thing is that my form is empty and the user has to reenter all
values,  which is
really annoying.

This is my entry in the struts-config.xml

action path=/admin/createCompany

type=com.transwide.services.uma.web.action.admin.CreateCompanyAction
name=companyForm
scope=session
input=/uma/admin/create-company-step1.jsp
validate=false
  forward name=success
   path=/uma/admin/create-company-step2.jsp
  /forward
  forward name=failure
   path=/uma/admin/failure.jsp
  /forward
/action

The validation is done in the action class(business reason), but i tried it
also in the Form which
makes no difference. Here is part of my Action which handles the validation

ActionErrors errors = new ActionErrors();

try{

CompanyForm companyForm = (CompanyForm)form;

// some validations
if (companyForm.getAccountName()==null ||
StringUtils.isEmpty(companyForm.getAccountName())) {
errors.add(accountname, new
ActionError(error.accountname));
}
if (companyForm.getCompanyName()==null ||
StringUtils.isEmpty(companyForm.getCompanyName())) {
errors.add(companyname, new
ActionError(error.companyname));
}
if (companyForm.getPrefix()==null ||
StringUtils.isEmpty(companyForm.getPrefix())) {
errors.add(prefixlength, new ActionError(error.prefix));
} else if (companyForm.getPrefix().length() != 3) {
errors.add(prefixlength, new
ActionError(error.prefixlength));
}
if(companyForm.getCompanyTypes()==null ||
StringUtils.isEmpty(companyForm.getCompanyTypes())) {
errors.add(companytypes, new
ActionError(error.companytypes));
}
if(companyForm.getVatNumber()==null ||
StringUtils.isEmpty(companyForm.getVatNumber())) {
errors.add(vatnumber, new ActionError(error.vatnumber));
}
if (!errors.empty()) {
saveErrors(request, errors);
return (new ActionForward(mapping.getInput()));
}

I can take the form data out of the session with a scriptlet and display the
values, but
struts don't fills out the form automaticly. First thing i took a look on
it, that i maybe
configured the scope of the form incorrect and when mapping back to input he
trys to generate
a new form which is only stored in the request. But there all settings seem
to be correct.

Any idea ??

oliver


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




Re: How can I register a DTD in a war or jar

2002-02-20 Thread Fernando Esteban Barril Otero


You need to implement the EntityResolver interface and
write the resolveEntity() method to return a InputSource
for your dtd (see EntityResolver doc). Actualy the
DefaultHandler already implements this interface, so
you need to overwrite the resolveEntity() method.
Don't forget to set the entity resolver in your XMLReader.

Struts uses the Digester (see jakarta-commons) that
make the job of reading xml configuration easier,
so you need to register the dtd location in the
digester as a url string and the dtd's system id.

In both cases, you can get the URL or InputStream of your dtd
in the jar file using Class.getResource() or
Class.getResourceAsStream().


Fernando


- Original Message -
From: Benoit Segaert [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, February 20, 2002 10:58 AM
Subject: How can I register a DTD in a war or jar


 I want to validate a XML with a DTD in a War application.
 I have my DTD available in the war file (or in a jar).

 I use a XML file like the following:

 ?xml version=1.0 encoding=ISO-8859-1 ?
 !DOCTYPE Application SYSTEM
 file:///C:/java/jakarta-tomcat-4.0.1/webapps/myapplication/WEB-INF/Ldap
 Framework.dtd

 Application
 ...

 But I want to register my DTD in Tomcat for the using of the following
 XML header

  ?xml version=1.0 encoding=ISO-8859-1 ?
  !DOCTYPE Application PUBLIC
-//Uniway Belgium//DTD Application Configuration 1.0//EN
   http://www.uniway.be/application/dtds/application_1_0.dtd;
  Application
  ...

 How can I explain to Servlet Engine (Tomcat) the mapping between this
 header
 and the real place of the DTD in the War or Jar?

 When I use Struts in my application, I have the struts-config file
   ?xml version=1.0 encoding=ISO-8859-1 ?

   !DOCTYPE struts-config PUBLIC
   -//Apache Software Foundation//DTD Struts Configuration
 1.0//EN
   http://jakarta.apache.org/struts/dtds/struts-config_1_0.dtd;
   struts-config

 If I look the Tomcat log I can see:

   register('-//Apache Software Foundation//DTD Struts Configuration
 1.0//EN',
   'jar:file:C:/java/jakarta-tomcat-4.0.1/webapps/strutsjndi/WEB-INF/
   lib/struts.jar!/org/apache/struts/resources/struts-config_1_0.dtd'

 The struts.jar contains the dtd and the the xml file refers to the
 following
 web file:
 http://jakarta.apache.org/struts/dtds/struts-config_1_0.dtd;


 I want to reproduce this configuration.
 How can I explain this mapping to the xml parser or servlet engine?


 Benoit

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


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




Re: Displaying recursively defined bean...

2002-02-20 Thread tom goemaes

Has any one done recursive displays using JSP?

Yes and it work out fine... 
i just did more scope tricks :)

showTree.jsp:
1. Read the root Message
2. Place root message into Request with name of message
3. 
display.jsp:
1. Assume there exists an object in request called message of type Message

copy the message object from the request in the page scope (bean:define).

2. Display the details of the message
using page scope object

3. Iterate over message.getReplies()
using page scope object

4. For each object in the iteration
   a. Put the object into request with the name of message
   b. 

i hope you get it to work ... 


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




RE: the nightly build problem

2002-02-20 Thread Yu, Yanhui

Hi,

Could you use bean:define for object2 inside the logic:iterate which then
needs to have propoerty=object1 only?

Yanhui Yu  

-Original Message-
From: Christopher Cheng [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, February 20, 2002 7:36 AM
To: 'Struts Users Mailing List'
Subject: the nightly build problem


I got the nightly build from Apache.
Using the new iterate tag with indexed, I am able to put the form
values on the page with get, but set doesn't seem to work with second
level form beans

logic:iterate name=form1 property=object1.object2
html:text name=object2 property=property1 indexed=true
/logic:iterate

Looking at the source from IE, it generates something like
input type=text name=object2[0].property1 value=
input type=text name=object2[1].property1 value=
input type=text name=object2[2].property1 value=
...

Of course object2 is in object1, not in form1. That's why it doesn't
work.

Is there anyway to work around?


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




RE: custom taglib - call tag within tag

2002-02-20 Thread Arik Levin ( Tikal )

This is what I need, if anybody knows how please do reply. Thanx.

-Original Message-
From: Oliver Reflé [mailto:[EMAIL PROTECTED]] 
Sent: Wednesday, February 20, 2002 4:41 PM
To: Struts Users Mailing List
Subject: AW: custom taglib - call tag within tag

i don't understand the question, why don't you write in your jsp
tag1
tag2/
/tag1

-Ursprüngliche Nachricht-
Von: Arik Levin ( Tikal ) [mailto:[EMAIL PROTECTED]]
Gesendet: Mittwoch, 20. Februar 2002 15:44
An: 'Struts Users Mailing List'
Betreff: custom taglib - call tag within tag


Hi.

I wanted to know if there's a possibility to call a tag within a
tag and I don't mean by that to extend my tag and use findAncestorWithClass
Or use the scope or something like that.

Say I have some Test1Tag and  Test2Tag

Public Test1Tag extends TagSupport{

doStartTag(){

Test2Tag  test  = new Test2Tag();
test.doStartTag();
}

Is it possible, and what method should I call, that I'll get the
result as I'm getting it from calling a regular JSP's tag?

Thank you all, bye.


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



ActionForm and default values

2002-02-20 Thread Dua, Amit

Hi 

I want to populate my page with default value 

So, in order to do that 
I have a value object (ReportData), ReportDataForm (Form Bean)

I populate the Value object through one of the Action classes and then do a
Action Forward to one of the Jsp namely ReportData.jsp

In the ReportData.jsp I do following 

ReportData reoportData = (ReportData)request.getAttribute(reportdata); 
html:form action=reportAction.do
html:text property=reportName value=%=reportData.getReportName()%/
..
..


I do all the validation In ReportAction class which is mapped to
reportAction.do

But when there is an error In the field , I am not able to get the value
populated for the text field.


Is there something wrong I am doing.
Or is there any other better way of doing this thing..


Amit


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




Re: ActionForm and default values

2002-02-20 Thread Keith

try removing the value= attribute from your html: text.
hope that helps.

--- Dua, Amit [EMAIL PROTECTED] wrote:
 Hi 
 
 I want to populate my page with default value 
 
 So, in order to do that 
 I have a value object (ReportData), ReportDataForm (Form Bean)
 
 I populate the Value object through one of the Action classes and then do a
 Action Forward to one of the Jsp namely ReportData.jsp
 
 In the ReportData.jsp I do following 
 
 ReportData reoportData = (ReportData)request.getAttribute(reportdata); 
 html:form action=reportAction.do
 html:text property=reportName value=%=reportData.getReportName()%/
 ..
 ..
 
 
 I do all the validation In ReportAction class which is mapped to
 reportAction.do
 
 But when there is an error In the field , I am not able to get the value
 populated for the text field.
 
 
 Is there something wrong I am doing.
 Or is there any other better way of doing this thing..
 
 
 Amit
 
 
 --
 To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
 For additional commands, e-mail: mailto:[EMAIL PROTECTED]
 


=
~~
Search the archive:-
http://www.mail-archive.com/struts-user%40jakarta.apache.org/
~~
Keith Bacon - Looking for struts work - South-East UK.
phone UK 07960 011275

__
Do You Yahoo!?
Yahoo! Sports - Coverage of the 2002 Olympic Games
http://sports.yahoo.com

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




RE: ActionForm and default values

2002-02-20 Thread Dua, Amit

But then how will I set the default values

amit

-Original Message-
From: Keith [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, February 20, 2002 10:36 AM
To: Struts Users Mailing List
Subject: Re: ActionForm and default values


try removing the value= attribute from your html: text.
hope that helps.

--- Dua, Amit [EMAIL PROTECTED] wrote:
 Hi 
 
 I want to populate my page with default value 
 
 So, in order to do that 
 I have a value object (ReportData), ReportDataForm (Form Bean)
 
 I populate the Value object through one of the Action classes and then do
a
 Action Forward to one of the Jsp namely ReportData.jsp
 
 In the ReportData.jsp I do following 
 
 ReportData reoportData = (ReportData)request.getAttribute(reportdata); 
 html:form action=reportAction.do
 html:text property=reportName value=%=reportData.getReportName()%/
 ..
 ..
 
 
 I do all the validation In ReportAction class which is mapped to
 reportAction.do
 
 But when there is an error In the field , I am not able to get the value
 populated for the text field.
 
 
 Is there something wrong I am doing.
 Or is there any other better way of doing this thing..
 
 
 Amit
 
 
 --
 To unsubscribe, e-mail:
mailto:[EMAIL PROTECTED]
 For additional commands, e-mail:
mailto:[EMAIL PROTECTED]
 


=
~~
Search the archive:-
http://www.mail-archive.com/struts-user%40jakarta.apache.org/
~~
Keith Bacon - Looking for struts work - South-East UK.
phone UK 07960 011275

__
Do You Yahoo!?
Yahoo! Sports - Coverage of the 2002 Olympic Games
http://sports.yahoo.com

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

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




Re: Strange problem

2002-02-20 Thread keithBacon

I loop if I set up struts-config so
input=SelectParty.do
when it should be
SelectParty.jsp.

But then you would see SelectPartyAction's perform method being executed  your
debug msg. Is it possible you have a more complex flow of control.
Stick debug messages everywhere!

--- Tim Sawyer [EMAIL PROTECTED] wrote:
 I'm using struts 1.0.1 with tomcat 3.2.1, and am encountering a wierd
 problem.
 
 I'm running an action to search for a list of people, and that completes
 fine.  Then I can click on that person to select it and proceed to another
 page.  However, clicking on the person hyperlink leads to java.exe taking
 100% CPU and everything just sits there.
 
 The link looks like this:
 
 a href=/AddFindParty/SelectParty.do?ID=151975Ernie, Uncle  /a  br
 
 So as far as I can tell, the click on the do returns control to the
 controller servlet, which then keeps it and sits there burning cpu cycles.  I
 have a debug statemement in the perform() method in the appropriate action
 handler for SelectParty.do and it doesn't get that far.  I even commented out
 SelectParty in my struts-config.xml file, and it made absolutely no
 difference.
 
 Anyone got any ideas?  I'm new to struts, but I got the first bit to work,
 and I can't understand why this doesn't.
 
 Cheers,
 
 Tim.
 
 
 
 --
 To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
 For additional commands, e-mail: mailto:[EMAIL PROTECTED]
 


=
~~
Search the archive:-
http://www.mail-archive.com/struts-user%40jakarta.apache.org/
~~
Keith Bacon - Looking for struts work - South-East UK.
phone UK 07960 011275

__
Do You Yahoo!?
Yahoo! Sports - Coverage of the 2002 Olympic Games
http://sports.yahoo.com

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




RE: ActionForm and default values

2002-02-20 Thread Ian Beaumont

This question seems to be going around and around this mailing list and no
one has produced an answer.

-Original Message-
From: Dua, Amit [mailto:[EMAIL PROTECTED]]
Sent: 20 February 2002 15:46
To: 'Struts Users Mailing List'
Cc: '[EMAIL PROTECTED]'
Subject: RE: ActionForm and default values


But then how will I set the default values

amit

-Original Message-
From: Keith [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, February 20, 2002 10:36 AM
To: Struts Users Mailing List
Subject: Re: ActionForm and default values


try removing the value= attribute from your html: text.
hope that helps.

--- Dua, Amit [EMAIL PROTECTED] wrote:
 Hi 
 
 I want to populate my page with default value 
 
 So, in order to do that 
 I have a value object (ReportData), ReportDataForm (Form Bean)
 
 I populate the Value object through one of the Action classes and then do
a
 Action Forward to one of the Jsp namely ReportData.jsp
 
 In the ReportData.jsp I do following 
 
 ReportData reoportData = (ReportData)request.getAttribute(reportdata); 
 html:form action=reportAction.do
 html:text property=reportName value=%=reportData.getReportName()%/
 ..
 ..
 
 
 I do all the validation In ReportAction class which is mapped to
 reportAction.do
 
 But when there is an error In the field , I am not able to get the value
 populated for the text field.
 
 
 Is there something wrong I am doing.
 Or is there any other better way of doing this thing..
 
 
 Amit
 
 
 --
 To unsubscribe, e-mail:
mailto:[EMAIL PROTECTED]
 For additional commands, e-mail:
mailto:[EMAIL PROTECTED]
 


=
~~
Search the archive:-
http://www.mail-archive.com/struts-user%40jakarta.apache.org/
~~
Keith Bacon - Looking for struts work - South-East UK.
phone UK 07960 011275

__
Do You Yahoo!?
Yahoo! Sports - Coverage of the 2002 Olympic Games
http://sports.yahoo.com

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

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



RE: form looses valuse when validation maps back

2002-02-20 Thread keithBacon

Maybe put debug mesages in your formBean getter/setters to check they are being
called  the values are as expected.


--- Yu, Yanhui [EMAIL PROTECTED] wrote:
 Hi,
 
 Could you try to specify  validate=true in the struts-config.xml instead?
 
 Yanhui Yu
 
 
 
 
 
 
 -Original Message-
 From: Oliver Reflé [mailto:[EMAIL PROTECTED]]
 Sent: Wednesday, February 20, 2002 3:22 AM
 To: Struts-User
 Subject: form looses valuse when validation maps back
 
 
 Hello All,
 i have for me a real strange problem. When i validate my form and there are
 missing
 fields then it is mapped back to the input page. All the error messages are
 shown correctly.
 The only thing is that my form is empty and the user has to reenter all
 values,  which is
 really annoying.
 
 This is my entry in the struts-config.xml
 
 action path=/admin/createCompany
 
 type=com.transwide.services.uma.web.action.admin.CreateCompanyAction
 name=companyForm
 scope=session
 input=/uma/admin/create-company-step1.jsp
 validate=false
   forward name=success
path=/uma/admin/create-company-step2.jsp
   /forward
   forward name=failure
path=/uma/admin/failure.jsp
   /forward
 /action
 
 The validation is done in the action class(business reason), but i tried it
 also in the Form which
 makes no difference. Here is part of my Action which handles the validation
 
 ActionErrors errors = new ActionErrors();
 
 try{
 
 CompanyForm companyForm = (CompanyForm)form;
 
 // some validations
 if (companyForm.getAccountName()==null ||
 StringUtils.isEmpty(companyForm.getAccountName())) {
 errors.add(accountname, new
 ActionError(error.accountname));
 }
 if (companyForm.getCompanyName()==null ||
 StringUtils.isEmpty(companyForm.getCompanyName())) {
 errors.add(companyname, new
 ActionError(error.companyname));
 }
 if (companyForm.getPrefix()==null ||
 StringUtils.isEmpty(companyForm.getPrefix())) {
 errors.add(prefixlength, new ActionError(error.prefix));
 } else if (companyForm.getPrefix().length() != 3) {
 errors.add(prefixlength, new
 ActionError(error.prefixlength));
 }
 if(companyForm.getCompanyTypes()==null ||
 StringUtils.isEmpty(companyForm.getCompanyTypes())) {
 errors.add(companytypes, new
 ActionError(error.companytypes));
 }
 if(companyForm.getVatNumber()==null ||
 StringUtils.isEmpty(companyForm.getVatNumber())) {
 errors.add(vatnumber, new ActionError(error.vatnumber));
 }
 if (!errors.empty()) {
 saveErrors(request, errors);
 return (new ActionForward(mapping.getInput()));
 }
 
 I can take the form data out of the session with a scriptlet and display the
 values, but
 struts don't fills out the form automaticly. First thing i took a look on
 it, that i maybe
 configured the scope of the form incorrect and when mapping back to input he
 trys to generate
 a new form which is only stored in the request. But there all settings seem
 to be correct.
 
 Any idea ??
 
 oliver
 
 
 --
 To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
 For additional commands, e-mail: mailto:[EMAIL PROTECTED]
 


=
~~
Search the archive:-
http://www.mail-archive.com/struts-user%40jakarta.apache.org/
~~
Keith Bacon - Looking for struts work - South-East UK.
phone UK 07960 011275

__
Do You Yahoo!?
Yahoo! Sports - Coverage of the 2002 Olympic Games
http://sports.yahoo.com

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




Re: ActionForm and default values

2002-02-20 Thread Jim Crossley

It's pretty simple, I think.  

1) The formbean is passed to the action's perform method by the Struts
controller.

2) The action populates the formbean (ReportDataForm) from the value
object (ReportData).

3) The action returns the appropriate ActionForm to render the view.

4) The view (ReportData.jsp) need look no more complicated than this:

html:form action=/reportAction
  html:text property=reportName/
/html:form

-- Jim

Ian Beaumont [EMAIL PROTECTED] writes:

 This question seems to be going around and around this mailing list and
 no
 one has produced an answer.
 
 -Original Message-
 From: Dua, Amit [mailto:[EMAIL PROTECTED]]
 Sent: 20 February 2002 15:46
 To: 'Struts Users Mailing List'
 Cc: '[EMAIL PROTECTED]'
 Subject: RE: ActionForm and default values
 
 
 But then how will I set the default values
 
 amit
 
 -Original Message-
 From: Keith [mailto:[EMAIL PROTECTED]]
 Sent: Wednesday, February 20, 2002 10:36 AM
 To: Struts Users Mailing List
 Subject: Re: ActionForm and default values
 
 
 try removing the value= attribute from your html: text.
 hope that helps.
 
 --- Dua, Amit [EMAIL PROTECTED] wrote:
  Hi 
  
  I want to populate my page with default value 
  
  So, in order to do that 
  I have a value object (ReportData), ReportDataForm (Form Bean)
  
  I populate the Value object through one of the Action classes and then
 do
 a
  Action Forward to one of the Jsp namely ReportData.jsp
  
  In the ReportData.jsp I do following 
  
  ReportData reoportData =
 (ReportData)request.getAttribute(reportdata); 
  html:form action=reportAction.do
  html:text property=reportName
 value=%=reportData.getReportName()%/
  ..
  ..
  
  
  I do all the validation In ReportAction class which is mapped to
  reportAction.do
  
  But when there is an error In the field , I am not able to get the
 value
  populated for the text field.
  
  
  Is there something wrong I am doing.
  Or is there any other better way of doing this thing..
  
  
  Amit
  
  
  --
  To unsubscribe, e-mail:
 mailto:[EMAIL PROTECTED]
  For additional commands, e-mail:
 mailto:[EMAIL PROTECTED]
  
 
 
 =
 ~~
 Search the archive:-
 http://www.mail-archive.com/struts-user%40jakarta.apache.org/
 ~~
 Keith Bacon - Looking for struts work - South-East UK.
 phone UK 07960 011275
 
 __
 Do You Yahoo!?
 Yahoo! Sports - Coverage of the 2002 Olympic Games
 http://sports.yahoo.com
 
 --
 To unsubscribe, e-mail:
 mailto:[EMAIL PROTECTED]
 For additional commands, e-mail:
 mailto:[EMAIL PROTECTED]
 
 --
 To unsubscribe, e-mail:
 mailto:[EMAIL PROTECTED]
 For additional commands, e-mail:
 mailto:[EMAIL PROTECTED]

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




RE: sessions

2002-02-20 Thread keithBacon

I never had a problem with sessions or links. It's very straightforward.
Struts deals with moving around inside 1 web-app using Forwards not Redirects.
A session is always there for your jsp or Action class to use.
Struts handles the user denying cookies - it automatically uses URL re-writing
to store the sessionID on the client.
Redirect is for going off to a different server or web-app which don't know
anything about the session being left. If you want to pass data to the new
location you have to park it somewhere else.
So not being a super expert - really all I can assure you is it ought to be
very simple for normal requirements.
Hope that helps - Happy strutting - Keith.


--- Bill Page [EMAIL PROTECTED] wrote:
 thanks for the response.
 
 I couldn't find it in the archives either.  I'm pretty new to the server
 side java (been client side for the last 5 years), servlets and all that so
 I may have some basic misunderstandings.  It looks to me like any anchors in
 the HTML result will need to have encodeURL or encodeRedirectURL applied to
 them.  Looking at the struts code the ActionServlet, it looks like struts
 appends the session only if the redirect flag is on.  I may also not
 understand the definition of URL rewriting here, but can not find a
 definition.  
 
 If I'm always forwarding through struts using say success and failure how
 would I know to do anything?  As I see it the beauty of the forwarding
 mechanism is that I don't have to know the destination in the action
 subclass.  Yet if I'm understanding this, I'll lose the session id.  I seem
 to keep it if I always set the redirect flag in the forward class, but I'm
 suspicious that that is not the correct way.
 
 To further complicate this, we're using a menu program to generate the
 javascript for a horizontal menu at the top.  Looks like (and what I'm in
 the middle of doing now) I'll need to manually append ;jsessionid= in
 a javascript function and then do a location=.  As we're both invoking jsp
 and *.do actions, I'm parsing to figure out whether to append the session
 or not.
 
 If I'm going through a lot of work for something that should be done another
 way, I'd love to know.  
 
 
 
  -Original Message-
  From: Keith [mailto:[EMAIL PROTECTED]]
  Sent: Wednesday, February 20, 2002 6:14 AM
  To: Struts Users Mailing List
  Subject: Re: sessions
  
  
  Hi Bill,
  This has been answered but I couldn't find the answer in the archive!
  I'm not the expert here but - it's when a new session is created.
  Struts doesn't know if the browser accepts cookies (where the 
  session id is to
  be stored) so puts it in the URL (URL re-writing). On the 
  next request struts
  knows the cookie is accepted so doesn't need to put the 
  sessionId inthe URL.
  So every time you see that it's the symptom of a new session 
  being created - no
  the cause.
  
 
 --
 To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
 For additional commands, e-mail: mailto:[EMAIL PROTECTED]
 


=
~~
Search the archive:-
http://www.mail-archive.com/struts-user%40jakarta.apache.org/
~~
Keith Bacon - Looking for struts work - South-East UK.
phone UK 07960 011275

__
Do You Yahoo!?
Yahoo! Sports - Coverage of the 2002 Olympic Games
http://sports.yahoo.com

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




java.lang.NoClassDefFoundError (class in struts.jar) on WebLogic 6.1

2002-02-20 Thread Mike Dunbar

OK, I searched through the archives and it seems I am not the first to
encounter this problem. I didn't see a conclusive solution, however, so
thought I would try again. All details and stack trace are given below.
Any help is much appreciated.

Thanks,
Mike

Platform
WebLogic 6.1 on Windows 2000
Struts 1.0.2 (happens with 1.0, also)

Deployment setup:
1.struts.jar is in WEB-INF/lib
2.all the .tld files are in WEB-INF (do these need to be in same dir?)
3.struts.jar in not in any of my EJB jars nor system classpath
4.Trouble deploying/running application as an EAR file. No problem when
deploying the EJBs (4 jar files) and WAR file seperately.

Problem Description:
I am able to invoke my GetLogonAction, which results in the request
being forwared to logon.jsp. So, obviously struts.jar is in the
classpath in order for this to happen. However, when the system tries
to load logon.jsp, there is a problem at the first strutshtml tag and
the following stack trace results:

Feb 20, 2002 10:44:17 AM EST Info HTTP mdunbar myserver
ExecuteThread: '14' for queue: 'default'   101047
[WebAppServletContext(6725640,ipp,/ipp)] resolved taglib uri
'/WEB-INF/struts-html.tld' to taglib-location
/WEB-INF/struts-html.tld: 
Feb 20, 2002 10:44:18 AM EST Info HTTP mdunbar myserver
ExecuteThread: '14' for queue: 'default'   101047
[WebAppServletContext(6725640,ipp,/ipp)] Generated java file:
C:\bea\wlserver6.1\config\mydomain\applications\.wlnotdelete\wlap9204\WEB-INF\_tmp_war_myserver_myserver_ipp\jsp_servlet\_logon.java

Feb 20, 2002 10:44:22 AM EST Error HTTP mdunbar myserver
ExecuteThread: '14' for queue: 'default'   101020
[WebAppServletContext(6725640,ipp,/ipp)] Servlet failed with
Exception 
java.lang.NoClassDefFoundError: org/apache/struts/action/ActionForm
at java.lang.ClassLoader.defineClass0(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:486)
at
java.security.SecureClassLoader.defineClass(SecureClassLoader.java:111)
at
weblogic.utils.classloaders.GenericClassLoader.findLocalClass(GenericClassLoader.java:338)
at
weblogic.utils.classloaders.GenericClassLoader.findClass(GenericClassLoader.java:155)
at java.lang.ClassLoader.loadClass(ClassLoader.java:297)
at java.lang.ClassLoader.loadClass(ClassLoader.java:290)
at java.lang.ClassLoader.loadClass(ClassLoader.java:253)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:313)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:120)
at org.apache.struts.taglib.html.FormTag.doStartTag(FormTag.java:563)
at jsp_servlet._logon._jspService(_logon.java:112)
at weblogic.servlet.jsp.JspBase.service(JspBase.java:27)
at
weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:263)
at
weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:302)
at
weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:200)
at
weblogic.servlet.internal.RequestDispatcherImpl.forward(RequestDispatcherImpl.java:190)
at
org.apache.struts.action.ActionServlet.processActionForward(ActionServlet.java:1758)
at
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1595)
at
org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:491)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at
weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:263)
at
weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:200)
at
weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:2390)
at
weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:1959)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:137)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)






__
Do You Yahoo!?
Yahoo! Sports - Coverage of the 2002 Olympic Games
http://sports.yahoo.com

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




Re: Class reloading error in Tomcat on Sun Solaris

2002-02-20 Thread keithBacon

Heavens - don't let Bill Gates find out about this. He'll start crowing. Win NT
beats Solaris - oh dear.
Are you saying restarting the server doesn't make it go away?
I get this sort of thing after recompiling  have to restart Tomcat (on Win98).
As I understand I shouldn't have to.


--- Struts Newsgroup [EMAIL PROTECTED] wrote:
 Subject: Class reloading error in Tomcat on Sun Solaris
 From: Denis A.Vishniakov [EMAIL PROTECTED]
  ===
 
   Hello!
 
   I try to use Tomcat 4.0.2 with Struts 1.0.2 on Sun Solaris. After I upload
 new Form class or Action class (without tomcat shutdowning) the errore
 occure: javax.servlet.ServletException: Parsing error processing resource
 path /WEB-INF/struts-config.xml or javax.servlet.ServletException: Cannot
 find ActionMappings or ActionFormBeans collection or so on.
   Reloading of application, Start/Stop of application, Removing/Deploing of
 application affect no results.
 
   This problem no appeare on Windows NT 4.0.
 
   Can You help me?
 
   WBR, Denis A.Vishniakov.
 
 
 
 --
 To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
 For additional commands, e-mail: mailto:[EMAIL PROTECTED]
 


=
~~
Search the archive:-
http://www.mail-archive.com/struts-user%40jakarta.apache.org/
~~
Keith Bacon - Looking for struts work - South-East UK.
phone UK 07960 011275

__
Do You Yahoo!?
Yahoo! Sports - Coverage of the 2002 Olympic Games
http://sports.yahoo.com

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




RE: ActionForm and default values

2002-02-20 Thread Ian Beaumont

Ok - I want to select an item on one page which will take me to another page
where I can edit the selected item.
How do I pre-populate the form for the edit page in the action for the
selected item as the form won't exist at this point?

-Original Message-
From: Jim Crossley [mailto:[EMAIL PROTECTED]]
Sent: 20 February 2002 16:06
To: Struts Users Mailing List
Subject: Re: ActionForm and default values


It's pretty simple, I think.  

1) The formbean is passed to the action's perform method by the Struts
controller.

2) The action populates the formbean (ReportDataForm) from the value
object (ReportData).

3) The action returns the appropriate ActionForm to render the view.

4) The view (ReportData.jsp) need look no more complicated than this:

html:form action=/reportAction
  html:text property=reportName/
/html:form

-- Jim

Ian Beaumont [EMAIL PROTECTED] writes:

 This question seems to be going around and around this mailing list and
 no
 one has produced an answer.
 
 -Original Message-
 From: Dua, Amit [mailto:[EMAIL PROTECTED]]
 Sent: 20 February 2002 15:46
 To: 'Struts Users Mailing List'
 Cc: '[EMAIL PROTECTED]'
 Subject: RE: ActionForm and default values
 
 
 But then how will I set the default values
 
 amit
 
 -Original Message-
 From: Keith [mailto:[EMAIL PROTECTED]]
 Sent: Wednesday, February 20, 2002 10:36 AM
 To: Struts Users Mailing List
 Subject: Re: ActionForm and default values
 
 
 try removing the value= attribute from your html: text.
 hope that helps.
 
 --- Dua, Amit [EMAIL PROTECTED] wrote:
  Hi 
  
  I want to populate my page with default value 
  
  So, in order to do that 
  I have a value object (ReportData), ReportDataForm (Form Bean)
  
  I populate the Value object through one of the Action classes and then
 do
 a
  Action Forward to one of the Jsp namely ReportData.jsp
  
  In the ReportData.jsp I do following 
  
  ReportData reoportData =
 (ReportData)request.getAttribute(reportdata); 
  html:form action=reportAction.do
  html:text property=reportName
 value=%=reportData.getReportName()%/
  ..
  ..
  
  
  I do all the validation In ReportAction class which is mapped to
  reportAction.do
  
  But when there is an error In the field , I am not able to get the
 value
  populated for the text field.
  
  
  Is there something wrong I am doing.
  Or is there any other better way of doing this thing..
  
  
  Amit
  
  
  --
  To unsubscribe, e-mail:
 mailto:[EMAIL PROTECTED]
  For additional commands, e-mail:
 mailto:[EMAIL PROTECTED]
  
 
 
 =
 ~~
 Search the archive:-
 http://www.mail-archive.com/struts-user%40jakarta.apache.org/
 ~~
 Keith Bacon - Looking for struts work - South-East UK.
 phone UK 07960 011275
 
 __
 Do You Yahoo!?
 Yahoo! Sports - Coverage of the 2002 Olympic Games
 http://sports.yahoo.com
 
 --
 To unsubscribe, e-mail:
 mailto:[EMAIL PROTECTED]
 For additional commands, e-mail:
 mailto:[EMAIL PROTECTED]
 
 --
 To unsubscribe, e-mail:
 mailto:[EMAIL PROTECTED]
 For additional commands, e-mail:
 mailto:[EMAIL PROTECTED]

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



Re: ActionForm and default values

2002-02-20 Thread keithBacon

It is that darn simple! 
I remember being rather confused learning struts  spent a lot of time
experimenting with the tags to see what happened. It's a complicated
environment - the code is what i call 'dense' (no not the coder!) ie. each line
requires a lot of knowledge to understand - you have to experiment  let the
knowledge sink in slowly. You need to learn familiarity with the server
environment  struts  jsp. Also you need to learn how to debug quickly (use
lots of debug logs) , how to have a quick compile to test cycle.
Are we missing stuff in the struts example apps? You should be able to copy 
adapt them  when it breaks go back  copy again. 


--- Jim Crossley [EMAIL PROTECTED] wrote:
 It's pretty simple, I think.  
 
 1) The formbean is passed to the action's perform method by the Struts
 controller.
 
 2) The action populates the formbean (ReportDataForm) from the value
 object (ReportData).
 
 3) The action returns the appropriate ActionForm to render the view.
 
 4) The view (ReportData.jsp) need look no more complicated than this:
 
 html:form action=/reportAction
   html:text property=reportName/
 /html:form
 
 -- Jim
 
 Ian Beaumont [EMAIL PROTECTED] writes:
 
  This question seems to be going around and around this mailing list and
  no
  one has produced an answer.
  
  -Original Message-
  From: Dua, Amit [mailto:[EMAIL PROTECTED]]
  Sent: 20 February 2002 15:46
  To: 'Struts Users Mailing List'
  Cc: '[EMAIL PROTECTED]'
  Subject: RE: ActionForm and default values
  
  
  But then how will I set the default values
  
  amit
  
  -Original Message-
  From: Keith [mailto:[EMAIL PROTECTED]]
  Sent: Wednesday, February 20, 2002 10:36 AM
  To: Struts Users Mailing List
  Subject: Re: ActionForm and default values
  
  
  try removing the value= attribute from your html: text.
  hope that helps.
  
  --- Dua, Amit [EMAIL PROTECTED] wrote:
   Hi 
   
   I want to populate my page with default value 
   
   So, in order to do that 
   I have a value object (ReportData), ReportDataForm (Form Bean)
   
   I populate the Value object through one of the Action classes and then
  do
  a
   Action Forward to one of the Jsp namely ReportData.jsp
   
   In the ReportData.jsp I do following 
   
   ReportData reoportData =
  (ReportData)request.getAttribute(reportdata); 
   html:form action=reportAction.do
   html:text property=reportName
  value=%=reportData.getReportName()%/
   ..
   ..
   
   
   I do all the validation In ReportAction class which is mapped to
   reportAction.do
   
   But when there is an error In the field , I am not able to get the
  value
   populated for the text field.
   
   
   Is there something wrong I am doing.
   Or is there any other better way of doing this thing..
   
   
   Amit
   
   
   --
   To unsubscribe, e-mail:
  mailto:[EMAIL PROTECTED]
   For additional commands, e-mail:
  mailto:[EMAIL PROTECTED]
   
  
  
  =
  ~~
  Search the archive:-
  http://www.mail-archive.com/struts-user%40jakarta.apache.org/
  ~~
  Keith Bacon - Looking for struts work - South-East UK.
  phone UK 07960 011275
  
  __
  Do You Yahoo!?
  Yahoo! Sports - Coverage of the 2002 Olympic Games
  http://sports.yahoo.com
  
  --
  To unsubscribe, e-mail:
  mailto:[EMAIL PROTECTED]
  For additional commands, e-mail:
  mailto:[EMAIL PROTECTED]
  
  --
  To unsubscribe, e-mail:
  mailto:[EMAIL PROTECTED]
  For additional commands, e-mail:
  mailto:[EMAIL PROTECTED]
 
 --
 To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
 For additional commands, e-mail: mailto:[EMAIL PROTECTED]
 


=
~~
Search the archive:-
http://www.mail-archive.com/struts-user%40jakarta.apache.org/
~~
Keith Bacon - Looking for struts work - South-East UK.
phone UK 07960 011275

__
Do You Yahoo!?
Yahoo! Sports - Coverage of the 2002 Olympic Games
http://sports.yahoo.com

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




Re: ActionForm and default values

2002-02-20 Thread Jim Crossley

Ian Beaumont [EMAIL PROTECTED] writes:

 Ok - I want to select an item on one page which will take me to
 another page where I can edit the selected item.

Sounds common enough.

 How do I pre-populate the form for the edit page in the action for
 the selected item as the form won't exist at this point?

As long as you have the name attribute set correctly for the
appropriate action element of struts-config, the formbean will
always exist!  The controller servlet creates it for you.

-- Jim

 -Original Message-
 From: Jim Crossley [mailto:[EMAIL PROTECTED]]
 Sent: 20 February 2002 16:06
 To: Struts Users Mailing List
 Subject: Re: ActionForm and default values
 
 
 It's pretty simple, I think.  
 
 1) The formbean is passed to the action's perform method by the Struts
 controller.
 
 2) The action populates the formbean (ReportDataForm) from the value
 object (ReportData).
 
 3) The action returns the appropriate ActionForm to render the view.
 
 4) The view (ReportData.jsp) need look no more complicated than this:
 
 html:form action=/reportAction
   html:text property=reportName/
 /html:form
 
 -- Jim
 
 Ian Beaumont [EMAIL PROTECTED] writes:
 
  This question seems to be going around and around this mailing list
 and
  no
  one has produced an answer.
  
  -Original Message-
  From: Dua, Amit [mailto:[EMAIL PROTECTED]]
  Sent: 20 February 2002 15:46
  To: 'Struts Users Mailing List'
  Cc: '[EMAIL PROTECTED]'
  Subject: RE: ActionForm and default values
  
  
  But then how will I set the default values
  
  amit
  
  -Original Message-
  From: Keith [mailto:[EMAIL PROTECTED]]
  Sent: Wednesday, February 20, 2002 10:36 AM
  To: Struts Users Mailing List
  Subject: Re: ActionForm and default values
  
  
  try removing the value= attribute from your html: text.
  hope that helps.
  
  --- Dua, Amit [EMAIL PROTECTED] wrote:
   Hi 
   
   I want to populate my page with default value 
   
   So, in order to do that 
   I have a value object (ReportData), ReportDataForm (Form Bean)
   
   I populate the Value object through one of the Action classes and
 then
  do
  a
   Action Forward to one of the Jsp namely ReportData.jsp
   
   In the ReportData.jsp I do following 
   
   ReportData reoportData =
  (ReportData)request.getAttribute(reportdata); 
   html:form action=reportAction.do
   html:text property=reportName
  value=%=reportData.getReportName()%/
   ..
   ..
   
   
   I do all the validation In ReportAction class which is mapped to
   reportAction.do
   
   But when there is an error In the field , I am not able to get the
  value
   populated for the text field.
   
   
   Is there something wrong I am doing.
   Or is there any other better way of doing this thing..
   
   
   Amit
   
   
   --
   To unsubscribe, e-mail:
  mailto:[EMAIL PROTECTED]
   For additional commands, e-mail:
  mailto:[EMAIL PROTECTED]
   
  
  
  =
  ~~
  Search the archive:-
  http://www.mail-archive.com/struts-user%40jakarta.apache.org/
  ~~
  Keith Bacon - Looking for struts work - South-East UK.
  phone UK 07960 011275
  
  __
  Do You Yahoo!?
  Yahoo! Sports - Coverage of the 2002 Olympic Games
  http://sports.yahoo.com
  
  --
  To unsubscribe, e-mail:
  mailto:[EMAIL PROTECTED]
  For additional commands, e-mail:
  mailto:[EMAIL PROTECTED]
  
  --
  To unsubscribe, e-mail:
  mailto:[EMAIL PROTECTED]
  For additional commands, e-mail:
  mailto:[EMAIL PROTECTED]
 
 --
 To unsubscribe, e-mail:
 mailto:[EMAIL PROTECTED]
 For additional commands, e-mail:
 mailto:[EMAIL PROTECTED]

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




RE: ActionForm and default values

2002-02-20 Thread Ian Beaumont

This means that in the action for the select item I need to get hold of
the form bean for the next page I'm going to so I can populate it.  
Two problems with this:
1. How do I get hold of the form bean?  Do I create it myself?
2. This all relies on me knowing the mappings of what page I'm going to go
to next so I can populate the form bean.  This defeats the object of having
the struts-XML file.

Below is the text from a previous email I sent.  The only reply I got was
the example didn't show 'best practises'.  In which case, what is the best
practise.


I've been through the struts-example again.  What I want to achieve is
something similar to the 'Edit user registration details'.  This
pre-populates the form with existing details.  Now the way the example does
this is to create the RegistrationForm in the action and then populate it.

From EditRegistrationAction.java
// Populate the user registration form
if (form == null) {
if (servlet.getDebug() = 1)
servlet.log( Creating new RegistrationForm bean under key 
+ mapping.getAttribute());
form = new RegistrationForm();
if (request.equals(mapping.getScope()))
request.setAttribute(mapping.getAttribute(), form);
else
session.setAttribute(mapping.getAttribute(), form);
} 

This seems really nasty as you are now hard-coding the name of the form
class that will be used for validation on the next page.  Any changes in
future to the struts-config file may well break the system.  It doesn't
feel right to have to create these forms ourselves.

Wouldn't it be more sensible to have a pre-creation method on the action of
a form that allowed allowed a the action to populate the form fields before
the page was displayed.



-Original Message-
From: Jim Crossley [mailto:[EMAIL PROTECTED]]
Sent: 20 February 2002 16:38
To: Struts Users Mailing List
Subject: Re: ActionForm and default values


Ian Beaumont [EMAIL PROTECTED] writes:

 Ok - I want to select an item on one page which will take me to
 another page where I can edit the selected item.

Sounds common enough.

 How do I pre-populate the form for the edit page in the action for
 the selected item as the form won't exist at this point?

As long as you have the name attribute set correctly for the
appropriate action element of struts-config, the formbean will
always exist!  The controller servlet creates it for you.

-- Jim

 -Original Message-
 From: Jim Crossley [mailto:[EMAIL PROTECTED]]
 Sent: 20 February 2002 16:06
 To: Struts Users Mailing List
 Subject: Re: ActionForm and default values
 
 
 It's pretty simple, I think.  
 
 1) The formbean is passed to the action's perform method by the Struts
 controller.
 
 2) The action populates the formbean (ReportDataForm) from the value
 object (ReportData).
 
 3) The action returns the appropriate ActionForm to render the view.
 
 4) The view (ReportData.jsp) need look no more complicated than this:
 
 html:form action=/reportAction
   html:text property=reportName/
 /html:form
 
 -- Jim
 
 Ian Beaumont [EMAIL PROTECTED] writes:
 
  This question seems to be going around and around this mailing list
 and
  no
  one has produced an answer.
  
  -Original Message-
  From: Dua, Amit [mailto:[EMAIL PROTECTED]]
  Sent: 20 February 2002 15:46
  To: 'Struts Users Mailing List'
  Cc: '[EMAIL PROTECTED]'
  Subject: RE: ActionForm and default values
  
  
  But then how will I set the default values
  
  amit
  
  -Original Message-
  From: Keith [mailto:[EMAIL PROTECTED]]
  Sent: Wednesday, February 20, 2002 10:36 AM
  To: Struts Users Mailing List
  Subject: Re: ActionForm and default values
  
  
  try removing the value= attribute from your html: text.
  hope that helps.
  
  --- Dua, Amit [EMAIL PROTECTED] wrote:
   Hi 
   
   I want to populate my page with default value 
   
   So, in order to do that 
   I have a value object (ReportData), ReportDataForm (Form Bean)
   
   I populate the Value object through one of the Action classes and
 then
  do
  a
   Action Forward to one of the Jsp namely ReportData.jsp
   
   In the ReportData.jsp I do following 
   
   ReportData reoportData =
  (ReportData)request.getAttribute(reportdata); 
   html:form action=reportAction.do
   html:text property=reportName
  value=%=reportData.getReportName()%/
   ..
   ..
   
   
   I do all the validation In ReportAction class which is mapped to
   reportAction.do
   
   But when there is an error In the field , I am not able to get the
  value
   populated for the text field.
   
   
   Is there something wrong I am doing.
   Or is there any other better way of doing this thing..
   
   
   Amit
   
   
   --
   To unsubscribe, e-mail:
  mailto:[EMAIL PROTECTED]
   For additional commands, e-mail:
  mailto:[EMAIL PROTECTED]
   
  
  
  =
  

Re: ActionForm and default values

2002-02-20 Thread Jonathan James

1. It gets created by the ActionServlet and passed to the action's perform
method as an ActionForm. Just cast it.

I don't understand what you mean by 2.


- Original Message -
From: Ian Beaumont [EMAIL PROTECTED]
To: 'Struts Users Mailing List' [EMAIL PROTECTED]
Sent: Wednesday, February 20, 2002 10:52 AM
Subject: RE: ActionForm and default values


 This means that in the action for the select item I need to get hold of
 the form bean for the next page I'm going to so I can populate it.
 Two problems with this:
 1. How do I get hold of the form bean?  Do I create it myself?
 2. This all relies on me knowing the mappings of what page I'm going to go
 to next so I can populate the form bean.  This defeats the object of
having
 the struts-XML file.

 Below is the text from a previous email I sent.  The only reply I got was
 the example didn't show 'best practises'.  In which case, what is the best
 practise.


 I've been through the struts-example again.  What I want to achieve is
 something similar to the 'Edit user registration details'.  This
 pre-populates the form with existing details.  Now the way the example
does
 this is to create the RegistrationForm in the action and then populate it.

 From EditRegistrationAction.java
 // Populate the user registration form
 if (form == null) {
 if (servlet.getDebug() = 1)
 servlet.log( Creating new RegistrationForm bean under key

 + mapping.getAttribute());
 form = new RegistrationForm();
 if (request.equals(mapping.getScope()))
 request.setAttribute(mapping.getAttribute(), form);
 else
 session.setAttribute(mapping.getAttribute(), form);
 }

 This seems really nasty as you are now hard-coding the name of the form
 class that will be used for validation on the next page.  Any changes in
 future to the struts-config file may well break the system.  It doesn't
 feel right to have to create these forms ourselves.

 Wouldn't it be more sensible to have a pre-creation method on the action
of
 a form that allowed allowed a the action to populate the form fields
before
 the page was displayed.



 -Original Message-
 From: Jim Crossley [mailto:[EMAIL PROTECTED]]
 Sent: 20 February 2002 16:38
 To: Struts Users Mailing List
 Subject: Re: ActionForm and default values


 Ian Beaumont [EMAIL PROTECTED] writes:

  Ok - I want to select an item on one page which will take me to
  another page where I can edit the selected item.

 Sounds common enough.

  How do I pre-populate the form for the edit page in the action for
  the selected item as the form won't exist at this point?

 As long as you have the name attribute set correctly for the
 appropriate action element of struts-config, the formbean will
 always exist!  The controller servlet creates it for you.

 -- Jim

  -Original Message-
  From: Jim Crossley [mailto:[EMAIL PROTECTED]]
  Sent: 20 February 2002 16:06
  To: Struts Users Mailing List
  Subject: Re: ActionForm and default values
 
 
  It's pretty simple, I think.
 
  1) The formbean is passed to the action's perform method by the Struts
  controller.
 
  2) The action populates the formbean (ReportDataForm) from the value
  object (ReportData).
 
  3) The action returns the appropriate ActionForm to render the view.
 
  4) The view (ReportData.jsp) need look no more complicated than this:
 
  html:form action=/reportAction
html:text property=reportName/
  /html:form
 
  -- Jim
 
  Ian Beaumont [EMAIL PROTECTED] writes:
 
   This question seems to be going around and around this mailing list
  and
   no
   one has produced an answer.
  
   -Original Message-
   From: Dua, Amit [mailto:[EMAIL PROTECTED]]
   Sent: 20 February 2002 15:46
   To: 'Struts Users Mailing List'
   Cc: '[EMAIL PROTECTED]'
   Subject: RE: ActionForm and default values
  
  
   But then how will I set the default values
  
   amit
  
   -Original Message-
   From: Keith [mailto:[EMAIL PROTECTED]]
   Sent: Wednesday, February 20, 2002 10:36 AM
   To: Struts Users Mailing List
   Subject: Re: ActionForm and default values
  
  
   try removing the value= attribute from your html: text.
   hope that helps.
  
   --- Dua, Amit [EMAIL PROTECTED] wrote:
Hi
   
I want to populate my page with default value
   
So, in order to do that
I have a value object (ReportData), ReportDataForm (Form Bean)
   
I populate the Value object through one of the Action classes and
  then
   do
   a
Action Forward to one of the Jsp namely ReportData.jsp
   
In the ReportData.jsp I do following
   
ReportData reoportData =
   (ReportData)request.getAttribute(reportdata);
html:form action=reportAction.do
html:text property=reportName
   value=%=reportData.getReportName()%/
..
..
   
   
I do all the validation In ReportAction class which is mapped to
reportAction.do
   
   

RE: ActionForm and default values

2002-02-20 Thread Corey Klaasmeyer

This is probably a common question, which should have a corresponding FAQ
'How do I pre-populate an HTML form using ActionForm?' I think the answer is
you either set the values in the constructor of your ActionForm subclass
implementation, but this wasn't immediately obvious to me either. You can
infer the answer from this paragraph the user guide: 

The form tag renders an HTML form element, based on the specified
attributes. It also associates all of the fields within this form with a
session scoped FormBean that is stored under the key logonForm. The Struts
developer provides the Java implementation of this form bean, subclassing
the Struts class ActionForm. This bean is used to provide initial values for
all of the input fields that have names matching the property names of the
bean. If an appropriate bean is not found, a new one will be created
automatically, using the specified Java class name.

I think you can specify non-dynamic values for a form bean in the
struts-config file if you extend DynaActionForm:

* Use the standard class org.apache.struts.action.DynaActionForm,
  which will be populated with properties defined by form-property
  elements nested inside the form-bean element.  Note that you can
  also set initial values in the form-property element; these are
  used in the default implementation of reset().  Intelligent defaults
  take care of the most common cases.  Note that the default validate()
  method does NO checking, so you will need to do everything in your
  Action.

Corey 

-Original Message-
From: Jim Crossley [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, February 20, 2002 10:38 AM
To: Struts Users Mailing List
Subject: Re: ActionForm and default values


Ian Beaumont [EMAIL PROTECTED] writes:

 Ok - I want to select an item on one page which will take me to
 another page where I can edit the selected item.

Sounds common enough.

 How do I pre-populate the form for the edit page in the action for
 the selected item as the form won't exist at this point?

As long as you have the name attribute set correctly for the
appropriate action element of struts-config, the formbean will
always exist!  The controller servlet creates it for you.

-- Jim

 -Original Message-
 From: Jim Crossley [mailto:[EMAIL PROTECTED]]
 Sent: 20 February 2002 16:06
 To: Struts Users Mailing List
 Subject: Re: ActionForm and default values
 
 
 It's pretty simple, I think.  
 
 1) The formbean is passed to the action's perform method by the Struts
 controller.
 
 2) The action populates the formbean (ReportDataForm) from the value
 object (ReportData).
 
 3) The action returns the appropriate ActionForm to render the view.
 
 4) The view (ReportData.jsp) need look no more complicated than this:
 
 html:form action=/reportAction
   html:text property=reportName/
 /html:form
 
 -- Jim
 
 Ian Beaumont [EMAIL PROTECTED] writes:
 
  This question seems to be going around and around this mailing list
 and
  no
  one has produced an answer.
  
  -Original Message-
  From: Dua, Amit [mailto:[EMAIL PROTECTED]]
  Sent: 20 February 2002 15:46
  To: 'Struts Users Mailing List'
  Cc: '[EMAIL PROTECTED]'
  Subject: RE: ActionForm and default values
  
  
  But then how will I set the default values
  
  amit
  
  -Original Message-
  From: Keith [mailto:[EMAIL PROTECTED]]
  Sent: Wednesday, February 20, 2002 10:36 AM
  To: Struts Users Mailing List
  Subject: Re: ActionForm and default values
  
  
  try removing the value= attribute from your html: text.
  hope that helps.
  
  --- Dua, Amit [EMAIL PROTECTED] wrote:
   Hi 
   
   I want to populate my page with default value 
   
   So, in order to do that 
   I have a value object (ReportData), ReportDataForm (Form Bean)
   
   I populate the Value object through one of the Action classes and
 then
  do
  a
   Action Forward to one of the Jsp namely ReportData.jsp
   
   In the ReportData.jsp I do following 
   
   ReportData reoportData =
  (ReportData)request.getAttribute(reportdata); 
   html:form action=reportAction.do
   html:text property=reportName
  value=%=reportData.getReportName()%/
   ..
   ..
   
   
   I do all the validation In ReportAction class which is mapped to
   reportAction.do
   
   But when there is an error In the field , I am not able to get the
  value
   populated for the text field.
   
   
   Is there something wrong I am doing.
   Or is there any other better way of doing this thing..
   
   
   Amit
   
   
   --
   To unsubscribe, e-mail:
  mailto:[EMAIL PROTECTED]
   For additional commands, e-mail:
  mailto:[EMAIL PROTECTED]
   
  
  
  =
  ~~
  Search the archive:-
  http://www.mail-archive.com/struts-user%40jakarta.apache.org/
  ~~
  Keith Bacon - Looking for struts work - South-East UK.
  phone UK 07960 011275
  
  __

action and form contract

2002-02-20 Thread Carter, Steve

On husted.com, Ted Husted wrote:
Do not check for null ActionForm beans in your Actions
If an Action expects an ActionForm bean, then its API contact with the ActionMappings 
should require that this bean, or a subclass, be named in the ActionMapping. The 
Actions contact wit the controller is that it will always instantiate the bean before 
the Action is called. If either contact is broken, the application should expose a 
null pointer exception so that the problem is fixed and the misunderstanding resolved. 
Whether an Action expects an ActionForm bean should be specified in its Javadoc.

Now I'm wondering if 'contact' was a type and what he meant was 'contract', that is, 
in the sense of an API contract or implied constrain, pre-condition.

(You out there Ted?)

Anyway, this seems like a good idea. I'm always complaining that exceptions are often 
overused or misused in Java, and this seems like a good use: let the exception raise 
havoc, in order to inform you of a really exceptional condition, and one that should 
be exposed if it exists.



Steve Carter
Sr. Software Engineer
Swift Rivers
[EMAIL PROTECTED]


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




struts-example won't run

2002-02-20 Thread @Basebeans.com

Subject: struts-example won't run
From: Wendy S [EMAIL PROTECTED]
 ===
I've searched the mailing list archive but it didn't turn up anything like
this.

I've downloaded Struts and dropped the .war files in $TOMCAT_HOME/webapps.
I also put xercesImpl.jar and xmlParserAPIs.jar in $TOMCAT_HOME/lib.  Tomcat
starts, and I can view struts-documentation, but when I point my browser at
/struts-example, I get an error page:

Error: 500
Location: /struts-example/logon.jsp
Internal Servlet Error:
javax.servlet.ServletException: cant remove Attributes from request scope
Root cause:
java.lang.IllegalArgumentException: cant remove Attributes from request
scope

Help!  What could be causing this and how do I fix it?

--
Wendy in Tempe, AZ



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




RE: How do I init a Form bean via business logic?

2002-02-20 Thread Jakkampudi, ChandraseKhar

As long as your reset method is coded properly, all of you values should be
retained. 
Pre-populating from a bean does not break the MVC because that is exactly
how you display dynamic data which is not in a form.
I am doing this and it works fine for me. 

JC

-Original Message-
From: Ian Beaumont [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, February 20, 2002 3:10 AM
To: 'Struts Users Mailing List'
Subject: RE: How do I init a Form bean via business logic?


I've been trying to get an answer to how to initialise a form bean from this
list, but with no success.
See Re: Can this be done at all using Form objects within struts fram
ework

The reason why I don't think you can pre-populate a form from the beam
(other than possibly breaking MVC) is that if the form fails to validate
correctly, when it is re-displayed it will wipe out all values the user has
entered - which wouldn't be the desired behaviour.

Can someone please give some guidance to the best practise for this
initialising a form bean via business logic.



-Original Message-
From: Barr, Scott [IBM GSA] [mailto:[EMAIL PROTECTED]]
Sent: 20 February 2002 03:27
To: 'Struts Users Mailing List'
Subject: RE: How do I init a Form bean via business logic?



The best reason I can give as to why you should use form objects, is that
you will pretty much always provide String getter and setters, rather than
the 'real' data object types. eg Timestamp


 -Original Message-
 From: Jakkampudi, ChandraseKhar [SMTP:[EMAIL PROTECTED]]
 Sent: Wednesday, February 20, 2002 1:03 PM
 To:   'Struts Users Mailing List'
 Subject:  RE: How do I init a Form bean via business logic?
 
 Scott,
 I need to clarify this further. 
 I am not suggesting you do away with an action. You use the action to get
 the data that is required as a value object. Since this is a value object,
 it can be re-used to serve another client. Instead of creating a form bean
 in the action, you set the retrieved value object from your DAO as a bean
 in
 your request. Thus, you avoid additional mapping code like
 form.setValue(valueObject.getValue()) and so on.
 Then if need be, you pre-populate the form, or display the data outside of
 the form in the jsp as a table or what not. 
 
 An instance of where this would be particularly useful. Let us say that
 some
 fields are not editable but are display only. (like your ID). Initializing
 the form in the action causes part of your display to be populated from
 the
 action while the rest is in the jsp.
 
 Your argument about jsp not creating and initialising objects is not true
 because that is exactly what jsp:useBean, bean:define and other tags
 (which
 is the right way to do things) do. Also, if you do not initialise a form
 in the action, or dont need to pre-fill data, the jsp IS the place where
 these objects are created.
 
 Nothing in what I suggested, implies that you need to catch errors and
 exceptions in the jsp. I agree with you that they shouldn't and with the
 approach I outlined they dont have to. All of this is done in the action.
 I
 am only asking about the additional step of creating the form bean which I
 think is not necessary.
 
 The action creates the Business Objects. You are right. But it does not
 NEED
 to create the Form objects. It can. But I cannot see an overriding reason
 why it SHOULD. 
 
 
 Thanks
 JC
 
 
 
 -Original Message-
 From: Barr, Scott [IBM GSA] [mailto:[EMAIL PROTECTED]]
 Sent: Tuesday, February 19, 2002 7:47 PM
 To: 'Struts Users Mailing List'
 Subject: RE: How do I init a Form bean via business logic?
 
 
 
 1. If you are doing something other than creating a new view component and
 allowing it to set its own default values, I would imagine that you are
 doing an Action.
 
 2. No it doesn't break MVC if the Action initialises the Form. If an
 action
 cannot deal with a form, where exactly is this supposed to be performed? 
 An Action populating a form object does not mean it requires knowing how
 the
 data will be presented, it is just data. What the jsp does with it is not
 the concern of the action. The Action does not care if property X is
 displayed as static text, or in a text field.
 The jsp is a presentation layer, and should not be creating and
 initialising
 objects. By the time you get to your presentation layer, you should not
 have
 to be catching errors, and redirecting to error pages etc. 
 The Action creates business objects. These objects can throw exceptions.
 eg.
 error while getting a new ID from a database. If an error occurs, I add
 error to the errors, and this will be displayed...
 If you init a Form bean in a jsp, and an exception occurs, you must deal
 with it in the page.
 
 3. What additional code? If your action deals with your business layer,
 but
 should not contain business logic itself. If it does, you cannot use your
 business object model to provide a different interface
 
 4. I don't see that filling a jsp with debug code makes for easier
 

RE: sessions

2002-02-20 Thread Bill Page

so I take it that a redirect header doesn't count as a redirect?

Have you worked without cookies?  This is where it really has come up.  

 -Original Message-
 From: keithBacon [mailto:[EMAIL PROTECTED]]
 Sent: Wednesday, February 20, 2002 11:10 AM
 To: Struts Users Mailing List
 Subject: RE: sessions
 
 
 I never had a problem with sessions or links. It's very 
 straightforward.
 Struts deals with moving around inside 1 web-app using 
 Forwards not Redirects.
 A session is always there for your jsp or Action class to use.
 Struts handles the user denying cookies - it automatically 
 uses URL re-writing
 to store the sessionID on the client.
 Redirect is for going off to a different server or web-app 
 which don't know
 anything about the session being left. If you want to pass 
 data to the new
 location you have to park it somewhere else.
 So not being a super expert - really all I can assure you is 
 it ought to be
 very simple for normal requirements.
 Hope that helps - Happy strutting - Keith.
 
 
 --- Bill Page [EMAIL PROTECTED] wrote:
  thanks for the response.
  
  I couldn't find it in the archives either.  I'm pretty new 
 to the server
  side java (been client side for the last 5 years), servlets 
 and all that so
  I may have some basic misunderstandings.  It looks to me 
 like any anchors in
  the HTML result will need to have encodeURL or 
 encodeRedirectURL applied to
  them.  Looking at the struts code the ActionServlet, it 
 looks like struts
  appends the session only if the redirect flag is on.  I may also not
  understand the definition of URL rewriting here, but can not find a
  definition.  
  
  If I'm always forwarding through struts using say success 
 and failure how
  would I know to do anything?  As I see it the beauty of the 
 forwarding
  mechanism is that I don't have to know the destination in the action
  subclass.  Yet if I'm understanding this, I'll lose the 
 session id.  I seem
  to keep it if I always set the redirect flag in the forward 
 class, but I'm
  suspicious that that is not the correct way.
  
  To further complicate this, we're using a menu program to 
 generate the
  javascript for a horizontal menu at the top.  Looks like 
 (and what I'm in
  the middle of doing now) I'll need to manually append 
 ;jsessionid= in
  a javascript function and then do a location=.  As we're 
 both invoking jsp
  and *.do actions, I'm parsing to figure out whether to 
 append the session
  or not.
  
  If I'm going through a lot of work for something that 
 should be done another
  way, I'd love to know.  
  
  
  
   -Original Message-
   From: Keith [mailto:[EMAIL PROTECTED]]
   Sent: Wednesday, February 20, 2002 6:14 AM
   To: Struts Users Mailing List
   Subject: Re: sessions
   
   
   Hi Bill,
   This has been answered but I couldn't find the answer in 
 the archive!
   I'm not the expert here but - it's when a new session is created.
   Struts doesn't know if the browser accepts cookies (where the 
   session id is to
   be stored) so puts it in the URL (URL re-writing). On the 
   next request struts
   knows the cookie is accepted so doesn't need to put the 
   sessionId inthe URL.
   So every time you see that it's the symptom of a new session 
   being created - no
   the cause.
   
  
  --
  To unsubscribe, e-mail:   
 mailto:[EMAIL PROTECTED]
  For additional commands, e-mail: 
 mailto:[EMAIL PROTECTED]
  
 
 
 =
 ~~
 Search the archive:-
 http://www.mail-archive.com/struts-user%40jakarta.apache.org/
 ~~
 Keith Bacon - Looking for struts work - South-East UK.
 phone UK 07960 011275
 
 __
 Do You Yahoo!?
 Yahoo! Sports - Coverage of the 2002 Olympic Games
 http://sports.yahoo.com
 
 --
 To unsubscribe, e-mail:   
 mailto:[EMAIL PROTECTED]
 For additional commands, e-mail: 
 mailto:[EMAIL PROTECTED]
 

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




RE: EJB = bad = MS.net

2002-02-20 Thread Carl Sziebert

Just a question for those of you who knock EJBs... How is it that you
plan to provide transaction management and security within your
applications?  Going straight to the database won't provide that for
you.  This whole debate makes me wonder how many people really
understand Java and quality application design.  I suggest that anyone
with questions get themselves a copy of Pro JSP Site Design by Wrox.  It
might help.

This debate has the potential to go on for a while...  Sorry, but I just
had to add my 2 cents.

-Original Message-
From: Vic Cekvenich [mailto:[EMAIL PROTECTED]] 
Sent: Wednesday, February 20, 2002 9:42 AM
To: Struts Users Mailing List
Cc: [EMAIL PROTECTED]
Subject: EJB = bad = MS.net

Home page of Jakarta has this
http://jakarta.apache.org/site/news.html#0130.2
on this:
http://www.mail-archive.com/general%40jakarta.apache.org/msg03376.html

I agree. Doing EJBs is bad on many levels and creates more problems. 
Avoid EJB if you want to stay in Java.

Alternative is to just use Struts + TomCat + RowSet (or DAO if you are 
doing something simple or small) and done. This is the sweet spot. MVC 
is all you need.

Alternative, do EJBs and your organization WILL switch to MS .NET on the

next project, leave J2EE, and you have to learn VB.net.

EJBs are for newbies. (If you need middleware (very rare) use SOAP)

lol,
Vic



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


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




RE: EJB = bad = MS.net

2002-02-20 Thread Edward Q. Bridges

i believe that if you are using jboss as an app-server, you can shut off 
the ejb service and still have security and transaction management (not to 
mention, jndi, web application support, mail services, logging services, 
etc. etc.).

my .2 added to your .2

--e--


On Wed, 20 Feb 2002 09:56:10 -0800, Carl Sziebert wrote:

Just a question for those of you who knock EJBs... How is it that you
plan to provide transaction management and security within your
applications?  Going straight to the database won't provide that for
you.  This whole debate makes me wonder how many people really
understand Java and quality application design.  I suggest that anyone
with questions get themselves a copy of Pro JSP Site Design by Wrox.  It
might help.

This debate has the potential to go on for a while...  Sorry, but I just
had to add my 2 cents.





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




Re: EJB = bad = MS.net

2002-02-20 Thread @Basebeans.com

Subject: Re: EJB = bad = MS.net
From: Vic Cekvenich [EMAIL PROTECTED]
 ===

Transaction: DBs have it; or you can have a Java Bean, that has 2 
JavaBeans in it, and all have a commit() method. You use EJB for a 
commit()?
Security? :
-Menu based based on a role (using Struts-menu), some items are disabled 
based on your role.
-JAAS JDBC Realms (I also get groupID)
-Based groupID some rows retrieved / selected are editable, some RO and 
some invisible on your selects. It's called row based security.
- Status based, based on a status of a row, some fileds become RO.

EJBs give you 0 useful security.

EJBs are also very slow to develop, and they distract developers to 
develop technology and not solve a business problems. They are also  
slow to execute, thus they are only suitable for small applications with 
low volume (and for organizations where a profit margin is not important 
or on going cost of operations is not important).
THere are some with EJB and and some resumes with EJBs are by people who 
have written a laboratory hello world ejb and never actually used them 
in production deployed where there is volume.

Custom RowSet can code circles around a large team of EJB developers.
OK, its a Flame: I have a bridge for sale by a smooth talking sales guy, 
aka The emperor is not wearing any clothes.

Vic

Carl Sziebert wrote:

 Just a question for those of you who knock EJBs... How is it that you
 plan to provide transaction management and security within your
 applications?  Going straight to the database won't provide that for
 you.  This whole debate makes me wonder how many people really
 understand Java and quality application design.  I suggest that anyone
 with questions get themselves a copy of Pro JSP Site Design by Wrox.  It
 might help.
 
 This debate has the potential to go on for a while...  Sorry, but I just
 had to add my 2 cents.
 
 -Original Message-
 From: Vic Cekvenich [mailto:[EMAIL PROTECTED]] 
 Sent: Wednesday, February 20, 2002 9:42 AM
 To: Struts Users Mailing List
 Cc: [EMAIL PROTECTED]
 Subject: EJB = bad = MS.net
 
 Home page of Jakarta has this
 http://jakarta.apache.org/site/news.html#0130.2
 on this:
 http://www.mail-archive.com/general%40jakarta.apache.org/msg03376.html
 
 I agree. Doing EJBs is bad on many levels and creates more problems. 
 Avoid EJB if you want to stay in Java.
 
 Alternative is to just use Struts + TomCat + RowSet (or DAO if you are 
 doing something simple or small) and done. This is the sweet spot. MVC 
 is all you need.
 
 Alternative, do EJBs and your organization WILL switch to MS .NET on the
 
 next project, leave J2EE, and you have to learn VB.net.
 
 EJBs are for newbies. (If you need middleware (very rare) use SOAP)
 
 lol,
 Vic
 
 
 
 --
 To unsubscribe, e-mail:
 mailto:[EMAIL PROTECTED]
 For additional commands, e-mail:
 mailto:[EMAIL PROTECTED]
 
 
 --
 To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
 For additional commands, e-mail: mailto:[EMAIL PROTECTED]
 


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




RE: EJB = bad = MS.net

2002-02-20 Thread Dan Trevino

The point of EJB security and transactions is to abstract those pieces
to make them vendor neutral.  If you write them correctly, you'll have
your security/transactions on JBoss, Weblogic, Websphere, whatever. 
Sure EJB's have some additional overhead, but that is the price you pay
for abstraction.  

This reminds me of the J2EE Pet Store vs. .Net Pet Store flare up a
while back.  Microsoft chose to execute most of their queries using
stored procedures.  Of course it was faster than using a pure Java
approach.  But they gave up all of the flexibility that Java offers. 
Similarly, if you use app server specific security, you will no doubt
lose portability.

I'm no fan of EJB, but IMO they have their place.  Its up to the
architect to decide what is best for their application and which
trade-offs to make.

dan


On Wed, 2002-02-20 at 13:22, Edward Q. Bridges wrote:
 i believe that if you are using jboss as an app-server, you can shut off 
 the ejb service and still have security and transaction management (not to 
 mention, jndi, web application support, mail services, logging services, 
 etc. etc.).
 
 my .2 added to your .2
 
 --e--
 
 
 On Wed, 20 Feb 2002 09:56:10 -0800, Carl Sziebert wrote:
 
 Just a question for those of you who knock EJBs... How is it that you
 plan to provide transaction management and security within your
 applications?  Going straight to the database won't provide that for
 you.  This whole debate makes me wonder how many people really
 understand Java and quality application design.  I suggest that anyone
 with questions get themselves a copy of Pro JSP Site Design by Wrox.  It
 might help.
 
 This debate has the potential to go on for a while...  Sorry, but I just
 had to add my 2 cents.
 
 
 
 
 
 --
 To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
 For additional commands, e-mail: mailto:[EMAIL PROTECTED]
-- 
Dan Trevino
bluemagnet, llc
http://bluemagnet.com/

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




Re: ActionForm and default values

2002-02-20 Thread Jim Crossley

Ian Beaumont [EMAIL PROTECTED] writes:

 This means that in the action for the select item I need to get
 hold of the form bean for the next page I'm going to so I can
 populate it.

You'll need to pass the ID of the selected item to the action.  So
your selection view will have something like this in it:

logic:iterate id=item name=formBeanName property=items
  html:link page=/edit.do paramId=id paramName=item
bean:write name=item
  /html:link
/logic:iterate

 1. How do I get hold of the form bean?  Do I create it myself?

No.  The struts controller will create it and pass it to the perform
method of an instance of the class identified by the type attribute
in the /edit action in struts-config.  That perform method will get
the id parameter from the request, get the item's values from
somewhere and populate the formbean.

 2. This all relies on me knowing the mappings of what page I'm going
 to go to next so I can populate the form bean.  This defeats the
 object of having the struts-XML file.

Not exactly.  You do have to know which action you're going to next,
but struts-config allows you to change which classes and views are
used to perform that action.  And your action class obviously needs to
know what kind of formbean to expect so that it can downcast it
appropriately, but there's nothing stopping you from casting it to an
interface or abstract class which the classes specified in
struts-config must implement.  You may need that level of polymorphic
flexibility in your app, but from my experience you won't.

 Below is the text from a previous email I sent.  The only reply I
 got was the example didn't show 'best practises'.  In which case,
 what is the best practise.

The example accounts for a missing name attribute in the
corresponding action element in struts-config.  The best practice is
to include a name attribute in struts-config so that your action
doesn't have to do that.

-- Jim

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




How to set attribute via submit

2002-02-20 Thread Alex Colic

Hi,

I have a form with a couple of buttons. The form is submitted to a
navigation action class that just looks at an action parameters and forwards
the request. I want created a series of submit buttons with the same
property but different values. If I set the value property of the tag then
that is displayed as the text of the button. What I need to do is set the
property and value of the button with a different String for the text
displayed on the button.

Any ideas?

Thanks

Alex


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




EJB = bad = MS.net

2002-02-20 Thread Vic Cekvenich

Home page of Jakarta has this
http://jakarta.apache.org/site/news.html#0130.2
on this:
http://www.mail-archive.com/general%40jakarta.apache.org/msg03376.html

I agree. Doing EJBs is bad on many levels and creates more problems. 
Avoid EJB if you want to stay in Java.

Alternative is to just use Struts + TomCat + RowSet (or DAO if you are 
doing something simple or small) and done. This is the sweet spot. MVC 
is all you need.

Alternative, do EJBs and your organization WILL switch to MS .NET on the 
next project, leave J2EE, and you have to learn VB.net.

EJBs are for newbies. (If you need middleware (very rare) use SOAP)

lol,
Vic



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




RE: Strange problem

2002-02-20 Thread Tim Sawyer

Cheers Keith,

It seems to be doing it somewhere in the struts framework, between the
browser calling a do, and the framework calling an action.  Is there any
trace I can turn on?

Cheers,

Tim.

-Original Message-
From: keithBacon [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, February 20, 2002 3:53 PM
To: Struts Users Mailing List; Tim Sawyer
Subject: Re: Strange problem


I loop if I set up struts-config so
input=SelectParty.do
when it should be
SelectParty.jsp.

But then you would see SelectPartyAction's perform method being executed 
your
debug msg. Is it possible you have a more complex flow of control.
Stick debug messages everywhere!

--- Tim Sawyer [EMAIL PROTECTED] wrote:
 I'm using struts 1.0.1 with tomcat 3.2.1, and am encountering a wierd
 problem.

 I'm running an action to search for a list of people, and that completes
 fine.  Then I can click on that person to select it and proceed to another
 page.  However, clicking on the person hyperlink leads to java.exe taking
 100% CPU and everything just sits there.

 The link looks like this:

 a href=/AddFindParty/SelectParty.do?ID=151975Ernie, Uncle  /a  br

 So as far as I can tell, the click on the do returns control to the
 controller servlet, which then keeps it and sits there burning cpu cycles.
I
 have a debug statemement in the perform() method in the appropriate action
 handler for SelectParty.do and it doesn't get that far.  I even commented
out
 SelectParty in my struts-config.xml file, and it made absolutely no
 difference.

 Anyone got any ideas?  I'm new to struts, but I got the first bit to work,
 and I can't understand why this doesn't.

 Cheers,

 Tim.



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



=
~~
Search the archive:-
http://www.mail-archive.com/struts-user%40jakarta.apache.org/
~~
Keith Bacon - Looking for struts work - South-East UK.
phone UK 07960 011275

__
Do You Yahoo!?
Yahoo! Sports - Coverage of the 2002 Olympic Games
http://sports.yahoo.com

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




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




RE: sessions

2002-02-20 Thread keithBacon

 so I take it that a redirect header doesn't count as a redirect?
No idea. I never used a re-direct within struts. I guess if I specified
redirect=true struts would put in the HTML exactly what you code manually in
HTML.

 Have you worked without cookies?  This is where it really has come up.  
No. I was never asked to. I guess struts works without them - it claims to. I
also guess if you write fiddly odd things you increase risk of getting a
problem. Sorry my experience is with fairly straightfoward use of the
technology  I've no complaints about that.

K.

--- Bill Page [EMAIL PROTECTED] wrote:
 so I take it that a redirect header doesn't count as a redirect?
 
 Have you worked without cookies?  This is where it really has come up.  
 
  -Original Message-
  From: keithBacon [mailto:[EMAIL PROTECTED]]
  Sent: Wednesday, February 20, 2002 11:10 AM
  To: Struts Users Mailing List
  Subject: RE: sessions
  
  
  I never had a problem with sessions or links. It's very 
  straightforward.
  Struts deals with moving around inside 1 web-app using 
  Forwards not Redirects.
  A session is always there for your jsp or Action class to use.
  Struts handles the user denying cookies - it automatically 
  uses URL re-writing
  to store the sessionID on the client.
  Redirect is for going off to a different server or web-app 
  which don't know
  anything about the session being left. If you want to pass 
  data to the new
  location you have to park it somewhere else.
  So not being a super expert - really all I can assure you is 
  it ought to be
  very simple for normal requirements.
  Hope that helps - Happy strutting - Keith.
  
  
  --- Bill Page [EMAIL PROTECTED] wrote:
   thanks for the response.
   
   I couldn't find it in the archives either.  I'm pretty new 
  to the server
   side java (been client side for the last 5 years), servlets 
  and all that so
   I may have some basic misunderstandings.  It looks to me 
  like any anchors in
   the HTML result will need to have encodeURL or 
  encodeRedirectURL applied to
   them.  Looking at the struts code the ActionServlet, it 
  looks like struts
   appends the session only if the redirect flag is on.  I may also not
   understand the definition of URL rewriting here, but can not find a
   definition.  
   
   If I'm always forwarding through struts using say success 
  and failure how
   would I know to do anything?  As I see it the beauty of the 
  forwarding
   mechanism is that I don't have to know the destination in the action
   subclass.  Yet if I'm understanding this, I'll lose the 
  session id.  I seem
   to keep it if I always set the redirect flag in the forward 
  class, but I'm
   suspicious that that is not the correct way.
   
   To further complicate this, we're using a menu program to 
  generate the
   javascript for a horizontal menu at the top.  Looks like 
  (and what I'm in
   the middle of doing now) I'll need to manually append 
  ;jsessionid= in
   a javascript function and then do a location=.  As we're 
  both invoking jsp
   and *.do actions, I'm parsing to figure out whether to 
  append the session
   or not.
   
   If I'm going through a lot of work for something that 
  should be done another
   way, I'd love to know.  
   
   
   
-Original Message-
From: Keith [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, February 20, 2002 6:14 AM
To: Struts Users Mailing List
Subject: Re: sessions


Hi Bill,
This has been answered but I couldn't find the answer in 
  the archive!
I'm not the expert here but - it's when a new session is created.
Struts doesn't know if the browser accepts cookies (where the 
session id is to
be stored) so puts it in the URL (URL re-writing). On the 
next request struts
knows the cookie is accepted so doesn't need to put the 
sessionId inthe URL.
So every time you see that it's the symptom of a new session 
being created - no
the cause.

   
   --
   To unsubscribe, e-mail:   
  mailto:[EMAIL PROTECTED]
   For additional commands, e-mail: 
  mailto:[EMAIL PROTECTED]
   
  
  
  =
  ~~
  Search the archive:-
  http://www.mail-archive.com/struts-user%40jakarta.apache.org/
  ~~
  Keith Bacon - Looking for struts work - South-East UK.
  phone UK 07960 011275
  
  __
  Do You Yahoo!?
  Yahoo! Sports - Coverage of the 2002 Olympic Games
  http://sports.yahoo.com
  
  --
  To unsubscribe, e-mail:   
  mailto:[EMAIL PROTECTED]
  For additional commands, e-mail: 
  mailto:[EMAIL PROTECTED]
  
 
 --
 To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
 For additional commands, e-mail: mailto:[EMAIL PROTECTED]
 


=
~~
Search the archive:-
http://www.mail-archive.com/struts-user%40jakarta.apache.org/

RE: sessions

2002-02-20 Thread Bill Page

thanks for your time and responses.

Maybe we'll jumping in too complicated too fast.  My current theory is that
this stuff should be handled but there may be some problems in JRun.  I've
seem what seem to be similar complaints in their forum.  I was able to
determine that even with cookies off in JRun and in my browswer that it was
reporting that it was getting session info from a cookie which is one reason
I'm currently suspicious of a JRun issue.

Again thanks for your time

bp

 -Original Message-
 From: keithBacon [mailto:[EMAIL PROTECTED]]
 Sent: Wednesday, February 20, 2002 2:17 PM
 To: Struts Users Mailing List
 Subject: RE: sessions
 
 
  so I take it that a redirect header doesn't count as a redirect?
 No idea. I never used a re-direct within struts. I guess if I 
 specified
 redirect=true struts would put in the HTML exactly what you 
 code manually in
 HTML.
 
  Have you worked without cookies?  This is where it really 
 has come up.  
 No. I was never asked to. I guess struts works without them - 
 it claims to. I
 also guess if you write fiddly odd things you increase risk 
 of getting a
 problem. Sorry my experience is with fairly straightfoward use of the
 technology  I've no complaints about that.
 
 K.
 
 --- Bill Page [EMAIL PROTECTED] wrote:
  so I take it that a redirect header doesn't count as a redirect?
  
  Have you worked without cookies?  This is where it really 
 has come up.  
  
   -Original Message-
   From: keithBacon [mailto:[EMAIL PROTECTED]]
   Sent: Wednesday, February 20, 2002 11:10 AM
   To: Struts Users Mailing List
   Subject: RE: sessions
   
   
   I never had a problem with sessions or links. It's very 
   straightforward.
   Struts deals with moving around inside 1 web-app using 
   Forwards not Redirects.
   A session is always there for your jsp or Action class to use.
   Struts handles the user denying cookies - it automatically 
   uses URL re-writing
   to store the sessionID on the client.
   Redirect is for going off to a different server or web-app 
   which don't know
   anything about the session being left. If you want to pass 
   data to the new
   location you have to park it somewhere else.
   So not being a super expert - really all I can assure you is 
   it ought to be
   very simple for normal requirements.
   Hope that helps - Happy strutting - Keith.
   
   
   --- Bill Page [EMAIL PROTECTED] wrote:
thanks for the response.

I couldn't find it in the archives either.  I'm pretty new 
   to the server
side java (been client side for the last 5 years), servlets 
   and all that so
I may have some basic misunderstandings.  It looks to me 
   like any anchors in
the HTML result will need to have encodeURL or 
   encodeRedirectURL applied to
them.  Looking at the struts code the ActionServlet, it 
   looks like struts
appends the session only if the redirect flag is on.  I 
 may also not
understand the definition of URL rewriting here, but 
 can not find a
definition.  

If I'm always forwarding through struts using say success 
   and failure how
would I know to do anything?  As I see it the beauty of the 
   forwarding
mechanism is that I don't have to know the destination 
 in the action
subclass.  Yet if I'm understanding this, I'll lose the 
   session id.  I seem
to keep it if I always set the redirect flag in the forward 
   class, but I'm
suspicious that that is not the correct way.

To further complicate this, we're using a menu program to 
   generate the
javascript for a horizontal menu at the top.  Looks like 
   (and what I'm in
the middle of doing now) I'll need to manually append 
   ;jsessionid= in
a javascript function and then do a location=.  As we're 
   both invoking jsp
and *.do actions, I'm parsing to figure out whether to 
   append the session
or not.

If I'm going through a lot of work for something that 
   should be done another
way, I'd love to know.  



 -Original Message-
 From: Keith [mailto:[EMAIL PROTECTED]]
 Sent: Wednesday, February 20, 2002 6:14 AM
 To: Struts Users Mailing List
 Subject: Re: sessions
 
 
 Hi Bill,
 This has been answered but I couldn't find the answer in 
   the archive!
 I'm not the expert here but - it's when a new session 
 is created.
 Struts doesn't know if the browser accepts cookies (where the 
 session id is to
 be stored) so puts it in the URL (URL re-writing). On the 
 next request struts
 knows the cookie is accepted so doesn't need to put the 
 sessionId inthe URL.
 So every time you see that it's the symptom of a new session 
 being created - no
 the cause.
 

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

   
   
   =
   

RE: EJB = bad = MS.net

2002-02-20 Thread Robert

EJBs are not bad in and of themselves, and certainly not for newbies.
They are easy to misuse as a lot of people have, and therefore have a
bad rep. Using good design patterns can help in a good EJB solution.
They solve some problems, and yes create others. Also as mentioned on
the JavaLobby website, J2EE is not spelled Eee Jay Bee. JSP, Servlets,
JMS, and EJB all fall under the J2EE umbrella. Lest we forget that
Tomcat is the reference implementation of the J2EE JSP/Servlet APIs...

I've never been a big fan of J2EE security, but it IS abstracted away
from the developer. The biggest help is in transactions, being
declarative and in clustering the EJBs (yes I know you can cluster
webservers and servlet containers, but the code runs in one VM as
opposed to being _able_ to run across multiple in the same execution
sequence).

The alternative you suggest, Struts + Tomcat + RowSet, also has it's
place, and is more akin to the way the M$ petstore is built (not the
same, but more similar). I see no object model in the alternative, which
is useful in many, many environments.

Most public webapps probably don't need middleware, true. But in some
corporate apps (not all but some) middleware is a really helpful thing.
And saying that SOAP is Middleware, or a middleware alternative is like
saying SOAP can replace EJB. It's just showing ignorance of the
technology. SOAP is a communication mechanism like RMI, DCE, RPC, not a
middleware mechanism like EJB, JMS, etc. 

I read the links posted, and in the one case it goes back to my earlier
statement, misuse or misunderstanding of the technology. What EJB the
right solution? Maybe not, then again it might have performed great if
designed/built right. 

To blatantly disregard something as 'bad' doesn't help, and just sounds
like Microsoft when they said their petstore was better than Sun's. It
misses the point and says nothing.

- Robert

-Original Message-
From: Vic Cekvenich [mailto:[EMAIL PROTECTED]] 
Sent: Wednesday, February 20, 2002 11:42 AM
To: Struts Users Mailing List
Cc: [EMAIL PROTECTED]
Subject: EJB = bad = MS.net

Home page of Jakarta has this
http://jakarta.apache.org/site/news.html#0130.2
on this:
http://www.mail-archive.com/general%40jakarta.apache.org/msg03376.html

I agree. Doing EJBs is bad on many levels and creates more problems. 
Avoid EJB if you want to stay in Java.

Alternative is to just use Struts + TomCat + RowSet (or DAO if you are 
doing something simple or small) and done. This is the sweet spot. MVC 
is all you need.

Alternative, do EJBs and your organization WILL switch to MS .NET on the

next project, leave J2EE, and you have to learn VB.net.

EJBs are for newbies. (If you need middleware (very rare) use SOAP)

lol,
Vic



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



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




RE: EJB = bad = MS.net

2002-02-20 Thread Thompson, Darryl

 I STRONGLY disagree with this statement. We have been doing EJBs for 2 yrs
at my shop. Our Order Entry system  uses EJBs to capture customer orders in
36 cities (US) in every US timezone and we have had nothing but success. By
the way there is NO reason to buy BEA weblogic unless you are running EJBs
and don't trust JBOSS (which I do). Tomcat is much better at serving
webpages the WLS or Websphere, EJBs are one of the cornerstones of J2EE,
wake up Vic...

 -Original Message-
 From: Vic Cekvenich [SMTP:[EMAIL PROTECTED]]
 Sent: Wednesday, February 20, 2002 11:42 AM
 To:   Struts Users Mailing List
 Cc:   [EMAIL PROTECTED]
 Subject:  EJB = bad = MS.net
 
 Home page of Jakarta has this
 http://jakarta.apache.org/site/news.html#0130.2
 on this:
 http://www.mail-archive.com/general%40jakarta.apache.org/msg03376.html
 
 I agree. Doing EJBs is bad on many levels and creates more problems. 
 Avoid EJB if you want to stay in Java.
 
 Alternative is to just use Struts + TomCat + RowSet (or DAO if you are 
 doing something simple or small) and done. This is the sweet spot. MVC 
 is all you need.
 
 Alternative, do EJBs and your organization WILL switch to MS .NET on the 
 next project, leave J2EE, and you have to learn VB.net.
 
 EJBs are for newbies. (If you need middleware (very rare) use SOAP)
 
 lol,
 Vic
 
 
 
 --
 To unsubscribe, e-mail:
 mailto:[EMAIL PROTECTED]
 For additional commands, e-mail:
 mailto:[EMAIL PROTECTED]

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




RE: EJB = bad = MS.net

2002-02-20 Thread Cakalic, James

Hmm. And this guy claims to be training other developers using Struts. If
this is the kind of ranting that goes on in his book then its no longer a
wonder to me why people have blasted it so mercilessly.

Ever tried to do a distributed transaction across multiple database
connections? Hard enough without substantial design even when they are all
targeting the same physical database. Now try a distributed database. What
if your enterprise data is coming from multiple sources? Or you want to
involve messaging in the transaction? As for security, you can take it or
leave it in the EJB model. But wouldn't be a good idea to design a single
access point for such a resource to encapsulate the security policy? And
wouldn't it be good for that policy to be declarative? And wouldn't you like
the security credentials to be automatically propogated by the ORB? And
wouldn't you like the roles to be retrieved from the same mechanism used to
authenticate the user in the first place? And why would you write all that
when it already exists?

Granted, excessive use of EJB technology just because it is in your pocket
is not a good design choice. But claiming it is always a bad choice
regardless of circumstances is just as bad if not worse IMHO. Disputing the
pros/cons of EJB and related technologies with someone who clearly does not
appreciate the systemic issues the technologies are attempting to address is
sorta like debating the benefits of MVC with one of those died-in-the-wool,
you'll-never-change-my-mind, always-choose-the-most-expedient-route Model 1
programmers we've all run up against. They're so indoctrinated with their
own BS that they just can't see anything else.

Jim Cakalic

 -Original Message-
 From: Struts Newsgroup [mailto:[EMAIL PROTECTED]]
 Sent: Wednesday, February 20, 2002 12:25 PM
 To: [EMAIL PROTECTED]
 Subject: Re: EJB = bad = MS.net
 
 
 Subject: Re: EJB = bad = MS.net
 From: Vic Cekvenich [EMAIL PROTECTED]
  ===
 
 Transaction: DBs have it; or you can have a Java Bean, that has 2 
 JavaBeans in it, and all have a commit() method. You use EJB for a 
 commit()?
 Security? :
 -Menu based based on a role (using Struts-menu), some items 
 are disabled 
 based on your role.
 -JAAS JDBC Realms (I also get groupID)
 -Based groupID some rows retrieved / selected are editable, 
 some RO and 
 some invisible on your selects. It's called row based security.
 - Status based, based on a status of a row, some fileds become RO.
 
 EJBs give you 0 useful security.
 
 EJBs are also very slow to develop, and they distract developers to 
 develop technology and not solve a business problems. They 
 are also  
 slow to execute, thus they are only suitable for small 
 applications with 
 low volume (and for organizations where a profit margin is 
 not important 
 or on going cost of operations is not important).
 THere are some with EJB and and some resumes with EJBs are by 
 people who 
 have written a laboratory hello world ejb and never 
 actually used them 
 in production deployed where there is volume.
 
 Custom RowSet can code circles around a large team of EJB 
 developers.
 OK, its a Flame: I have a bridge for sale by a smooth talking 
 sales guy, 
 aka The emperor is not wearing any clothes.
 
 Vic
 
 Carl Sziebert wrote:
 
  Just a question for those of you who knock EJBs... How is 
 it that you
  plan to provide transaction management and security within your
  applications?  Going straight to the database won't provide that for
  you.  This whole debate makes me wonder how many people really
  understand Java and quality application design.  I suggest 
 that anyone
  with questions get themselves a copy of Pro JSP Site Design 
 by Wrox.  It
  might help.
  
  This debate has the potential to go on for a while...  
 Sorry, but I just
  had to add my 2 cents.
  
  -Original Message-
  From: Vic Cekvenich [mailto:[EMAIL PROTECTED]] 
  Sent: Wednesday, February 20, 2002 9:42 AM
  To: Struts Users Mailing List
  Cc: [EMAIL PROTECTED]
  Subject: EJB = bad = MS.net
  
  Home page of Jakarta has this
  http://jakarta.apache.org/site/news.html#0130.2
  on this:
  
http://www.mail-archive.com/general%40jakarta.apache.org/msg03376.html
 
 I agree. Doing EJBs is bad on many levels and creates more problems. 
 Avoid EJB if you want to stay in Java.
 
 Alternative is to just use Struts + TomCat + RowSet (or DAO if you are 
 doing something simple or small) and done. This is the sweet spot. MVC 
 is all you need.
 
 Alternative, do EJBs and your organization WILL switch to MS .NET on the
 
 next project, leave J2EE, and you have to learn VB.net.
 
 EJBs are for newbies. (If you need middleware (very rare) use SOAP)
 
 lol,
 Vic
 
 
 
 --
 To unsubscribe, e-mail:
 mailto:[EMAIL PROTECTED]
 For additional commands, e-mail:
 mailto:[EMAIL PROTECTED]
 
 
 --
 To unsubscribe, e-mail:
mailto:[EMAIL PROTECTED]
 For additional commands, e-mail:
mailto:[EMAIL PROTECTED]
 


--
To unsubscribe, e-mail:

Re: struts-example won't run

2002-02-20 Thread keithBacon

This is such a pain - it happens lots  I have no easy answer. I found 
http://www.mail-archive.com/struts-user@jakarta.apache.org/msg19383.html

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

did you search for
'remove Attributes from request'
I never had this error using 
jakarta-struts-1.0.zip 
jakarta-tomcat-3.2.2.zip
on Windows 98.
I bet .net doesn't stitch you up like this!
Sorry i can't help more.

--- Struts Newsgroup [EMAIL PROTECTED] wrote:
 Subject: struts-example won't run
 From: Wendy S [EMAIL PROTECTED]
  ===
 I've searched the mailing list archive but it didn't turn up anything like
 this.
 
 I've downloaded Struts and dropped the .war files in $TOMCAT_HOME/webapps.
 I also put xercesImpl.jar and xmlParserAPIs.jar in $TOMCAT_HOME/lib.  Tomcat
 starts, and I can view struts-documentation, but when I point my browser at
 /struts-example, I get an error page:
 
 Error: 500
 Location: /struts-example/logon.jsp
 Internal Servlet Error:
 javax.servlet.ServletException: cant remove Attributes from request scope
 Root cause:
 java.lang.IllegalArgumentException: cant remove Attributes from request
 scope
 
 Help!  What could be causing this and how do I fix it?
 
 --
 Wendy in Tempe, AZ
 
 
 
 --
 To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
 For additional commands, e-mail: mailto:[EMAIL PROTECTED]
 


=
~~
Search the archive:-
http://www.mail-archive.com/struts-user%40jakarta.apache.org/
~~
Keith Bacon - Looking for struts work - South-East UK.
phone UK 07960 011275

__
Do You Yahoo!?
Yahoo! Sports - Coverage of the 2002 Olympic Games
http://sports.yahoo.com

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




RE: EJB = bad = MS.net

2002-02-20 Thread Robert

Touché Jim. Touché...

- Robert

-Original Message-
From: Cakalic, James [mailto:[EMAIL PROTECTED]] 
Sent: Wednesday, February 20, 2002 1:30 PM
To: 'Struts Users Mailing List'
Subject: RE: EJB = bad = MS.net

Hmm. And this guy claims to be training other developers using Struts.
If
this is the kind of ranting that goes on in his book then its no longer
a
wonder to me why people have blasted it so mercilessly.

Ever tried to do a distributed transaction across multiple database
connections? Hard enough without substantial design even when they are
all
targeting the same physical database. Now try a distributed database.
What
if your enterprise data is coming from multiple sources? Or you want to
involve messaging in the transaction? As for security, you can take it
or
leave it in the EJB model. But wouldn't be a good idea to design a
single
access point for such a resource to encapsulate the security policy? And
wouldn't it be good for that policy to be declarative? And wouldn't you
like
the security credentials to be automatically propogated by the ORB? And
wouldn't you like the roles to be retrieved from the same mechanism used
to
authenticate the user in the first place? And why would you write all
that
when it already exists?

Granted, excessive use of EJB technology just because it is in your
pocket
is not a good design choice. But claiming it is always a bad choice
regardless of circumstances is just as bad if not worse IMHO. Disputing
the
pros/cons of EJB and related technologies with someone who clearly does
not
appreciate the systemic issues the technologies are attempting to
address is
sorta like debating the benefits of MVC with one of those
died-in-the-wool,
you'll-never-change-my-mind, always-choose-the-most-expedient-route
Model 1
programmers we've all run up against. They're so indoctrinated with
their
own BS that they just can't see anything else.

Jim Cakalic

 -Original Message-
 From: Struts Newsgroup [mailto:[EMAIL PROTECTED]]
 Sent: Wednesday, February 20, 2002 12:25 PM
 To: [EMAIL PROTECTED]
 Subject: Re: EJB = bad = MS.net
 
 
 Subject: Re: EJB = bad = MS.net
 From: Vic Cekvenich [EMAIL PROTECTED]
  ===
 
 Transaction: DBs have it; or you can have a Java Bean, that has 2 
 JavaBeans in it, and all have a commit() method. You use EJB for a 
 commit()?
 Security? :
 -Menu based based on a role (using Struts-menu), some items 
 are disabled 
 based on your role.
 -JAAS JDBC Realms (I also get groupID)
 -Based groupID some rows retrieved / selected are editable, 
 some RO and 
 some invisible on your selects. It's called row based security.
 - Status based, based on a status of a row, some fileds become RO.
 
 EJBs give you 0 useful security.
 
 EJBs are also very slow to develop, and they distract developers to 
 develop technology and not solve a business problems. They 
 are also  
 slow to execute, thus they are only suitable for small 
 applications with 
 low volume (and for organizations where a profit margin is 
 not important 
 or on going cost of operations is not important).
 THere are some with EJB and and some resumes with EJBs are by 
 people who 
 have written a laboratory hello world ejb and never 
 actually used them 
 in production deployed where there is volume.
 
 Custom RowSet can code circles around a large team of EJB 
 developers.
 OK, its a Flame: I have a bridge for sale by a smooth talking 
 sales guy, 
 aka The emperor is not wearing any clothes.
 
 Vic
 
 Carl Sziebert wrote:
 
  Just a question for those of you who knock EJBs... How is 
 it that you
  plan to provide transaction management and security within your
  applications?  Going straight to the database won't provide that for
  you.  This whole debate makes me wonder how many people really
  understand Java and quality application design.  I suggest 
 that anyone
  with questions get themselves a copy of Pro JSP Site Design 
 by Wrox.  It
  might help.
  
  This debate has the potential to go on for a while...  
 Sorry, but I just
  had to add my 2 cents.
  
  -Original Message-
  From: Vic Cekvenich [mailto:[EMAIL PROTECTED]] 
  Sent: Wednesday, February 20, 2002 9:42 AM
  To: Struts Users Mailing List
  Cc: [EMAIL PROTECTED]
  Subject: EJB = bad = MS.net
  
  Home page of Jakarta has this
  http://jakarta.apache.org/site/news.html#0130.2
  on this:
  
http://www.mail-archive.com/general%40jakarta.apache.org/msg03376.html
 
 I agree. Doing EJBs is bad on many levels and creates more problems. 
 Avoid EJB if you want to stay in Java.
 
 Alternative is to just use Struts + TomCat + RowSet (or DAO if you are

 doing something simple or small) and done. This is the sweet spot. MVC

 is all you need.
 
 Alternative, do EJBs and your organization WILL switch to MS .NET on
the
 
 next project, leave J2EE, and you have to learn VB.net.
 
 EJBs are for newbies. (If you need middleware (very rare) use SOAP)
 
 lol,
 Vic
 
 
 
 --
 To unsubscribe, e-mail:
 mailto:[EMAIL PROTECTED]
 

RE: EJB = bad = MS.net

2002-02-20 Thread Pu Huang

Depends on the project size.


-Original Message-
From: Thompson, Darryl [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, February 20, 2002 2:28 PM
To: Struts Users Mailing List
Subject: RE: EJB = bad = MS.net


 I STRONGLY disagree with this statement. We have been doing EJBs for 2 yrs
at my shop. Our Order Entry system  uses EJBs to capture customer orders in
36 cities (US) in every US timezone and we have had nothing but success. By
the way there is NO reason to buy BEA weblogic unless you are running EJBs
and don't trust JBOSS (which I do). Tomcat is much better at serving
webpages the WLS or Websphere, EJBs are one of the cornerstones of J2EE,
wake up Vic...

 -Original Message-
 From: Vic Cekvenich [SMTP:[EMAIL PROTECTED]]
 Sent: Wednesday, February 20, 2002 11:42 AM
 To:   Struts Users Mailing List
 Cc:   [EMAIL PROTECTED]
 Subject:  EJB = bad = MS.net
 
 Home page of Jakarta has this
 http://jakarta.apache.org/site/news.html#0130.2
 on this:
 http://www.mail-archive.com/general%40jakarta.apache.org/msg03376.html
 
 I agree. Doing EJBs is bad on many levels and creates more problems. 
 Avoid EJB if you want to stay in Java.
 
 Alternative is to just use Struts + TomCat + RowSet (or DAO if you are 
 doing something simple or small) and done. This is the sweet spot. MVC 
 is all you need.
 
 Alternative, do EJBs and your organization WILL switch to MS .NET on the 
 next project, leave J2EE, and you have to learn VB.net.
 
 EJBs are for newbies. (If you need middleware (very rare) use SOAP)
 
 lol,
 Vic
 
 
 
 --
 To unsubscribe, e-mail:
 mailto:[EMAIL PROTECTED]
 For additional commands, e-mail:
 mailto:[EMAIL PROTECTED]

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

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




RE: EJB = bad = MS.net

2002-02-20 Thread keithBacon

 Ever tried to do a distributed transaction across multiple database
 connections?
Hardly ever never needed them. When we did we wished for EJB's.
I'd strongly recommend putting all your data on 1 big relational database so a
transaction can be managed by it. This is far simpler than EJB's. Of course
this isn't always possible - but you distribute data when you are forced to -
not coz it's more high tech fun.
Example - in the UK big companies buy a copy of the Post Office Address
database   some software to call in their systems. Hundreds of companies
install the same software  get regular database updates. Some time soon
they'll just do an EJB call to a Post Office server - much better!
Another example - online checking of credit details - 1 credit company services
hundreds of users - code on it's server must be called from servers all over
the place.
These are a requirement of a minority of systems. I fear that over-use of EJB
by people who aren't skilled/experienced enough is going to give java a bad
name!  Microsoft is gunning for us. Vic is mostly right - forget EJB's use
them only if you are driven to it ie. there is a significant real requirement.
If high volumes are required you will need to performance test your app  have
expert tuners available etc.
Time for some-one to complain - this is off topic!
PS I never used EJB's but looked into them  recommended my company not use
them  I was right.


--- Cakalic, James [EMAIL PROTECTED] wrote:
 Hmm. And this guy claims to be training other developers using Struts. If
 this is the kind of ranting that goes on in his book then its no longer a
 wonder to me why people have blasted it so mercilessly.
 
 Ever tried to do a distributed transaction across multiple database
 connections? Hard enough without substantial design even when they are all
 targeting the same physical database. Now try a distributed database. What
 if your enterprise data is coming from multiple sources? Or you want to
 involve messaging in the transaction? As for security, you can take it or
 leave it in the EJB model. But wouldn't be a good idea to design a single
 access point for such a resource to encapsulate the security policy? And
 wouldn't it be good for that policy to be declarative? And wouldn't you like
 the security credentials to be automatically propogated by the ORB? And
 wouldn't you like the roles to be retrieved from the same mechanism used to
 authenticate the user in the first place? And why would you write all that
 when it already exists?
 
 Granted, excessive use of EJB technology just because it is in your pocket
 is not a good design choice. But claiming it is always a bad choice
 regardless of circumstances is just as bad if not worse IMHO. Disputing the
 pros/cons of EJB and related technologies with someone who clearly does not
 appreciate the systemic issues the technologies are attempting to address is
 sorta like debating the benefits of MVC with one of those died-in-the-wool,
 you'll-never-change-my-mind, always-choose-the-most-expedient-route Model 1
 programmers we've all run up against. They're so indoctrinated with their
 own BS that they just can't see anything else.
 
 Jim Cakalic
 
  -Original Message-
  From: Struts Newsgroup [mailto:[EMAIL PROTECTED]]
  Sent: Wednesday, February 20, 2002 12:25 PM
  To: [EMAIL PROTECTED]
  Subject: Re: EJB = bad = MS.net
  
  
  Subject: Re: EJB = bad = MS.net
  From: Vic Cekvenich [EMAIL PROTECTED]
   ===
  
  Transaction: DBs have it; or you can have a Java Bean, that has 2 
  JavaBeans in it, and all have a commit() method. You use EJB for a 
  commit()?
  Security? :
  -Menu based based on a role (using Struts-menu), some items 
  are disabled 
  based on your role.
  -JAAS JDBC Realms (I also get groupID)
  -Based groupID some rows retrieved / selected are editable, 
  some RO and 
  some invisible on your selects. It's called row based security.
  - Status based, based on a status of a row, some fileds become RO.
  
  EJBs give you 0 useful security.
  
  EJBs are also very slow to develop, and they distract developers to 
  develop technology and not solve a business problems. They 
  are also  
  slow to execute, thus they are only suitable for small 
  applications with 
  low volume (and for organizations where a profit margin is 
  not important 
  or on going cost of operations is not important).
  THere are some with EJB and and some resumes with EJBs are by 
  people who 
  have written a laboratory hello world ejb and never 
  actually used them 
  in production deployed where there is volume.
  
  Custom RowSet can code circles around a large team of EJB 
  developers.
  OK, its a Flame: I have a bridge for sale by a smooth talking 
  sales guy, 
  aka The emperor is not wearing any clothes.
  
  Vic
  
  Carl Sziebert wrote:
  
   Just a question for those of you who knock EJBs... How is 
  it that you
   plan to provide transaction management and security within your
   

submitting with link

2002-02-20 Thread Syed Niaz


Hi

Iam unable to submit a form using a link 

function fna()
{
alert(document.forms[0].name);
document.forms[0].submit ;
}
html:link href=javascript:fna()click/html:link

No error is generated , but the screen simply does not move to the location defined in 
struts.config .

Instead , html:link page=/convert.do?name=aasfsdfsfsfsdf /html:link works but 
iam unable to assign values to hidden variables .

Thanks ,

Regards,
Syed Niaz 


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




Re: EJB = bad = MS.net

2002-02-20 Thread @Basebeans.com

Subject: Re: EJB = bad = MS.net
From: Vic Cekvenich [EMAIL PROTECTED]
 ===
more flame
I just agreed with what was on the home page of Jakarta.
EJB / smejb.
I am not talking about hello world ejbs.
Those are features you list. To many features is sort of like building a 
submarine that is also a law mower. A distributed database?
Nice features theoretically. In practice KISS.

Elegant is more flexible, complex is just complex.

We can all have a different opinion. I think the CW is use EJB 
sometimes, not all the time. I would use it less, you would use it more.


(Every one of my class reviews by every students is posted publicly at 
news.basebeans.com)


Cakalic, James wrote:

 Hmm. And this guy claims to be training other developers using Struts. If
 this is the kind of ranting that goes on in his book then its no longer a
 wonder to me why people have blasted it so mercilessly.
 
 Ever tried to do a distributed transaction across multiple database
 connections? Hard enough without substantial design even when they are all
 targeting the same physical database. Now try a distributed database. What
 if your enterprise data is coming from multiple sources? Or you want to
 involve messaging in the transaction? As for security, you can take it or
 leave it in the EJB model. But wouldn't be a good idea to design a single
 access point for such a resource to encapsulate the security policy? And
 wouldn't it be good for that policy to be declarative? And wouldn't you like
 the security credentials to be automatically propogated by the ORB? And
 wouldn't you like the roles to be retrieved from the same mechanism used to
 authenticate the user in the first place? And why would you write all that
 when it already exists?
 
 Granted, excessive use of EJB technology just because it is in your pocket
 is not a good design choice. But claiming it is always a bad choice
 regardless of circumstances is just as bad if not worse IMHO. Disputing the
 pros/cons of EJB and related technologies with someone who clearly does not
 appreciate the systemic issues the technologies are attempting to address is
 sorta like debating the benefits of MVC with one of those died-in-the-wool,
 you'll-never-change-my-mind, always-choose-the-most-expedient-route Model 1
 programmers we've all run up against. They're so indoctrinated with their
 own BS that they just can't see anything else.
 
 Jim Cakalic
 
 
-Original Message-
From: Struts Newsgroup [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, February 20, 2002 12:25 PM
To: [EMAIL PROTECTED]
Subject: Re: EJB = bad = MS.net


Subject: Re: EJB = bad = MS.net
From: Vic Cekvenich [EMAIL PROTECTED]
 ===

Transaction: DBs have it; or you can have a Java Bean, that has 2 
JavaBeans in it, and all have a commit() method. You use EJB for a 
commit()?
Security? :
-Menu based based on a role (using Struts-menu), some items 
are disabled 
based on your role.
-JAAS JDBC Realms (I also get groupID)
-Based groupID some rows retrieved / selected are editable, 
some RO and 
some invisible on your selects. It's called row based security.
- Status based, based on a status of a row, some fileds become RO.

EJBs give you 0 useful security.

EJBs are also very slow to develop, and they distract developers to 
develop technology and not solve a business problems. They 
are also  
slow to execute, thus they are only suitable for small 
applications with 
low volume (and for organizations where a profit margin is 
not important 
or on going cost of operations is not important).
THere are some with EJB and and some resumes with EJBs are by 
people who 
have written a laboratory hello world ejb and never 
actually used them 
in production deployed where there is volume.

Custom RowSet can code circles around a large team of EJB 
developers.
OK, its a Flame: I have a bridge for sale by a smooth talking 
sales guy, 
aka The emperor is not wearing any clothes.

Vic

Carl Sziebert wrote:


Just a question for those of you who knock EJBs... How is 

it that you

plan to provide transaction management and security within your
applications?  Going straight to the database won't provide that for
you.  This whole debate makes me wonder how many people really
understand Java and quality application design.  I suggest 

that anyone

with questions get themselves a copy of Pro JSP Site Design 

by Wrox.  It

might help.

This debate has the potential to go on for a while...  

Sorry, but I just

had to add my 2 cents.

-Original Message-
From: Vic Cekvenich [mailto:[EMAIL PROTECTED]] 
Sent: Wednesday, February 20, 2002 9:42 AM
To: Struts Users Mailing List
Cc: [EMAIL PROTECTED]
Subject: EJB = bad = MS.net

Home page of Jakarta has this
http://jakarta.apache.org/site/news.html#0130.2
on this:


 http://www.mail-archive.com/general%40jakarta.apache.org/msg03376.html
 
I agree. Doing EJBs is bad on many levels and creates more problems. 
Avoid EJB if you want to stay in Java.

Alternative is to just 

RE: Struts support for body background image??

2002-02-20 Thread Matt Raible

In that case, I'd recommend using a forward to define the path then using
html:rewrite forward=name to do this.

HTH,

Matt

--- Greg Hess [EMAIL PROTECTED] wrote:
 Matt,
 
 I am following Ted's struts-stub example and using a directory structure
 within WEB-INF to hold all my pages(jsp, html).
 I like this approach as it forces all requests for my pages to go threw the
 ActionServlet(controller) and also protects all my pages from unauthorized
 access. I can do all my login checks in the Action an be assured no one will
 be able to bookmark a page. I feel my web applications are different than my
 web site. The web site has static pages and can allow the visitor to
 traverse the site any way he/she wishes. The web application is a controlled
 sequence of processes, generally each page has data requirements that must
 be met, I don't want my clients to be able to access the pages out of turn.
 So my images cannot reside within the WEB-INF dir and I am required to
 supply a context path instead of a relative path.
 
 Greg
 
 -Original Message-
 From: Matt Raible [mailto:[EMAIL PROTECTED]]
 Sent: Tuesday, February 19, 2002 3:19 PM
 To: Struts Users Mailing List
 Subject: Re: Struts support for body background image??
 
 
 why not just use a relative path images/background.gif and put images in
 the
 same directory as your JSPs?  Or you could use CSS to set this.
 
 Matt
 
 --- Jim Crossley [EMAIL PROTECTED] wrote:
  The only problem with that is that you have to account for your
  context path somewhere, and you probably shouldn't do that in your
  resources properties file.  You'd have to do something like this:
 
  body background=%=request.getContextPath()%bean:message
  key='mybackground'/
 
  Kinda gross, huh?  Maybe there should be a struts html:body tag?
 
  -- Jim
 
  Low, Liang [EMAIL PROTECTED] writes:
 
   I'll just do this
  
   body background=bean:message key=mybackground
  
   and have mybackground refers to /images/background.jpg in
   ApplicationResource.properties
  
   Liang
  
  
   -Original Message-
   From: Greg Hess [mailto:[EMAIL PROTECTED]]
   Sent: Tuesday, February 19, 2002 11:25 AM
   To: Struts Mail List
   Subject: Struts support for body background image??
  
  
   Hi All,
  
   I would like to avoid writing a scriplet in my jsp to provide a
 background
   image.
   body background=%=request.getContextPath()%/images/background.jpg
   Does anyone know an alternate solution, or if Struts plans to provide a
   html:body
   tag in the future?
  
   Thanks,
   Greg
  
  
   --
   To unsubscribe, e-mail:
   mailto:[EMAIL PROTECTED]
   For additional commands, e-mail:
   mailto:[EMAIL PROTECTED]
  
   --
   To unsubscribe, e-mail:
  mailto:[EMAIL PROTECTED]
   For additional commands, e-mail:
  mailto:[EMAIL PROTECTED]
 
  --
  To unsubscribe, e-mail:
 mailto:[EMAIL PROTECTED]
  For additional commands, e-mail:
 mailto:[EMAIL PROTECTED]
 
 
 
 __
 Do You Yahoo!?
 Yahoo! Sports - Coverage of the 2002 Olympic Games
 http://sports.yahoo.com
 
 --
 To unsubscribe, e-mail:
 mailto:[EMAIL PROTECTED]
 For additional commands, e-mail:
 mailto:[EMAIL PROTECTED]
 
 
 
 --
 To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
 For additional commands, e-mail: mailto:[EMAIL PROTECTED]
 


__
Do You Yahoo!?
Yahoo! Sports - Coverage of the 2002 Olympic Games
http://sports.yahoo.com

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




RE: EJB = bad = MS.net

2002-02-20 Thread Couball, James

Depends on the project requirements.

Transactions across multiple data sources being a big one.
Large and scalable being another.

...what are the others?

Although his words say something different, maybe Vic is arguing that MS
does this better/easier/cheaper than J2EE -- not that J2EE is fundamentally
bad. 

James.

-Original Message-
From: Pu Huang [mailto:[EMAIL PROTECTED]] 
Sent: Wednesday, February 20, 2002 11:37 AM
To: 'Struts Users Mailing List'
Subject: RE: EJB = bad = MS.net

Depends on the project size.


-Original Message-
From: Thompson, Darryl [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, February 20, 2002 2:28 PM
To: Struts Users Mailing List
Subject: RE: EJB = bad = MS.net


 I STRONGLY disagree with this statement. We have been doing EJBs for 2 yrs
at my shop. Our Order Entry system  uses EJBs to capture customer orders in
36 cities (US) in every US timezone and we have had nothing but success. By
the way there is NO reason to buy BEA weblogic unless you are running EJBs
and don't trust JBOSS (which I do). Tomcat is much better at serving
webpages the WLS or Websphere, EJBs are one of the cornerstones of J2EE,
wake up Vic...

 -Original Message-
 From: Vic Cekvenich [SMTP:[EMAIL PROTECTED]]
 Sent: Wednesday, February 20, 2002 11:42 AM
 To:   Struts Users Mailing List
 Cc:   [EMAIL PROTECTED]
 Subject:  EJB = bad = MS.net
 
 Home page of Jakarta has this
 http://jakarta.apache.org/site/news.html#0130.2
 on this:
 http://www.mail-archive.com/general%40jakarta.apache.org/msg03376.html
 
 I agree. Doing EJBs is bad on many levels and creates more problems. 
 Avoid EJB if you want to stay in Java.
 
 Alternative is to just use Struts + TomCat + RowSet (or DAO if you are 
 doing something simple or small) and done. This is the sweet spot. MVC 
 is all you need.
 
 Alternative, do EJBs and your organization WILL switch to MS .NET on the 
 next project, leave J2EE, and you have to learn VB.net.
 
 EJBs are for newbies. (If you need middleware (very rare) use SOAP)
 
 lol,
 Vic
 
 
 
 --
 To unsubscribe, e-mail:
 mailto:[EMAIL PROTECTED]
 For additional commands, e-mail:
 mailto:[EMAIL PROTECTED]

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

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

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




RE: EJB = bad = MS.net

2002-02-20 Thread keithBacon

Well done  congratulations - I suspect you guys are a good quality outfit!
My criticism of EJB mostly is extrapolated from looking at legacy client server
systems where new technology was rushed into by zealots  left horrible
problems for years.
Did you use them because you needed distributed database or for other reasons?
K.


--- Thompson, Darryl [EMAIL PROTECTED] wrote:
  I STRONGLY disagree with this statement. We have been doing EJBs for 2 yrs
 at my shop. Our Order Entry system  uses EJBs to capture customer orders in
 36 cities (US) in every US timezone and we have had nothing but success. By
 the way there is NO reason to buy BEA weblogic unless you are running EJBs
 and don't trust JBOSS (which I do). Tomcat is much better at serving
 webpages the WLS or Websphere, EJBs are one of the cornerstones of J2EE,
 wake up Vic...
 
  -Original Message-
  From:   Vic Cekvenich [SMTP:[EMAIL PROTECTED]]
  Sent:   Wednesday, February 20, 2002 11:42 AM
  To: Struts Users Mailing List
  Cc: [EMAIL PROTECTED]
  Subject:EJB = bad = MS.net
  
  Home page of Jakarta has this
  http://jakarta.apache.org/site/news.html#0130.2
  on this:
  http://www.mail-archive.com/general%40jakarta.apache.org/msg03376.html
  
  I agree. Doing EJBs is bad on many levels and creates more problems. 
  Avoid EJB if you want to stay in Java.
  
  Alternative is to just use Struts + TomCat + RowSet (or DAO if you are 
  doing something simple or small) and done. This is the sweet spot. MVC 
  is all you need.
  
  Alternative, do EJBs and your organization WILL switch to MS .NET on the 
  next project, leave J2EE, and you have to learn VB.net.
  
  EJBs are for newbies. (If you need middleware (very rare) use SOAP)
  
  lol,
  Vic
  
  
  
  --
  To unsubscribe, e-mail:
  mailto:[EMAIL PROTECTED]
  For additional commands, e-mail:
  mailto:[EMAIL PROTECTED]
 
 --
 To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
 For additional commands, e-mail: mailto:[EMAIL PROTECTED]
 


=
~~
Search the archive:-
http://www.mail-archive.com/struts-user%40jakarta.apache.org/
~~
Keith Bacon - Looking for struts work - South-East UK.
phone UK 07960 011275

__
Do You Yahoo!?
Yahoo! Sports - Coverage of the 2002 Olympic Games
http://sports.yahoo.com

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




Business logic beans

2002-02-20 Thread Daniel Steinberg

The Struts User's Guide suggests that business logic be encapsulated in
beans.  Business logic modules are generally stateless, so one would
generally implement them as static utility classes (with only static
methods) or singletons (with private constructors and static factory
methods), neither of which can be beans (which, by definition, have public
constructors).  To effectively manage stateless classes as beans (without
re-instantiating them for each use), one would have to implement a
lookup/mapping mechanism (an EJB-lite).  Are the Struts developers
suggesting that we develop such mechansisms?  Might such a mechanism be
slated for a future version of Struts?


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




RE: submitting with link

2002-02-20 Thread Brian Richards

You need to make the submit a method call.

document.forms[0].submit();


bsr

-Original Message-
From: Syed Niaz [mailto:[EMAIL PROTECTED]] 
Sent: Wednesday, February 20, 2002 8:51 AM
To: Struts Users Mailing List
Subject: submitting with link



Hi

Iam unable to submit a form using a link 

function fna()
{
alert(document.forms[0].name);
document.forms[0].submit ;
}
html:link href=javascript:fna()click/html:link

No error is generated , but the screen simply does not move to the
location defined in struts.config .

Instead , html:link page=/convert.do?name=aasfsdfsfsfsdf
/html:link works but iam unable to assign values to hidden variables .

Thanks ,

Regards,
Syed Niaz 


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





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




Re: EJB = bad = MS.net

2002-02-20 Thread @Basebeans.com

Subject: Re: EJB = bad = MS.net
From: Vic Cekvenich [EMAIL PROTECTED]
 ===
Let me clarify and then do some paid work back here.

1.I think ejbs are not scalable relative to other Java API.

2. I do not want majority of market to go to MS.net. That is why I wish 
  that more J2EE projects are successful. (And hence I say use EJB 
sometimes, not always, and consider the pros and cons.)

Maybe PHBs like EJBs, I don't; and that is my opinion, but maybe not 
politically correct.
Vic



Couball, James wrote:

 Depends on the project requirements.
 
 Transactions across multiple data sources being a big one.
 Large and scalable being another.
 
 ...what are the others?
 
 Although his words say something different, maybe Vic is arguing that MS
 does this better/easier/cheaper than J2EE -- not that J2EE is fundamentally
 bad. 
 
 James.
 
 -Original Message-
 From: Pu Huang [mailto:[EMAIL PROTECTED]] 
 Sent: Wednesday, February 20, 2002 11:37 AM
 To: 'Struts Users Mailing List'
 Subject: RE: EJB = bad = MS.net
 
 Depends on the project size.
 
 
 -Original Message-
 From: Thompson, Darryl [mailto:[EMAIL PROTECTED]]
 Sent: Wednesday, February 20, 2002 2:28 PM
 To: Struts Users Mailing List
 Subject: RE: EJB = bad = MS.net
 
 
  I STRONGLY disagree with this statement. We have been doing EJBs for 2 yrs
 at my shop. Our Order Entry system  uses EJBs to capture customer orders in
 36 cities (US) in every US timezone and we have had nothing but success. By
 the way there is NO reason to buy BEA weblogic unless you are running EJBs
 and don't trust JBOSS (which I do). Tomcat is much better at serving
 webpages the WLS or Websphere, EJBs are one of the cornerstones of J2EE,
 wake up Vic...
 
 
-Original Message-
From: Vic Cekvenich [SMTP:[EMAIL PROTECTED]]
Sent: Wednesday, February 20, 2002 11:42 AM
To:   Struts Users Mailing List
Cc:   [EMAIL PROTECTED]
Subject:  EJB = bad = MS.net

Home page of Jakarta has this
http://jakarta.apache.org/site/news.html#0130.2
on this:
http://www.mail-archive.com/general%40jakarta.apache.org/msg03376.html

I agree. Doing EJBs is bad on many levels and creates more problems. 
Avoid EJB if you want to stay in Java.

Alternative is to just use Struts + TomCat + RowSet (or DAO if you are 
doing something simple or small) and done. This is the sweet spot. MVC 
is all you need.

Alternative, do EJBs and your organization WILL switch to MS .NET on the 
next project, leave J2EE, and you have to learn VB.net.

EJBs are for newbies. (If you need middleware (very rare) use SOAP)

lol,
Vic



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

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


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




Re: EJB = bad = MS.net

2002-02-20 Thread Pete Carapetyan

Vic's points are actually becoming quite mainstream, but he gets a big shiny apple
for making himself such a big target. Many people, including serious dudes, have
said the same thing, perhaps in a smoother way.

When discussing adding an EJB module to webAppWriter, and one senior Sun engineer
who shall go un-named suggested to pursue all other pieces first. Everybody is
moving away from EJB's right now is I think the direct quote.

Even critics say that there is always a use for EJB's, if not as wide as some might
have initially presumed.

Struts Newsgroup (@Basebeans.com) wrote:

 Subject: Re: EJB = bad = MS.net
 From: Vic Cekvenich [EMAIL PROTECTED]
  ===
 Let me clarify and then do some paid work back here.

 1.I think ejbs are not scalable relative to other Java API.

 2. I do not want majority of market to go to MS.net. That is why I wish
   that more J2EE projects are successful. (And hence I say use EJB
 sometimes, not always, and consider the pros and cons.)

 Maybe PHBs like EJBs, I don't; and that is my opinion, but maybe not
 politically correct.
 Vic

 Couball, James wrote:

  Depends on the project requirements.
 
  Transactions across multiple data sources being a big one.
  Large and scalable being another.
 
  ...what are the others?
 
  Although his words say something different, maybe Vic is arguing that MS
  does this better/easier/cheaper than J2EE -- not that J2EE is fundamentally
  bad.
 
  James.
 
  -Original Message-
  From: Pu Huang [mailto:[EMAIL PROTECTED]]
  Sent: Wednesday, February 20, 2002 11:37 AM
  To: 'Struts Users Mailing List'
  Subject: RE: EJB = bad = MS.net
 
  Depends on the project size.
 
 
  -Original Message-
  From: Thompson, Darryl [mailto:[EMAIL PROTECTED]]
  Sent: Wednesday, February 20, 2002 2:28 PM
  To: Struts Users Mailing List
  Subject: RE: EJB = bad = MS.net
 
 
   I STRONGLY disagree with this statement. We have been doing EJBs for 2 yrs
  at my shop. Our Order Entry system  uses EJBs to capture customer orders in
  36 cities (US) in every US timezone and we have had nothing but success. By
  the way there is NO reason to buy BEA weblogic unless you are running EJBs
  and don't trust JBOSS (which I do). Tomcat is much better at serving
  webpages the WLS or Websphere, EJBs are one of the cornerstones of J2EE,
  wake up Vic...
 
 
 -Original Message-
 From: Vic Cekvenich [SMTP:[EMAIL PROTECTED]]
 Sent: Wednesday, February 20, 2002 11:42 AM
 To:   Struts Users Mailing List
 Cc:   [EMAIL PROTECTED]
 Subject:  EJB = bad = MS.net
 
 Home page of Jakarta has this
 http://jakarta.apache.org/site/news.html#0130.2
 on this:
 http://www.mail-archive.com/general%40jakarta.apache.org/msg03376.html
 
 I agree. Doing EJBs is bad on many levels and creates more problems.
 Avoid EJB if you want to stay in Java.
 
 Alternative is to just use Struts + TomCat + RowSet (or DAO if you are
 doing something simple or small) and done. This is the sweet spot. MVC
 is all you need.
 
 Alternative, do EJBs and your organization WILL switch to MS .NET on the
 next project, leave J2EE, and you have to learn VB.net.
 
 EJBs are for newbies. (If you need middleware (very rare) use SOAP)
 
 lol,
 Vic
 
 
 
 --
 To unsubscribe, e-mail:
 mailto:[EMAIL PROTECTED]
 For additional commands, e-mail:
 mailto:[EMAIL PROTECTED]
 
 
  --
  To unsubscribe, e-mail:
  mailto:[EMAIL PROTECTED]
  For additional commands, e-mail:
  mailto:[EMAIL PROTECTED]
 
  --
  To unsubscribe, e-mail:
  mailto:[EMAIL PROTECTED]
  For additional commands, e-mail:
  mailto:[EMAIL PROTECTED]
 
  --
  To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
  For additional commands, e-mail: mailto:[EMAIL PROTECTED]
 

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


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




Re: struts-example won't run

2002-02-20 Thread @Basebeans.com

Subject: Re: struts-example won't run
From: Wendy S [EMAIL PROTECTED]
 ===
I wrote about an error with struts-example:
  Error: 500
  Location: /struts-example/logon.jsp
  Internal Servlet Error:
  javax.servlet.ServletException: cant remove Attributes from request
scope
  Root cause:
  java.lang.IllegalArgumentException: cant remove Attributes from request
  scope

keithBacon [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]...
 This is such a pain - it happens lots  I have no easy answer. I found
 http://www.mail-archive.com/struts-user@jakarta.apache.org/msg19383.html
 
 http://www.mail-archive.com/struts-user@jakarta.apache.org/msg18817.html

(Is top posting preferred here?)

Okay, I've downloaded the source and based on those two postings, have
edited the doEndTag method in FormTag.  Can someone walk me through what to
do next?  I'm sure I need to compile that class again.  But how do I get the
new .class file into the struts.jar file?

I usually just download, configure, and have at the examples... I've never
had to change source code before.

Thanks for your help,
--
Wendy



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




RE: struts-example won't run

2002-02-20 Thread Subhadra Vemuri

I had the same problem too - and I didn't have to
change any source code. I just reinstalled
tomcat and all my troubles were gone. It just
worked without any changes. I downloaded
tomcat version 3.3a.

Subhadra


-Original Message-
From: Struts Newsgroup [mailto:@[EMAIL PROTECTED]]
Sent: Wednesday, February 20, 2002 12:25 PM
To: [EMAIL PROTECTED]
Subject: Re: struts-example won't run


Subject: Re: struts-example won't run
From: Wendy S [EMAIL PROTECTED]
 ===
I wrote about an error with struts-example:
  Error: 500
  Location: /struts-example/logon.jsp
  Internal Servlet Error:
  javax.servlet.ServletException: cant remove Attributes from request
scope
  Root cause:
  java.lang.IllegalArgumentException: cant remove Attributes from request
  scope

keithBacon [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]...
 This is such a pain - it happens lots  I have no easy answer. I found
 http://www.mail-archive.com/struts-user@jakarta.apache.org/msg19383.html
 
 http://www.mail-archive.com/struts-user@jakarta.apache.org/msg18817.html

(Is top posting preferred here?)

Okay, I've downloaded the source and based on those two postings, have
edited the doEndTag method in FormTag.  Can someone walk me through what to
do next?  I'm sure I need to compile that class again.  But how do I get the
new .class file into the struts.jar file?

I usually just download, configure, and have at the examples... I've never
had to change source code before.

Thanks for your help,
--
Wendy



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



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




RE: EJB = bad = MS.net

2002-02-20 Thread Cakalic, James

Even if all the data is in a single physical RDBMS instance, your design has
to take one of several paths to deal with transactional issues.

The first path is to ignore transactions. Just pretend like those pesky
suckers don't even exist. Get a connection, leave it in autocommit mode, do
what you want, hope everything works. Partial updates? That's why we have a
DBA, isn't it?

The second path would be to recognize that there are transactional concerns
which must be addressed. The simplest way to address this, I suppose, is to
get a connection, disable autocommit, and proceed to execute a big in-line
blob of code to perform the necessary database operations. Assuming there
are not problems, commit. Of course, I'd expect to see a good bit of
duplicate code throughout your application. Another alternative is to
actually have a persistence layer that encapsulates access to the database.
One common approach is to have a manager class for each table. So you could
still get a connection, turn off autocommit, and start passing it around to
all the manager classes that want to manipulate the database so that they
all do so across a single connection. Better though, would be to permit
these managers to get a connection the connection from a common source.
Maybe a thread-based resource manager that would hand out the same
connection repeatedly until it was removed. Your 'controller' class would
then coordinate the transaction by getting a connection, turn off
autocommit, associating it with the thread-based resource manager, call on
table managers and other components to do their jobs, and at the end, get
the connection back from the resource manager and commit or rollback as
necessary.

Another path similar to the above would be possible when your database
drivers are XA-compliant. Then you could a connection from wherever and use
the XA capabilities of the drivers to enlist it in the global transaction.
Of course, now you've distributed the responsibility for transaction
management all over the place. You'd really want to write some kind of
connection pool class that would encapsulate the details of this for you as
they are not trivial. Not likely to be very performant either, getting all
those different database connections. And in both this case, and the case
abbove, you'd really want to prevent someone circumventing the transaction
management by calling commit or rollback on the connection being used. This
should really be disallowed.

Finally, one might take a look at some of the above and realize, Geez! I
just set out to design a transaction manager that already exists in my
EJB-compliant application server. Maybe I should just use it and get the
benefits of container-managed distributed transactions straight out of the
box.

Frankly, this is the approach my team is taking. We've done entity beans --
quite a few actually applying best practices and patterns from Sun, IBM, and
community resources like theServerSide.com -- and decided that they really
weren't the way for us to go. But we haven't abandoned EJB, either. Instead,
we've adopted a command pattern in which reusable units of business logic
are encapsulated in classes that follow a common implementation pattern. All
our data access is being done through manager classes that use direct JDBC
(we autogenerate these using a tool based on sql2java). We set up a
DataSource pool in our application server that provides JTA-enabled
connections to our Oracle database. When commands are instantiated and
executed, they are 'sent' to a stateless session bean for execution. That
bean's executeCommand method has been configured with transaction attributes
of Required/ReadCommitted. If a transaction is not already in progress, one
is started by the container when the method is called. If a transaction is
in progress (commands can call other commands, of course) then the
transaction will be joined. Since the same application server that manages
the transactions is managing the connection pool, it hands out the same
database connection to everyone requesting a connection using the same
connection parameters. One database, one connection for the transaction.
Really, the only code we had to write to deal with transactions was in the
stateless session bean. It catches all exceptions thrown out of the command
it was asked to execute and calls the EJBContext setRollbackOnly method to
ensure the transaction is rolled back. Otherwise, the container takes care
of the commit regardless of the level of nesting of command executions.

IBM WebSphere provided the majority of the command framework implementation
that we are using. But their implementation isn't anything special which
couldn't be developed elsewhere. If you'd like to know more about it, here
are some links:

http://www-106.ibm.com/developerworks/ibm/library/i-extreme13/
http://www-4.ibm.com/software/webservers/appserv/doc/v40/ae/apidocs/com/ibm/
websphere/command/package-summary.html

 -Original Message-
 

How Do I trigger an actionForm reset from an Action

2002-02-20 Thread phil_hershkowitz

Hi,

Could someone give a code snippet that I can use to invoke
the reset method on an actionForm from my Action code?

Thanks,
Phil

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




RE: EJB = bad = MS.net

2002-02-20 Thread Galbreath, Mark

Boy, you'd think it was Friday!

Cheers!
Mark

-Original Message-
From: Pete Carapetyan [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, February 20, 2002 3:25 PM
To: Struts Users Mailing List
Subject: Re: EJB = bad = MS.net


Vic's points are actually becoming quite mainstream, but he gets a big shiny
apple
for making himself such a big target. Many people, including serious dudes,
have
said the same thing, perhaps in a smoother way.

When discussing adding an EJB module to webAppWriter, and one senior Sun
engineer
who shall go un-named suggested to pursue all other pieces first. Everybody
is
moving away from EJB's right now is I think the direct quote.

Even critics say that there is always a use for EJB's, if not as wide as
some might
have initially presumed.

Struts Newsgroup (@Basebeans.com) wrote:

 Subject: Re: EJB = bad = MS.net
 From: Vic Cekvenich [EMAIL PROTECTED]
  ===
 Let me clarify and then do some paid work back here.

 1.I think ejbs are not scalable relative to other Java API.

 2. I do not want majority of market to go to MS.net. That is why I wish
   that more J2EE projects are successful. (And hence I say use EJB
 sometimes, not always, and consider the pros and cons.)

 Maybe PHBs like EJBs, I don't; and that is my opinion, but maybe not
 politically correct.
 Vic

 Couball, James wrote:

  Depends on the project requirements.
 
  Transactions across multiple data sources being a big one.
  Large and scalable being another.
 
  ...what are the others?
 
  Although his words say something different, maybe Vic is arguing that MS
  does this better/easier/cheaper than J2EE -- not that J2EE is
fundamentally
  bad.
 
  James.
 
  -Original Message-
  From: Pu Huang [mailto:[EMAIL PROTECTED]]
  Sent: Wednesday, February 20, 2002 11:37 AM
  To: 'Struts Users Mailing List'
  Subject: RE: EJB = bad = MS.net
 
  Depends on the project size.
 
 
  -Original Message-
  From: Thompson, Darryl [mailto:[EMAIL PROTECTED]]
  Sent: Wednesday, February 20, 2002 2:28 PM
  To: Struts Users Mailing List
  Subject: RE: EJB = bad = MS.net
 
 
   I STRONGLY disagree with this statement. We have been doing EJBs for 2
yrs
  at my shop. Our Order Entry system  uses EJBs to capture customer orders
in
  36 cities (US) in every US timezone and we have had nothing but success.
By
  the way there is NO reason to buy BEA weblogic unless you are running
EJBs
  and don't trust JBOSS (which I do). Tomcat is much better at serving
  webpages the WLS or Websphere, EJBs are one of the cornerstones of J2EE,
  wake up Vic...
 
 
 -Original Message-
 From: Vic Cekvenich [SMTP:[EMAIL PROTECTED]]
 Sent: Wednesday, February 20, 2002 11:42 AM
 To:   Struts Users Mailing List
 Cc:   [EMAIL PROTECTED]
 Subject:  EJB = bad = MS.net
 
 Home page of Jakarta has this
 http://jakarta.apache.org/site/news.html#0130.2
 on this:
 http://www.mail-archive.com/general%40jakarta.apache.org/msg03376.html
 
 I agree. Doing EJBs is bad on many levels and creates more problems.
 Avoid EJB if you want to stay in Java.
 
 Alternative is to just use Struts + TomCat + RowSet (or DAO if you are
 doing something simple or small) and done. This is the sweet spot. MVC
 is all you need.
 
 Alternative, do EJBs and your organization WILL switch to MS .NET on the
 next project, leave J2EE, and you have to learn VB.net.
 
 EJBs are for newbies. (If you need middleware (very rare) use SOAP)
 
 lol,
 Vic
 
 
 
 --
 To unsubscribe, e-mail:
 mailto:[EMAIL PROTECTED]
 For additional commands, e-mail:
 mailto:[EMAIL PROTECTED]
 
 
  --
  To unsubscribe, e-mail:
  mailto:[EMAIL PROTECTED]
  For additional commands, e-mail:
  mailto:[EMAIL PROTECTED]
 
  --
  To unsubscribe, e-mail:
  mailto:[EMAIL PROTECTED]
  For additional commands, e-mail:
  mailto:[EMAIL PROTECTED]
 
  --
  To unsubscribe, e-mail:
mailto:[EMAIL PROTECTED]
  For additional commands, e-mail:
mailto:[EMAIL PROTECTED]
 

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


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

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




RE: Business logic beans

2002-02-20 Thread Robert

Perhaps the term business logic is misleading to an extent. To some,
business logic in JavaBeans can mean that a JavaBean is a stateful
representation of data in a database, that also has 'logic' in it for
other means, such as validation, computation, etc. The term used like
you suggest would fit in a model like stateless session beans, although
something could be developed that isn't EJB. Now you mention a
lookup/mapping mechanism, well look at Avalon
(http://jakarta.apache.org/avalon). It has just such a mechanism. 

I believe in using both approaches, using beans as data and logic as
well as stateless logic components. We use both for our eQ! product and
(slowly) I'm convincing others that we should build it upon Avalon. Our
Struts adapters and our scripting engine (both of which I wrote) use
Avalon for looking up other components. I'm trying to convince the boss
to let me port our persistence layer to use the same framework.

- Robert

-Original Message-
From: Daniel Steinberg [mailto:[EMAIL PROTECTED]] 
Sent: Wednesday, February 20, 2002 12:06 PM
To: '[EMAIL PROTECTED]'
Subject: Business logic beans

The Struts User's Guide suggests that business logic be encapsulated in
beans.  Business logic modules are generally stateless, so one would
generally implement them as static utility classes (with only static
methods) or singletons (with private constructors and static factory
methods), neither of which can be beans (which, by definition, have
public
constructors).  To effectively manage stateless classes as beans
(without
re-instantiating them for each use), one would have to implement a
lookup/mapping mechanism (an EJB-lite).  Are the Struts developers
suggesting that we develop such mechansisms?  Might such a mechanism be
slated for a future version of Struts?


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



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




Re: How Do I trigger an actionForm reset from an Action

2002-02-20 Thread Jim Crossley

[EMAIL PROTECTED] writes:

 Could someone give a code snippet that I can use to invoke
 the reset method on an actionForm from my Action code?

public class YourAction extends Action
{
public ActionForward perform(ActionMapping mapping,
 ActionForm form,
 HttpServletRequest request,
 HttpServletResponse response)
throws ServletException
{
form.reset(mapping, request);
return mapping.findForward(success);
}
}


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




Html:file - practical question

2002-02-20 Thread Rooms, Christoph

Hi,

I'm using a html:file object. It works fine but when my form returns with
Validation errors, he always looses the value of the file path. 

The user always have to select at new the file which ...

Is there a solution ?

thanks

kind regards,
 
Christoph Rooms
Technical Account Manager
SilverStream Software
+32 475 531 529

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




RE: where download struts javadoc?

2002-02-20 Thread Paul Sijpkes

Not sure, but you could download the source code and generate the javadoc from that.

-Original Message-
From: Struts Newsgroup [mailto:@[EMAIL PROTECTED]]
Sent: Wednesday, 20 February 2002 7:55 PM
To: [EMAIL PROTECTED]
Subject: where download struts javadoc?


Subject: where download struts javadoc?
From: zb cong [EMAIL PROTECTED]
 ===
hello
where can i download struts javadoc?
i only find the online version on apache website .



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




Re: How to set attribute via submit

2002-02-20 Thread Victor Hadianto

 same property but different values. If I set the value property of the tag
 then that is displayed as the text of the button. What I need to do is set
 the property and value of the button with a different String for the text
 displayed on the button.

Hi Alex,

This is quite hard to achieve because the way Http POST works. When you click 
on the submit button, the request object contains the following pair:

button name, button text

There are several workarounds to find out which button you click on the form. 
But the easiest way is to declare a setter method on your form that matches 
the button name and in that setter method you set a variable in your form to 
identify which button that the user selects.

IE:

public void setButtonDelete(String ignore) {
action = DELETE_ACTION;
}

public void perform(...) {
switch (form.getAction())
{
case DELETE_ACTION:
...
}
}

If your buttons MUST have all the same name, then the only way to do this is 
for your form bean to know the list of the button labels and sets the action 
accordingly.

HTH,

-- 
Victor Hadianto
---
He who laughs, lasts.

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




  1   2   >