Re: AW: How to submit form in pop-up window and forward parent results page? [OT]

2004-03-11 Thread Guido García Bernardo
Your editItem action, when the update is finished, forwards to 
autoCloseAndReloadOpener.jsp

autoCloseAndReloadOpener.jsp does steps (5) and (6):

html
body onLoad=self.close()
   script
  // Reload opener
  opener.formReload.submit(); // or something like this, using opener
   /scrip
/body
/html
I have not tried it...
Regards
PD. This is not struts related.
[EMAIL PROTECTED] wrote:

Hello bOOyah,

I have had the same problem that you describe. Were you able to solve it?. If so could you share how you did it?

Sam

-Ursprungliche Nachricht-
Von: news [mailto:[EMAIL PROTECTED] Auftrag von bOOyah
Gesendet: Donnerstag, 11. Marz 2004 11:43
An: [EMAIL PROTECTED]
Betreff: Q: How to submit form in pop-up window and forward parent
results page?
Hi all.

(Caveat: this might actually turn out to be a Javascript question):

I would appreciate any help or even alternatives to what I'm trying to 
achieve below:-

Here's a rough sequence of what I'm trying to achieve...

(1) My app has a page displaying an item link.

(2) When the user clicks on the link a pop-up browser window appears 
with a form containing all the details about that item.

(3) After modifying the item's details the user clicks on the form 
Submit button.

(4) The Submit action saves the changes to the database.

(5) The pop-up windows closes.

(6) The original, parent page 'refreshes' to reflect the changes the 
user made in the pop-up windows (e.g. changing the name of the item 
under the link).

I can get as far as step (4) using Struts and Javascript handlers.

Here's how my parent pops-up the item editing window:
--
% String link = javascript:popUp('+
request.getContextPath()+
/editItem.do?action=edititem=+
itemID + ');;
%
. . .
tdhtml:link href=javascript:; onclick=%=link%
c:out value=Edit Item//html:link
/td
--

Here's the form element of my pop-up:
--
% String submitScript = form.submit();
opener.location='+
request.getContextPath()+
/showItemDetails.do';+
self.close();;
%
. . .
html:form action=/saveItem onsubmit=%=submitScript%
--

So I'm submitting the form, telling the parent to forward to the results 
page ('/showItemDetails.do') and closing the pop-up.

But it doesn't work that way:-(

The submission works fine; the data is written to the DB.  But the 
pop-up browser window doesn't close and the parent isn't forwarded to 
the results page.  So I guess once a form is submitted the rest of the 
Javascript just 'disappears' and isn't executed?

Any help out there..?

Many thanks in advance!
 

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


ASP.NET and Struts: Web Application Architectures

2004-03-10 Thread Guido García Bernardo
Interesting reading...

http://msdn.microsoft.com/asp.net/using/migrating/default.aspx?pull=/library/en-us/dnaspp/html/aspnet-aspnet-j2ee-struts.asp#aspnet-aspnet-j2ee-struts_topic4

Regards.

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


Re: Action form

2004-02-24 Thread Guido García Bernardo
I think you are searching for DynaActionForm.

Take a look at http://www.reumann.net/do/struts/lesson3/step4

I personally don't like them because of debug difficulties.

Regards,
Guido.
Pradeep, PK wrote:

Is it mandatory to create ActionForm class for each JSP if we want to
send the form data to action class?
Does it not make the ActionForm class dependent on the UI and liable to
change as an when modifications is done in JSP page? 

Is there a way of dynamically creating the ActionForm class instance
relevant to JSP page which can be used by Action Class?
I am new to struts and pardon me if this question is out of my ignorance
of understanding of struts..
Warm Regards,

Pradeep

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

--
Guido García Bernardo - [EMAIL PROTECTED]
Tfn. +34 983 54 89 08
ITDEUSTO - Valladolid
-BEGIN PGP PUBLIC KEY BLOCK-
Version: GnuPG v1.2.4 (MingW32)
mQGiBEA08WoRBACha4gpug/FDUiKsAyvAOxuHc0IijZf4rBHuGoq/T89cyR5JJrD
X6gsLvvg5q460eU3iMpAnFCNLjOKKpj2kqjfWmtTi551q6dZ3akTzFrohCNnOyXF
4LycMowqnFIrhp1EOi9PPvhlGXwi/C81/yH3RSIubB1R3zCcJSJuccd4XwCgniZk
sfw81etG7nfER7uiTAplDQcD/3pHgANqKc/xY8w/yMfBU7PnPfmsa1nqhpnkiw5X
F9DwU3t8pcswifnTRRgfDX0uxZER/9j4z9nBoTgl/nJaXa2rO3qWpiHaSCIOi51Y
LYhkJkb6zZshDuTereunIf/BKV1qhpUKRCKCu+pDojYic+15ZlVAADRN/hUGSPEL
ec3pA/0fYj2AoPrEuTWiLEwnN0NJM2yIACWQw0GW+pkwFwYqNWDM038UMILNTyWA
VUE5RC8bVYTpZXAOOymSF0uYh2RFkxvzA5B3yt96MEpyho70bNet60Gzf/d6t7qa
HVmG6Z+qmg+9b3FcdpwU/UMy/z9dc6pUi8iABBqxxva65xjlvLQrR3VpZG8gR2Fy
Y2lhIEJlcm5hcmRvIDxndWlkb0B1bml2ZXJzYXMuY29tPoheBBMRAgAeBQJANPFq
AhsDBgsJCAcDAgMVAgMDFgIBAh4BAheAAAoJEBBTGX2qD3YkPtMAn0kk4SUbiHcO
EtXb8guoJmi5TgjaAJ0WMhLJyO2c0EZlG0E9YpGTcowT3LkCDQRANPGKEAgArd4R
6qaWdiRwVMwTMZ+7lcEeMv+X+VD3Iv7uDCvvotwvZEJ4bi29o2nsRo6gxXtGQheg
7UJSWiJfRhfO+19Tbx3PHPOGTJ4pvM99rpKlNcRmmZL8VFmHb7q7p7sZsCVKcR7M
bJjfCmjtsWoSUHoRZ3WEt+lgIrQTo5YvBS8YwdnYYTzKFqQoXOnFVmGfVo2Vfkxe
E1eWq9Fa7zXC2JRB/aXRXe/3gpEokA56CSLZ/fK+mJdIu39q8mmKmZWrpf7nbqJ0
Ibb37FcpcvysWDt0T1Rbbwz4MmU6sf+IEXsPRGqoa90l/hbRV6pC3qO49Q7+ECv0
kIujZFTAhWyP/xDsvwAEDQf/SCCYUmWnvL6PMt9WAcIdMZBbmGinWXgAp+9t8rBc
oXF+2qCuPoL24Jcpt37kPo4XT+Kq5hAe4wzellOMMqMyGFvwGH3APTfCAIDUngnd
kFBvYC3vGhwWPtl2VYh0kiM8CJXA1V8c2hJftDxNVlnPJWg7xOVEEfqILkxYD9xq
YIweNXrx9OBtiFwXQ1OikfAXMM8DtNy2G66/awXo06I5Lmbkn/RMmFKC6mw/DmmO
zqh+9/+RaGvbzrAqhMinI9Irxznfj/ZVmOfZEuGi6R5r1hjs8gVU7P60XV9W8JiM
dDJU48HldOE2LLIE6fKNfZKtln2/yIlOAstK1nhFYuABpohJBBgRAgAJBQJANPGK
AhsMAAoJEBBTGX2qD3YkfQsAni/ESTfETyZv7g9KQDJ8LSH0ajwjAKCaqrnyNBWi
0/52HHRsobw69NSdyA==
=l6cK
-END PGP PUBLIC KEY BLOCK-
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


[OT] Re: IBatis???

2004-02-14 Thread Guido García Bernardo
www.ibatis.com

iBATIS SQL Maps provides a very simple and flexible means of moving data 
between your Java objects and a relational database. Use the full power 
of real SQL without a single line of JDBC code!
http://www.ibatis.com/common/sqlmaps.html

iBATIS DAO is an abstraction layer that hides the details of your 
persistence solution and provides a common API to the rest of your 
application.
http://www.ibatis.com/common/dao.html

Regards

[EMAIL PROTECTED] wrote:

Hi,

can any one tell me what is  IBatis?
where can i get reference doc/tutorial for the same
Thanks and Regards

O. Subramaniam.
Tata Consultancy Services.
Chennai.
Mailto: [EMAIL PROTECTED]
Website: http://www.tcs.com


DISCLAIMER: The information contained in this message is intended only and solely for 
the addressed individual or entity indicated in this message and for the exclusive use 
of the said addressed individual or entity indicated in this message (or responsible 
for delivery
of the message to such person) and may contain legally privileged and confidential 
information belonging to Tata Consultancy Services. It must not be printed, read, 
copied, disclosed, forwarded, distributed or used (in whatsoever manner) by any person 
other than the
addressee. Unauthorized use, disclosure or copying is strictly prohibited and may 
constitute unlawful act and can possibly attract legal action, civil and/or criminal. 
The contents of this message need not necessarily reflect or endorse the views of Tata 
Consultancy Services
on any subject matter. Any action taken or omitted to be taken based on this message 
is entirely at your risk and neither the originator of this message nor Tata 
Consultancy Services takes any responsibility or liability towards the same. Opinions, 
conclusions and any other
information contained in this message that do not relate to the official business of 
Tata Consultancy Services shall be understood as neither given nor endorsed by Tata 
Consultancy Services or any affiliate of Tata Consultancy Services. If you have 
received this message in error,
you should destroy this message and may please notify the sender by e-mail. Thank you.
 



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


[OT] Re: log4j integration

2004-01-27 Thread Guido García Bernardo
This is OT. The word struts in a message is not the only thing it 
needs to be struts related...

Try PropertyConfigurator.configureAndWatch, I think that is what you are 
searching for...
You cand find a simple example at 
http://www.jguru.com/forums/view.jsp?EID=1130416

Un saludo, chicos.
Guido.
shankarr wrote:

Hi!
I have integrated log4j with struts.
I need to know how to ensure that the changes done to log4j.properties 
file is taken into account at run time.
TIA,
Richie

To achieve all that is possible, one must attempt the impossible


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


[OT] Re: populating session object

2004-01-27 Thread Guido García Bernardo
Maybe you can use the application scope:

foo.Employees employees = (foo.Counter)getServletContext().getAttribute(employees);
if (employees == null) {
 employees = new foo.Employees();
 getServletContext().setAttribute(employees, employees);  
}

and then

jsp:useBean  class=foo.Employees *scope=application* /

Be careful, because I am almost sure that objects placed in application 
scope will be used by more than one thread so you must design them 
accordingly.

Regards!
Guido García
PD. BTW, is there any _free_ memory profiler or something similar to 
JProbe or OptimizeIt?

shankarr wrote:

Hello!

Currently, in my design, I am using a DO class and a DOService class 
for my business logic.
In my case, I make a db query to get a list of all employees.
But, at the end, the result has to be set in a session or in a request 
object.
Given a case where we have lots of users making a get, I believe the 
memory requirement will go up and will
need a very high RAM.

Is there any other way of handling this or I am missing something?

Richie

To achieve all that is possible, one must attempt the impossible


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


[OT] Re: beans

2004-01-22 Thread Guido García Bernardo
This is a very good how not to ask a question example... (spam included!!)
The only thing he has forgot is the THIS IS VERY IMPORTANT, PLEASE 
HELP in the subject...

Anyway
http://www.google.com/search?hl=enlr=ie=UTF-8oe=utf-8q=run+a+jsp+and+a+bean
Regards

xavier manohar wrote:

hi 
can anyone help me to run a jsp and a bean.
regards 
mano

Yahoo! India Mobile: Ringtones, Wallpapers, Picture Messages and
more.Download now.


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


Re: [OT] JSP editor - plugin for eclipse ?

2004-01-20 Thread Guido García Bernardo
You asked the right mailing list.

Divya B Sridhar wrote:

Hi All,
Do we have a plugin for eclipse which would check JSP syntax at save
time/compilation time or so? 
Since Eclipse would recognise Java keywords if JDK is installed;
similarly, do we have a plugin for eclipse which enables eclipse to
recognise JSP tags?

Thanks for any inputs,
Regards,
Divya.
 

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


Re: Prevent direct access to jsp pages

2004-01-20 Thread Guido García Bernardo
http://www.google.com/search?hl=enlr=ie=UTF-8oe=utf-8q=prevent+direct+access+to+jsp+pages

Florin Pop wrote:

Hi,

I have a jsp page which contains some comboboxes. I set the data in the
comboboxes in an Action before forwarding to the jsp. How can I prevent
direct access to the jsp page? So everytime a user wants to access the jsp
he/she should execute first the Action, in order to fill the data in the
combos.
Thanks,

Florin 
 

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


[OT] Re: Tool for jsp debug

2004-01-20 Thread Guido García Bernardo
This is very OT.

http://www.google.com/search?hl=enlr=ie=UTF-8oe=utf-8q=tool+for+jsp+debug

Florin Pop wrote:

Hi,

does anyone know a tool for debugging jsp files? So that you are able to
trace the code in the jsp source not in the generated servlets.
 

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


Struts and webservices

2004-01-19 Thread Guido García Bernardo
Hello

Our project is not Struts based. We must expose operations as xml
services (not standard web services) with a structure like the following
one:
   business id=login
   parameter name=username value=ronaldinho /
   parameter name=pass value=tiger /
   /business
We want to migrate it to Struts, so the first step is to map that XML
structure into an ActionForm...  I think we must overwrite
RequestProcessor doing:
public MyRequestProcessor extends RequestProcessor {
   ActionForm processActionForm( req, res ) {
   if (client is a xml service) {
   SAXBuilder builder = new SAXBuilder( req.getInputStream() );
   ...
   // THE MAIN PROBLEM IS HERE !!
   ActionForm form = new LoginActionForm(); --
   form.setUserName( username );
   form.setPassword( pass );
   return form;
  } else {
   return super.processActionForm( req, res );
  }
   }
}
My questions are:
   1. How can I know the ActionForm class in each case (it is not
always a LoginActionForm...)?
   2. Is there any advantage/drawback with etending RequestProcessor?
(maybe I can't use other RequestProcessors like Tiles or Validator ones)
   3. Should we do anything with ActionServlet, extending it instead of
RequestProcessor, etc.
Any kind of opinion, sugerence or any other consideration are welcome!!

Thank you very very much,
Guido García Bernardo
PD. BTW, is there any practical information or project about integrating
Struts and standard webservices (soap...)?
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: Validations - 'format' vs 'business'

2003-12-23 Thread Guido García Bernardo
I really think that is a good aproach. At least one of the most simple 
and centralized.  BUT

...from a pure struts point of view someone can think that your 
solution is mixing the model with the view.
I think ActionForm should remains as part of the view, or just a 'box' 
between the view and the controller.
What do you think?

On the other hand, I _must_ expose business logic as a API for other 
projects.  With this fact in mind, business methods should be 
implemented doing validations again (defensive programming, you need to 
think about possible errors from your users and don't assume 
anything...). HOW without duplicated code?

Thank you again,
Guido García Bernardo
Vic Cekvenich wrote:

{repost}
I just override validate() method on formbean and do all there, 
including super.validate() that reads validation.xml. In here I call 
DAO's to do business validation also, ex: what is the available credit 
for the client to place this order.

Then in action I do this:
errors = formbean.validate();
hth,
.V
Guido García Bernardo wrote:

Hi,
I have a design doubt... I must validate data coming from a form. 
This consist typically of:
   - 'format' validations (i.e. a field is not empty or it is 
numeric) that I do in the validate method of the ActionForm
   - 'business' validations that usually require a DB access

I actually do 2 steps (actions) per operation. One of them prepare 
the data and the second one does the operation itself. And here comes 
my first question: ¿¿is there any other better aproach??  Maybe 
something similar to a Tiles Controller to prepare the data...

   class PreOperationAction extends Action {
   public ... execute ( ... ) {
  // Create JavaBeans to populate html selects and several 
inputs (requires DB access) and include them in the request
  // Forward to error/success jsp
   }
   }

   class PostOperationAction extends Action {
   public ... execute ( ... ) {
  // Get data from ActionForm
  // Business validations (the selected values and inputs are 
valid from the business point of view)
  // Execute business logic (encapsulated in external 
business logic classes)
  // Forward to error/success jsp
   }
   }

At this point I don't know what is better (from a MVC perspective).
   1. Do it as actually, that is, doing business validation before 
business logic. This way I think I can't expose the business logic as 
an API or as a web service.
   2. Include all the validations (business and format) into the 
business logic classes.  This way I must duplicate format validations
   3. Doing a OperationValidations class (? only a vague idea)
   4. Is there any pattern or any best practice related?  Does 
Validator Plugin allow complex business validations?

Finally, I need your opinion about handling validation errors:
   1. Throwing an Exception from the business logic classes and catch 
it in the Action (or declare the exception in struts-config.xml)
   2. Returning null (or -1, or a no-sense value) from the business 
logic classes
   3. Any other way...

Thank you very much,
Guido García Bernardo.

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


[OT] Validations - 'format' vs 'business'

2003-12-22 Thread Guido García Bernardo
Hi,
I have a design doubt... I must validate data coming from a form. This 
consist typically of:
   - 'format' validations (i.e. a field is not empty or it is numeric) 
that I do in the validate method of the ActionForm
   - 'business' validations that usually require a DB access

I actually do 2 steps (actions) per operation. One of them prepare the 
data and the second one does the operation itself. And here comes my 
first question: ¿¿is there any other better aproach??  Maybe something 
similar to a Tiles Controller to prepare the data...

   class PreOperationAction extends Action {
   public ... execute ( ... ) {
  // Create JavaBeans to populate html selects and several 
inputs (requires DB access) and include them in the request
  // Forward to error/success jsp
   }
   }

   class PostOperationAction extends Action {
   public ... execute ( ... ) {
  // Get data from ActionForm
  // Business validations (the selected values and inputs are 
valid from the business point of view)
  // Execute business logic (encapsulated in external business 
logic classes)
  // Forward to error/success jsp
   }
   }

At this point I don't know what is better (from a MVC perspective).
   1. Do it as actually, that is, doing business validation before 
business logic. This way I think I can't expose the business logic as an 
API or as a web service.
   2. Include all the validations (business and format) into the 
business logic classes.  This way I must duplicate format validations
   3. Doing a OperationValidations class (? only a vague idea)
   4. Is there any pattern or any best practice related?  Does 
Validator Plugin allow complex business validations?

Finally, I need your opinion about handling validation errors:
   1. Throwing an Exception from the business logic classes and catch 
it in the Action (or declare the exception in struts-config.xml)
   2. Returning null (or -1, or a no-sense value) from the business 
logic classes
   3. Any other way...

Thank you very much,
Guido García Bernardo.
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: java.lang.VerifyError

2003-12-12 Thread Guido García Bernardo
I have seen that exception... when I try to use a 1.4 compiled Java 
class under a 1.2 jvm.
Try googling...

Regards,
Guido.
Vasi wrote:

HI All,

I am facing a typical issue.  I have the following code in my jsp page.
When I remove this code and excute, I have no issues, but I run the code
with this, i get the below mentioned error.  Appreciate your help.


[Jsp Code]

% if(current_location!=null){
%
html:select property=current_location size=1
  html:option
value=%=current_location%%=current_location%/html:option
   html:option
value=AlabamaAlabama/html:option
 html:option value=AlaskaAlaska/html:option
 html:option value=ArizonaArizona/html:option
 html:option value=ArkansasArkansas/html:option
 html:option
value=CaliforniaCalifornia/html:option
 html:option value=ColoradoColorado/html:option
 html:option
value=ConnecticutConnecticut/html:option
 html:option value=DelawareDelaware/html:option
/html:select
% }else {%
 html:select property=current_location size=1
 html:option value=Please Select OnePlease Select
One/html:option
   html:option
value=AlabamaAlabama/html:option
 html:option value=AlaskaAlaska/html:option
 html:option value=ArizonaArizona/html:option
 html:option value=ArkansasArkansas/html:option
 html:option
value=CaliforniaCalifornia/html:option
 html:option value=ColoradoColorado/html:option
 html:option
value=ConnecticutConnecticut/html:option
 html:option value=DelawareDelaware/html:option
html:select
 % } %
br
 % if(preferred_location!=null){
%
html:select property=preferred_location size=1
html:option
value=%=preferred_location%%=preferred_location%/html:option
html:option
value=AlabamaAlabama/html:option
 html:option value=AlaskaAlaska/html:option
 html:option value=ArizonaArizona/html:option
 html:option value=ArkansasArkansas/html:option
 html:option
value=CaliforniaCalifornia/html:option
 html:option value=ColoradoColorado/html:option
 html:option
value=ConnecticutConnecticut/html:option
 html:option value=DelawareDelaware/html:option
/html:select
% }else {%
 html:select property=preferred_location size=1
 html:option value=Please Select OnePlease Select
One/html:option
   html:option
value=AlabamaAlabama/html:option
 html:option value=AlaskaAlaska/html:option
 html:option value=ArizonaArizona/html:option
 html:option value=ArkansasArkansas/html:option
 html:option
value=CaliforniaCalifornia/html:option
 html:option value=ColoradoColorado/html:option
 html:option
value=ConnecticutConnecticut/html:option
 html:option value=DelawareDelaware/html:option
 /html:select
 % } %
[/Jsp Code]
Root cause:
java.lang.VerifyError: (class:
_0002feditcandidate_0002ejspeditcandidate_jsp_7, method: _jspService
signature:
(Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/HttpServletR
espo
nse;)V) Illegal target of jump or branch
at java.lang.Class.getDeclaredConstructors0(Native Method)
at
java.lang.Class.privateGetDeclaredConstructors(Class.java:1576)
at java.lang.Class.getConstructor0(Class.java:1748)
at java.lang.Class.newInstance0(Class.java:266)
at java.lang.Class.newInstance(Class.java:249)
at
org.apache.jasper.servlet.JspServlet$JspServletWrapper.load(JspServlet.j
ava:
116)
at
org.apache.jasper.servlet.JspServlet$JspServletWrapper.loadIfNecessary(J
spSe
rvlet.java:154)
at
org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServle
t.ja
va:164)
at
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:318)
at
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:391)
RegdsVasi
 

--
Guido García Bernardo - [EMAIL PROTECTED] 
mailto:[EMAIL PROTECTED]
Tfn. +34 983 54 89 08
IT DEUSTO http://www.itdeusto.com

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


Re: When HashMap will replace ActionForm ?

2003-12-10 Thread Guido García Bernardo
or philosophical purity should always yield to pragmatism

Hookom, Jacob wrote:

Anyone who's done major business application development knows that academic
arguments on programming 'style' get thrown right out the window in favor of
efficient progress ;-)
-Original Message-
From: Trieu, Danny [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, December 10, 2003 10:38 AM
To: 'Struts Users Mailing List'
Subject: RE: When HashMap will replace ActionForm ?

I don't want to offense any one, and all though HashMap or DynaWhatever are
convenience, but isn't it anti OO?  Meaning there are no type checking, and
you are just passing a bag of chunk around?
Danny Trieu 
Internet Business Group 
Downey Savings and Loan Association, F.A. 
[EMAIL PROTECTED]

The beginning of knowledge is the discovery of something we do not
understand.
- Frank Herbert (1920-1986)
The essence of knowledge is, having it, to apply it; not having it, to
confess your ignorance.
- Confucius (551-479 BC)


-Original Message-
From: Navjot Singh [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, December 10, 2003 2:43 AM
To: Struts Users Mailing List
Subject: RE: When HashMap will replace ActionForm ?

I can't say there will be any move or not.

But MAP backed ActionForms are alreadt there, If you are not interested in
using the actionforms and be contended with just hashmaps. Mostly, not
always, I treat ActionForm as HashMap but with getter setter already
classcasted and defined for properties. not more than that.
 

-Original Message-
From: Antony Paul [mailto:[EMAIL PROTECTED]
Sent: Wednesday, December 10, 2003 2:40 PM
To: struts
Subject: When HashMap will replace ActionForm ?
Hi,
  Is there any move to support HashMap in place of ActionForm ?. I dont
want to start any argument. I have read a lot on ActionForm in
this archive.
rgds
Antony Paul.
   

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


Re: RES: Subclassing ActionServlet

2003-12-05 Thread Guido Garca Bernardo
This way you can't extend other 'struts core actions' (Dispatch, Lookup...).

I think a better way may be:
- Using a filter (servlet 2.3) in order to pre and post process the request
- Extending RequestDispatcher
Regards,
Guido.
PD. I am not sure, but i think you can find a discussion about that in 
Struts in Action.

Felipe Nascimento wrote:

A simple way that I use do go:

Super Action class, like:
UserMustBeLoggedAction{
   execute(attribs){
   verify session stuff
   if ok - myExecute(attribs);
   else return ActionForward;
   }
   abstract myExecute(attribs);
}
NewAction extends UserMustBeLoggedAction{
   myExecute(){
   ..
   }
}
What do experts recommend??

Regards
Felipe
-Mensagem original-
De: Gopal Venkata Achi [mailto:[EMAIL PROTECTED] 
Enviada em: quinta-feira, 4 de dezembro de 2003 18:55
Para: Struts Users Mailing List
Assunto: RE: Subclassing ActionServlet

Hi
I have come across a plug-in for Struts, that is called as SAIF (Struts
Action Invocation Framework), which enables us to write a pre-action and
post action methods.  You can use PreAction method for doing all the
session authentication, etc., I did not really use this, but the
features are available at : http://struts.sourceforge.net/saif/
http://struts.sourceforge.net/saif/ 
Any thoughts on this.
Regards,
Gopal





	-Original Message- 
	From: Fullam, Jonathan [mailto:[EMAIL PROTECTED] 
	Sent: Thu 12/4/2003 1:07 PM 
	To: 'Struts Users Mailing List' 
	Cc: 
	Subject: Subclassing ActionServlet
	
	

	All,
	
	I need to check the Session for an authenticated user before
most requests.
	To do this I subclassed ActionServlet and only call
super(request, response)
	upon verification that authenticated user is in the Session.
	
	if (request.getRequestURI().endsWith(welcome.do) |
	request.getRequestURI().endsWith(logon.do) |
	request.getRequestURI().endsWith(html))
	{
	super.process(request, response);
	}
	   
	   
	else if (request.getSession().getAttribute(USER) == null)
	{
	//Forward to login page
	response.sendRedirect(/welcome.do);
	}
	
	 I also know about the ability to subclass the RequestProcessor
and
	providing my own implementation of the processPreprocess method
to
	accomplish the same thing.
	
	Does anybody know of any serious disadvantages or side effects
of
	subclassing the ActionServlet class rather than the
RequestProcessor class.
	

---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.547 / Virus Database: 340 - Release Date: 2/12/2003
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.547 / Virus Database: 340 - Release Date: 2/12/2003


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

--
Guido Garca Bernardo - [EMAIL PROTECTED] 
mailto:[EMAIL PROTECTED]
Tfn. +34 983 54 89 08
IT DEUSTO http://www.itdeusto.com

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


Re: Displaying a dialogue box with Struts... [OT]

2003-11-19 Thread Guido García Bernardo
This is not really Struts related...

You can do it with JavaScript (IE only)
   var result = showModalDialog( 
'dialog.jsp','','dialogHeight:10;status:no;');

And in the 'dialog.jsp' use the returnValue:
   input type=button value=Ok onClick=self.returnValue='Ok'; 
self.close();
   input type=button value=Cancel 
onClick=self.returnValue='Cancel'; self.close();

I think there is not other way with javascript (all the things I tried 
were easily bypassed by the usr)...
May be a 'server' based solution with Java, to be sure that the user has 
choosed an option?
Regards.

Zakaria khabot wrote:

Hi!!
How to display a dialog box using struts.
The dialog box will contain two button (Ok and Cancel).
Thanks...
 

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


Re: convert xml into java file

2003-11-14 Thread Guido ITD
Take  a look at Jakarta Digester.

G.

Vicky wrote:

Can anyone describe how can i convert .xml file into .java file (with
getters and setters). any pointers/resources would be appreciated.
Thanks,
Vicky
 

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


Re: Best way for Database Exception Handling

2003-04-06 Thread Guido
I don't like your idea, Harish.

What if your information systems (EIS) change? I mean, i.e. you are using
a Oracle database, your requirements change and you must store your data
in a XML file.  SQLException has no sense in your controller layer.

I personally prefer to catch my EIS exceptions (SQLException or
whatever) in the business logic layer and throw a EISException or
something like that.

Regards,
Guido.

On Sat, 5 Apr 2003, Harish Krishnaswamy wrote:

} If your business logic cannot do anything with your DBException, what is the need 
for defining one
} such exception? Why not just throw the SQLException and handle it in the controller?
}
} -Harish
}
}
} --- Navjot Singh [EMAIL PROTECTED] wrote:
}  hi gurus,
} 
}  I have some facade layer for my database.
}  That every method in that facade layer, naturally, *catches* SQLException
}  and in return
} throw new DBException( sqlexception);
} 
}  My DBException is extending java.lang.Exception. So, I have to explicity
}  throw it and later catch it in my business logic layer as well. Obviously,
}  if there is DBException, even business logic CANNOT do anything but to pass
}  the exception to presentation layer where it can be caught nicely by
}  global-exception
} 
}  What if i change my DBException to extend RunTimeException.
} 
}  __That way__
}   + I need not to explicity throw and catch DBException.
}   + Few of my methods won't have to send 2-3 exceptions like
}getBookList(int id) throws DBException, NoBookException
} 
}  __Qs__
}  + Would this exception still be catched by global-exception?
}  + If YES, is it a nice thing to do?
} 
}  Any comments are welcome
}  - Navjot Singh
} 
} 
}  -
}  To unsubscribe, e-mail: [EMAIL PROTECTED]
}  For additional commands, e-mail: [EMAIL PROTECTED]
} 
}
}
} __
} Do you Yahoo!?
} Yahoo! Tax Center - File online, calculators, forms, and more
} http://tax.yahoo.com
}
} -
} To unsubscribe, e-mail: [EMAIL PROTECTED]
} For additional commands, e-mail: [EMAIL PROTECTED]
}



Guido Garcia Bernardo
[EMAIL PROTECTED]
[EMAIL PROTECTED]
stat rosa pristina
nomine, nomina nuda tenemus.

http://members.ud.com/services/teams/team.htm?id=D8624419-BFB6-4772-A01A-0045631F979F

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



[OT] My Struts webapp and hosting

2003-04-05 Thread Guido
Hola!

I only want to show you my first Struts app. http://sharedfilms.no-ip.com

Problems i've found:
 - My database (mySQL) pool  connections seem to crash when they are idle
for some time (6-10 hours?)  I have the autoReconnect parameter in the
connection url.
 - i18n is not working for me (now it is only Spanish). I have both
ApplicationResources.properties and ApplicationResources_en.properties. Is
this the right way?
 - Register process is confusing because I use security managed by Tomcat
with a j_security form, blah blah blah

Now the application is in my PC with Tomcat because I have not found any
very cheep_ Struts hosting.

Regards,
Guido.

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



DynaForms perfomance

2003-04-02 Thread Guido
Is there any perfomance comparation DynaActionForms vs ActionForms?
What is the penalty of using Dyna ones (perfomance and other drawbacks)?
Thank you,
Guido.
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: OJB Deployment With Sturts 1.1rc1

2003-04-01 Thread Guido
What JDK version are you using?

I had that exception when I was compiling my classes with a JDK and 
running them in a Tomcat using a different version.

Regards,
Guido.
Stephen Smithstone wrote:
Any one using the ojb stuff ?? which jar files do i need to deploy with my 
struts app i have trouble when i include the xercesImpl.jar and xml-apis.jar 
in my struts app /WEB-INF/lib folder the struts actionservelet throws up some 
nasty java.lang.VerfiyError upon loading of tomcat
 
any help 

Ta
Stephen


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


Re: how to configure iplant web server for struts

2003-03-17 Thread Guido
I have exactly your problem using iPlanet 4.1

Regards,
Guido.
Ramesh_KumarP wrote:
HI,
I am facing problem in working struts in iplant webserver
I am using only ActionServlet
 
Tell me step by step procedure to execute an struts - application  in
iplanet web server..
 
Regards,
P.RAMESHKUMAR,


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


request.getRemoteUser

2003-03-16 Thread Guido
Is there any way to show the remote user that sounds like (this doesnt
work):

bean:write name=request property=remoteUser /

I actually use %= request.getRemoteUser() %, and works fine, but i am
a curious kid

Thank you,
Guido.

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



DataSource references in Business Layer

2003-03-15 Thread Guido
Two simple questions.

1. I usally define all the datasources i need in struts-config.xml file.
It is very easy, but how can I obtain a datasource reference in my
business logic classes?

I hate the idea of passing the reference to the business methods and I
don't want to include all my business logic in the Action classes (that is
what i am actually doing)... Maybe it is not possible and I should use
JNDI or something like that instead.

2. What method should I use if ActionServlet.findDataSource(String) is now
deprecated?

Thank you very much,
Guido.

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



Re: DataSource references in Business Layer

2003-03-15 Thread Guido
Thank you.  I was searching in ActionServlet class instead of Action.

Now the Eclipse IDE warning singal has disappear and I can sleep again :P

On Sat, 15 Mar 2003, Dan Allen wrote:

} You will inherit a method from Action called getDataSource() which I
} think you should look into.  There is a method in action for just
} about every handler you would need, including
}
} getResources()
} saveMessages()
} saveErrors()
} getDataSource()
}
} etc..
}
} Check out the API docs for Action.
}
} Dan
}
} --
} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
} Daniel Allen, [EMAIL PROTECTED]
} http://www.mojavelinux.com/
} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
} The Linux philosophy is to laugh in face of danger.  Oops.
} Wrong one. 'Do it yourself' That's it
}  -- Linus Torvalds
} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
}
} -
} To unsubscribe, e-mail: [EMAIL PROTECTED]
} For additional commands, e-mail: [EMAIL PROTECTED]
}



Guido Garcia Bernardo
[EMAIL PROTECTED]
[EMAIL PROTECTED]
stat rosa pristina
nomine, nomina nuda tenemus.

http://members.ud.com/services/teams/team.htm?id=D8624419-BFB6-4772-A01A-0045631F979F

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



Data driven struts application

2003-03-14 Thread Guido
95% of my struts web apps follow this flow:

1. User selection in a JSP
2. Action class performs a SQL query
3. Return ActionForward to a new JSP that renders the query ResultSet
What is the best practice to show SQL query results (ResultSet) to the 
user? (I mean how communication between view and controller should be 
when I do extensive use of ResulSets)

Actually, we are including the ResultSet in the request :(, and 
processing it in the JSP (using a scriptlet). But I dont like this 
aproach very much, so I wonder if it would be better to:

+ solution 1. Use a RowSetDynaClass instead of the ResultSet.
+ solution 2. Use a JavaBean with getters and setters (maybe as database 
column names) and include a JavaBean collection in the request as a 
Value Object (?)
+ solution 3. I don't know... :(

Thank you very much,
Guido.
PD. Is it better to use a collection of JavaBeans or use just one 
JavaBean whose properties return a collection??



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


Re: Data driven struts application

2003-03-14 Thread Guido
I agree, but I am in doubt:

1. How to transform a ResultSet into a JavaBean (I think bean accesors 
don't have to be named as database columns...) without reinvent the wheel?

2. If I don't know how many columns the query returns (i.e. if the query 
is 'select * from ORACLE_VIEW') I supose I can use a DynaBean. Are there 
any other technique?

Thank you again,
Guido.
Robert S. Sfeir wrote:
Yep, I agree with David.  Your code will invariably be more usable and 
be more presentation layer friendly if you always return a Collection of 
some type.  The Collection would contain beans of the object type you're 
working with.  Further if you're using for example an ArrayList to 
populate a List, and later you decide you want to change it to something 
else for say performance reasons or what ever, you don't go busting the 
whole presentation layer because of it, since the presentation layer is 
working with a Collection and knows about nothing else.  It is 
*sometimes* better to be as generic as possible with the underlying 
layers of your code, than hooking your presentation code in so tight 
that maintenance of the app is greatly affected.

On Friday, March 14, 2003, at 10:57 AM, David Graham wrote:

Both solution 1 and 2 are far better than using a ResultSet in a jsp.  
I usually use a Collection of JavaBeans.

David



From: Guido [EMAIL PROTECTED]
Reply-To: Struts Users Mailing List [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]
Subject: Data driven struts application
Date: Fri, 14 Mar 2003 16:24:08 +0100
95% of my struts web apps follow this flow:

1. User selection in a JSP
2. Action class performs a SQL query
3. Return ActionForward to a new JSP that renders the query ResultSet
What is the best practice to show SQL query results (ResultSet) to 
the user? (I mean how communication between view and controller 
should be when I do extensive use of ResulSets)

Actually, we are including the ResultSet in the request :(, and 
processing it in the JSP (using a scriptlet). But I dont like this 
aproach very much, so I wonder if it would be better to:

+ solution 1. Use a RowSetDynaClass instead of the ResultSet.
+ solution 2. Use a JavaBean with getters and setters (maybe as 
database column names) and include a JavaBean collection in the 
request as a Value Object (?)
+ solution 3. I don't know... :(

Thank you very much,
Guido.
PD. Is it better to use a collection of JavaBeans or use just one 
JavaBean whose properties return a collection??



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


_
The new MSN 8: smart spam protection and 2 months FREE*  
http://join.msn.com/?page=features/junkmail

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


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



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


[OT] Escape characters

2003-03-13 Thread Guido
I'm using jsp + struts + oracle.

My oracle data contains special characters ', , , etc. that 
cause the JSP not to be well formed.

Where should I escape that chars?  In the query, whit a JSP scriptlet 
(or taglig), in my Action classes?

Is there any package (in some cases i'm using URLEncoder and URLDecoder) 
to do the escape ( - amp; , etc)?

Thank you.

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


Re: [OT] computer performance with jsp/servlets/struts

2003-03-11 Thread Guido
Is there any kind of benchmark results table or technical comparation 
between tomcat, jetty, iplanet, resin...? I've been searching google 
without success... I need something because much faster or much 
slower is not enought for me.

Thank you!

Manfred Wolff wrote:

Dan Allen wrote:

I only ask this to see if I can make my life easier.  I have a PII
333MHz laptop with 216MB Ram and I am running Tomcat, JDK 1.4.1 and
some struts applications.  Just now it took ant 6 min 56 sec to
reload my application after making changes.  If I were to go and get
a decent Athlon XP or PIV computer, what should I expect for reload
times and compile times for a reasonable size webpage application?
This is the one thing that I regret when leaving PHP.  I spend close
to 1/8 of my day waiting for it to reload once my computer starts
swapping to disk.  Does anyone else have this issue?
Dan

Hi.

We use tomcat to develop und jetty for our production system ( P4 2,2 
GH with Linux). Jetty is much faster, because he can cache the tags. 
Tomcat is much slower in compiling and working with tags in jsp.

Manfred

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



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


Re: switching from non SSL to SSL in struts..

2003-03-11 Thread Guido
Oh no! This topic again!! :P

Take a look at sslext (sslext.sourceforge.net) or search this mail list 
for it.

hth,
Guido.
James wrote:
I've got my SSL connector configured in tomcat.. what i want to know is what
do i need to do to change to secure page from non secure pages in struts...
an example of this would be going from 'shopping cart' to 'checkout'.. is
this a configuration issue?


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


Message replacement

2003-03-11 Thread Guido
Hello

Anyone can explain me (for dumbs) how does this replacement works 
(Action sample code would be great) and what Java classes are involved?

error.number=The number {0} is greater than {1}

Thank you!
Guido.
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


[OT]Re: Message replacement

2003-03-11 Thread Guido
Thank you. The idea was use only Java standard classes (or at least 
commons packages), not Struts dependent ones.

Maybe I can use java.text.MessageFormat I have seen at

http://java.sun.com/products/jdk/1.2/docs/api/java/text/MessageFormat.html

Regards,
guido.
James Mitchell wrote:
You can find sample code in many places including the struts-example
that ships with the software.
The classes involved are as follows:
org.apache.struts.util.MessageResources.java
org.apache.struts.util.MessageResourcesFactory.java
org.apache.struts.util.PropertyMessageResources.java
org.apache.struts.util.PropertyMessageResourcesFactory.java
In the future (1.2) we will be changing this to use commons-resources,
which basically does the same thing.  


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


Re: weird org.apache.struts.action does not exist

2003-03-11 Thread Guido
Try using : instead of ; in your CLASSPATH if you are developing 
under Linux/UNIX.

If this doesn't work, try putting the classpath within your javac statment:

javac -classpath classpath RegisterForm.java

HTH
Guido.
Tom Cat wrote:
Hi, I am new to struts trying to learn something from Ted Husted's book Struts in 
Action.
I installed Tomcat and IBM JDK 1.4., then downloaded Ted's example application 
register-complete.war (which is example app on struts site too). It works fine but 
when I try to compile something using Struts - I am in a big trouble. I tried to 
recompile one of Ted's simple java files (setting CLASSPATH beforehand as this seems 
to be the usual cause for the proble I get, as I learned from mailinglist archives):
[root]/usr/local/tomcat/webapps/register-complete/WEB-INF/classes/app echo $CLASSPATH
/usr/local/tomcat/webapps/register-complete/WEB-INF/lib/struts_1_0_2.jar;.;/usr/local/tomcat;/opt/IBMJava2-131/lib
[root]/usr/local/tomcat/webapps/register-complete/WEB-INF/classes/app javac 
RegisterForm.java
RegisterForm.java:2: package org.apache.struts.action does not exist
import org.apache.struts.action.*;
^
RegisterForm.java:4: cannot resolve symbol
symbol  : class ActionForm
location: class app.RegisterForm
public class RegisterForm extends ActionForm {
  ^
2 errors
Somebody, please help :(


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


RE: xslt in jsp

2003-03-09 Thread Guido
Why not simply doing, in your JSP:

?xml version=1.0 ?
? --- XLS style sheet here, i don't remember sintaxis--- ?
names
name id=%= bean.getId() % 
first%= bean.getFirst() %/first
nick%= bean.getNick() %/nick
/name
/names

(This is only the idea, you should use jslt or struts taglibs instead of
retrieving bean properties via %= bean.getXXX() %.)

With the XSL style sheet you can do (the browser does it) the
transformation you need.

Regards from Spain,
Guido.

On Sat, 8 Mar 2003, Jörg Maurer wrote:

} definitly give JSTL a try! Myself not applied it, but read book by Bayer
} Shawn - devoted taglibs to xml and xml transformation for usage in jsp.
}
} -Original Message-
} From: bobd [mailto:[EMAIL PROTECTED]
} Sent: Samstag, 08. März 2003 20:02
} To: [EMAIL PROTECTED]
} Subject: xslt in jsp
}
}
} I have a jsp that needs to retrieve XML from a bean
} (stored in the session) and then execute a
} transformation.
}
} what is the easiest way to do this?  Having difficulty
} using xsltlib:..., as well as locating documentation
} on this.
}
} thanks,
} -b
}
} __
} Do you Yahoo!?
} Yahoo! Tax Center - forms, calculators, tips, more
} http://taxes.yahoo.com/
}
} -
} To unsubscribe, e-mail: [EMAIL PROTECTED]
} For additional commands, e-mail: [EMAIL PROTECTED]
}
}
} -
} To unsubscribe, e-mail: [EMAIL PROTECTED]
} For additional commands, e-mail: [EMAIL PROTECTED]
}
}



Guido Garcia Bernardo
[EMAIL PROTECTED]
[EMAIL PROTECTED]
stat rosa pristina
nomine, nomina nuda tenemus.

http://members.ud.com/services/teams/team.htm?id=D8624419-BFB6-4772-A01A-0045631F979F

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



Re: HELP! Plz!! request.getRequestURI() in jsp vs. Action classHELP!!! :)

2003-02-25 Thread Guido
If I am not missing anything, maybe you can (it is a good practice) go 
_always_ through an Action (or ActionForward, etc) and never post 
directly to a JSP...

HTH,
Guido.
Khalid K. wrote:

(Repost)

Hello All, Please help with this problem.

I need request.getRequestURI() to return  actionA.do   

This works fine if when I call the getRequestURI() method from an Action
class,
But When I call request.getRequestURI() from a JSP file...it returns the
ActionA.jsp   
I could replace .jsp with .do, but my method sometimes post to a jsp
file and others to an Action, so It is not as easy
Any ideas??

Thanks

Khalid



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



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


RE: Passing parameters to Actions

2003-02-25 Thread Guido
I wonder if MyExtendedActionMapping is as simple as:

public class MyExtendedActionMapping extends ActionMapping {
private String xxx;
public void setXXX(String xxx) { this.xxx = xxx; }
public String getXXX() { return xxx; }
}

Should I implement any other method...?

Thanks.


Guido García Bernardo
[EMAIL PROTECTED]
Spain is different.

On Tue, 25 Feb 2003, Brandon Goodin wrote:

} Here is a config sample:
}
} action path=/myAction.do
}parameter=submit
}type=com.foo.MyAction
}name=myForm
}scope=request
}className=com.foo.MyExtendedActionMapping
} set-property property=xxx value=yyy/
} forward name=success path=here.jsp redirect=false/
} forward name=fail path=there.jsp redirect=true/
} /action


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



Re: How to Show gif image instead of html button in the forms forhtml:submit tag ?

2003-02-24 Thread Guido
you should, you should...
don't forget... philosophical purity should always yield to pragmatism
Nicolas De Loof wrote:

1. Might be. dont know.
  but you should avoid using scriptlets in your code.
  and this is scriptlet.
   



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


FormBeans - View components?

2003-02-21 Thread Guido
What do you think about the article published at javaworld:

http://www.javaworld.com/javaworld/jw-02-2002/jw-0201-strutsxslt_p.html

Look at Figures 1 and 2... FormBeans are model components, not view
components.


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




Struts Barracuda

2003-02-20 Thread Guido
What do you think about this (from
http://barracuda.enhydra.org/cvs_source/Barracuda/docs/barracuda_vs_struts.html)
?

Unlike Barracuda, Struts is aimed primarily at the Page Author types.
This is not to say that Struts does not require Java coding--after all,
you still need developer types to implement Tag libraries and write
Controller code. Rather, it aims to suggest that it is Page Authors who
will get the most mileage from the framework; if you do not adopt a JSP
strategy for rendering views, the value of Struts is greatly diminished.


Guido Garcia Bernardo
[EMAIL PROTECTED]
[EMAIL PROTECTED]
stat rosa pristina
nomine, nomina nuda tenemus.


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




Re: AW: Generate XML documents from Beans

2003-02-13 Thread Guido

The same way XMLEncoder in JDK 1.4...

The output format is not very user-friendly but if you only want to
persist your beans...

On Thu, 13 Feb 2003, Hirschmann, Bernhard wrote:

}
} Vikas, we use the jar from .jdom.org to create JDOM objects firstly as
} representatives of the beans. They can then be transformed to a XML string
} with the XMLOutputter class, if this is what you want.
}
} Regards,
} Bernhard
}
} -Ursprüngliche Nachricht-
} Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
} Gesendet: Donnerstag, 13. Februar 2003 19:18
} An: [EMAIL PROTECTED]
} Betreff: Generate XML documents from Beans
}
}
} Can anyone throw some pointers on ways XML documents can be
} generated from java components - beans or a collection of
} beans?
}
} What API can be used?
}
} Thanks,
}
} Vikas
}
} -
} To unsubscribe, e-mail: [EMAIL PROTECTED]
} For additional commands, e-mail: [EMAIL PROTECTED]
}
} -
} To unsubscribe, e-mail: [EMAIL PROTECTED]
} For additional commands, e-mail: [EMAIL PROTECTED]
}



Guido Garcia Bernardo
[EMAIL PROTECTED]
[EMAIL PROTECTED]
stat rosa pristina
nomine, nomina nuda tenemus.

http://members.ud.com/services/teams/team.htm?id=D8624419-BFB6-4772-A01A-0045631F979F

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




Re: [newbie] Connection Pooling

2003-02-12 Thread Guido
IMHO, storing the connection in the session context is *never* a good
idea!

1. Session timeout uses to be too high if you must wait the session to
expire to close your connection (the user closes the browser...)
2. You can kill your DB or you app server...  And think about how many
connections would you need if your application has i.e. 3 hits/day?
You should use a connection pool.

On Wed, 12 Feb 2003, [ISO-8859-2] Micha? Postupalski wrote:

} On 2/12/2003 10:34 PM, Marco Tedone wrote:
}  You could write a PlugIn(new to Struts 1.1) to open a db connection and
}  store it in the session context. I would remember to close it in the
}  destroy() method.
} 
}  Only an idea.
}
} Yes, it's a good idea. I use it sometimes but only when I have only one
} database's user. If You use more database's users to connect to database
} I wouldn't used connection pooling.
}
} plastic
}
}
} -
} To unsubscribe, e-mail: [EMAIL PROTECTED]
} For additional commands, e-mail: [EMAIL PROTECTED]
}



Guido Garcia Bernardo
[EMAIL PROTECTED]
[EMAIL PROTECTED]
stat rosa pristina
nomine, nomina nuda tenemus.

http://members.ud.com/services/teams/team.htm?id=D8624419-BFB6-4772-A01A-0045631F979F

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




Re: PropertyUtils:getIndexedProperty thows error

2003-02-03 Thread Guido

fooX and barX in your ActionForm are not indexed properties... just
Strings (not String[])...

maybe PropertyUtils.getProperty, but not getIndexedProperty

HTH.

On Mon, 3 Feb 2003, Sourav Das wrote:

} hi ,
} I am facing some problem in retrieving the value in
} bean using PropertyUtils.getIndexedProperty
}
} I am getting a error of
} java.lang.IllegalArgumentException: Invalid indexed property 'fooX'
}
} my code looks some thing like this
}
} openVar = ( String )PropertyUtils.getIndexedProperty( form , fooX );
}
}
} where class form looks some thing like this
}
} public class CollapseForm extends ActionForm{
}  private String fooX = ;
}  private String barX = ;
}  public void setFooX(String foo){
}   this.fooX = foo;
}  }
}  public String getFooX(){
}return this.fooX;
}  }
}  public void setBarX(String bar){
}   this.barX = bar;
}  }
}  public String getBarX(){
}   return this.barX;
}  }
} }//EOC CollapseForm
}
} ERROR : java.lang.IllegalArgumentException: Invalid indexed property 'fooX'
}
} any idea/solution to resolve this ?
}
} regards,
} Sourav Das
}



Guido Garcia Bernardo
[EMAIL PROTECTED]
[EMAIL PROTECTED]
stat rosa pristina
nomine, nomina nuda tenemus.

http://members.ud.com/services/teams/team.htm?id=D8624419-BFB6-4772-A01A-0045631F979F

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




Re: Multi-Select List Box

2003-02-01 Thread Guido
Can anyone post a sample?  I don't know how to set the indexed properties.

If I do:

public void setSelectBox(int index, String item) {
   selectBox[index] = item;
}

i can get a NullPointerException or an ArrayIndexOutOfBoundsExceptions
because I don't know selectBox array size...

What is the best practice to do it??

1. Using a Collection (is not allowed in JavaBeans specification)
2. Increasing dynamically the array size in the setSelectBox method (maybe
too tricky ?).

Thank you very much.

David Graham wrote:
 Define a String[] in your form bean with the same name as your select
box.

 David



Guido Garcia Bernardo
[EMAIL PROTECTED]
[EMAIL PROTECTED]
stat rosa pristina
nomine, nomina nuda tenemus.

http://members.ud.com/services/teams/team.htm?id=D8624419-BFB6-4772-A01A-0045631F979F

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




M - V - C components

2003-01-21 Thread Guido
I'm in doubt.

Are *ActionForms* part of the Model or part of the View?
I've read ActionForm beans are actually closer to the View than the
Model. but I don't know why.  Actually?  Any explanation?

And what about *Action*s?  Are they part of the Model or part of the
Control (as I supose)?

Thank you very much,
Guido.
 

[EMAIL PROTECTED]
Valladolid (Spain)
Soy cliente de Retecal y me siento estafado, no se lo recomiendo a nadie


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




RE: Controlling Direct Access to jsp pages

2003-01-13 Thread Guido
IMO these are two bad solutions

  + Setting an attribute can be bypassed doing 
/page2.jsp?referer=true
  + I am almost sure HTTP headers can be modified easily, so using http
referer header may be unsafe...

See David Graham post in this thread to prevent access to any *.jsp file.

Regards from Spain,
Guido.

On Mon, 13 Jan 2003 [EMAIL PROTECTED] wrote:

} Yes, you can use the struts-config.xml, actions or forwards
} but if you don't want struts to know about (!) you can check by setting and
} contextual attribute :
} page1: request.setAttribute(referer, true)
} page 2: request.getAttribute(referer) = true ?
} 
} or use the http headers : getHeader(referer); and check if the referer is
} the right one.
} 
} Hopefully it will help,
} fabrice.
} 
} -Original Message-
} From: Colquhoun, Adrian [mailto:[EMAIL PROTECTED]]
} Sent: lundi 13 janvier 2003 16:41
} To: [EMAIL PROTECTED]
} Subject: Controlling Direct Access to jsp pages
} 
} 
} 
} Hi
} 
} If I have three pages in my view layer that must be called in sequence e.g.
} 
}  - step1.jsp then
}  - step2.jsp then
}  - step3.jsp
} 
}  How do I ensure that my users do not call step2 and step3 directly via a
} web browser.  Do I need to use a custom tag in pages 2 and 3 to check this
} or is there some way to force all requests for .jsp pages in my application
} to route via the ActionServlet
} 
} Thanks
} 
} Adrian
} 
} 
} ===
} Information in this email and any attachments are confidential, and may
} not be copied or used by anyone other than the addressee, nor disclosed
} to any third party without our permission.  There is no intention to
} create any legally binding contract or other commitment through the use
} of this email.
} 
} Experian Limited (registration number 653331).  
} Registered office: Talbot House, Talbot Street, Nottingham NG1 5HF
} 
} --
} 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]
} 



Guido Garcia Bernardo
[EMAIL PROTECTED]
[EMAIL PROTECTED]
stat rosa pristina
nomine, nomina nuda tenemus.

http://members.ud.com/services/teams/team.htm?id=D8624419-BFB6-4772-A01A-0045631F979F


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




AW: JavaScript Form/submit Function

2002-03-11 Thread Guido Schmutz

Hello,
 
I'm currently having the exact same problem. It's caused by the
html:submit button, which automatically assigns the name submit to
the button. Therefore you have an object submit in your form an IE does
not seem to recognize the submit() method on the form anymore. If you
remove your html:submit tag, your form would work perferctly.
 
I'm not sure what the solution for the problem is and I'm still working
on it. 
I've tried to put the html:select in a second form and that would
work. Another way would be to not use the html:submit tag and code the
submit button manually (with a different name than submit). Unfortunatly
it's not possible to pass a name to the html:submit tag and I'm also
not sure, if Struts uses the name submit internally.
 
Any additional input would help me as well.
 
Guido

-Ursprüngliche Nachricht- 
Von: Bettina Gaus 
Gesendet: Mo 11.03.2002 15.56 h 
An: '[EMAIL PROTECTED]' 
Cc: 
Betreff: JavaScript Form/submit Function



Hello,

i tried to use the document.forms[0].submit() function in the
onchange property of a html:select tag,
but i allways received the error message: The object does not
support this property or method. It must be the
submit() function, because i.e the document.forms[0].length
property gives a result.

Does anybody got the same problem or can anybody help me

Bettina


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






winmail.dat
Description: application/ms-tnef

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


problems with nighly build and Tomcat 4.0.1

2002-01-11 Thread Nottebrok, Guido

Hallo,

my application was running without problems with struts 1.0.

But now I need indexed properties and so I downloaded the nightly build 
jakarta-struts-20020109.zip. and put the files in the directories as mentioned
in the readme file.

Now I have the following problems:

1. When I have this in a Tomcat Context in server.xml

Logger className=org.apache.catalina.logger.FileLogger
prefix=localhost_portal_log. suffix=.txt
timestamp=true/

I get this error in localhost_portal_log.txt
java.lang.NoClassDefFoundError: org/apache/commons/logging/LogSource
at org.apache.commons.digester.Digester.init(Digester.java:309)
at org.apache.struts.action.ActionServlet.initDigester(ActionServlet.java:1576)
at org.apache.struts.action.ActionServlet.initMapping(ActionServlet.java:1755)
at org.apache.struts.action.ActionServlet.init(ActionServlet.java:496)
at javax.servlet.GenericServlet.init(GenericServlet.java:258)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:852)
at 
org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:3267)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:3384)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1123)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:612)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1123)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:307)
at org.apache.catalina.core.StandardService.start(StandardService.java:388)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:505)
at org.apache.catalina.startup.Catalina.start(Catalina.java:776)
at org.apache.catalina.startup.Catalina.execute(Catalina.java:681)
at org.apache.catalina.startup.Catalina.process(Catalina.java:179)
at java.lang.reflect.Method.invoke(Native Method)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:243)

To resolve this I commented it out. But I think there must be a better solution.

2. The application doedn't work anymore.
I get the following error in the tomcat log

javax.servlet.jsp.JspException: Cannot find message resources under key 
org.apache.struts.action.MESSAGE
at org.apache.struts.taglib.template.GetTag.doStartTag(GetTag.java:193)
at org.apache.jsp.portalTemplate$jsp._jspService(portalTemplate$jsp.java:231)
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)
...

What I can see is this:
When I use the struts.jar of struts 1.0 there are a lot of messages when tomcat is 
starting,
showing me informations from struts about mappings and so on.

When I use the struts.jar from the nightly build there are just 4 lines from Tomcat

Who can tell me what is going wrong here?

Guido

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




Re: Iterate problem

2001-07-10 Thread guido . roth


Hi

The parts you show look correct to me. It seems that the problem lies in
the code of method OverDueOrderView.getOrderNo(), which you have not copied
to the mail.

Guido



   
 
   suhas 
 
   [EMAIL PROTECTED]   To:  [EMAIL PROTECTED] 
 
ltech.com   cc:   
 
 Subject:  Iterate problem 
 
   
 
  10.07.2001 11:55 
 
 Please respond to 
 
   struts-user 
 
   
 
   
 


Hi I have a question

My Iterate tag goes like this

logic:iterate id=view name=updateOrderForm property=views type
=example.testorder.OverDueOrderView

tr
td
html:text property='%= view[ + index+ ]+.orderNo %' /
/td
td
html:text property='%= view[+index+ ]+.salesDiv %' /
/td
td
html:text property='%= view[+index+ ]+.productOrdered %' /
/td
/tr
% index++ ;%
/logic:iterate
Do I need **IndexId** here as an attribute in the iterate Tag  ??? 'cos In
my form bean when showing the above table there is a call to
 public OverDueOrderView getView(int index) {
  System.out.println( in side the getView of UpdateOrder Form +
index);
  return (OverDueOrderView)views.get(index);
 }

Here I'm getting **in side the getView of UpdateOrder Form 0 **  printed
with following error message
 javax.servlet.ServletException: Exception thrown by getter for
view[0].orderNo of bean org.apache.struts.taglib.html.BEAN

What can be the problem -- IS it 'cos i'm not specifying indexId attribute
in the iterate tag or something else ???
















Re: Iterate problem

2001-07-10 Thread guido . roth


Sorry, I'am somewhat at a loss...

I had a similar problem, where it helped composing the property-term to a
variable first, and using double quotes for the property value:

...
td
% pVal = view[ + index+ ]+.orderNo; %
html:text property=%=pVal% /
/td
...

but I never understood why (can anybody tell me?)

Guido



   
 
   suhas 
 
   [EMAIL PROTECTED]   To:  [EMAIL PROTECTED] 
 
ltech.com   cc:   
 
 Subject:  Re: Iterate problem 
 
   
 
  10.07.2001 15:02 
 
 Please respond to 
 
   struts-user 
 
   
 
   
 


it is goes something like this .

private String orderNo ;

public String getOrderNo() {
return orderNo ;
}


- Original Message -
From: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, July 10, 2001 8:28 AM
Subject: Re: Iterate problem



 Hi

 The parts you show look correct to me. It seems that the problem lies in
 the code of method OverDueOrderView.getOrderNo(), which you have not
copied
 to the mail.

 Guido




suhas
[EMAIL PROTECTED]   To:
[EMAIL PROTECTED]
 ltech.com   cc:
  Subject:  Iterate problem

   10.07.2001 11:55
  Please respond to
struts-user




 Hi I have a question

 My Iterate tag goes like this

 logic:iterate id=view name=updateOrderForm property=views type
 =example.testorder.OverDueOrderView

 tr
 td
 html:text property='%= view[ + index+ ]+.orderNo %' /
 /td
 td
 html:text property='%= view[+index+ ]+.salesDiv %' /
 /td
 td
 html:text property='%= view[+index+ ]+.productOrdered %' /
 /td
 /tr
 % index++ ;%
 /logic:iterate
 Do I need **IndexId** here as an attribute in the iterate Tag  ??? 'cos
In
 my form bean when showing the above table there is a call to
  public OverDueOrderView getView(int index) {
   System.out.println( in side the getView of UpdateOrder Form +
 index);
   return (OverDueOrderView)views.get(index);
  }

 Here I'm getting **in side the getView of UpdateOrder Form 0 **  printed
 with following error message
  javax.servlet.ServletException: Exception thrown by getter for
 view[0].orderNo of bean org.apache.struts.taglib.html.BEAN

 What can be the problem -- IS it 'cos i'm not specifying indexId
attribute
 in the iterate tag or something else ???






















Re: SilverStream and Struts

2001-07-09 Thread guido . roth


Hi

I also had problems with the URL DTD references, and attributed them to our
company firewall.

You can solve the problem by removing the 'DOCTYPE' statement from the XML
documents. What you can do also is copying the DTD directly into the XML,
e.g. for web.xml:

!DOCTYPE web-app [
 !ELEMENT web-app (icon?, display-name?, description?, distributable?,
context-param*, servlet*, servlet-mapping*, session-config?, mime-mapping*,
welcome-file-list?, error-page*, taglib*, resource-ref*,
security-constraint*, login-config?, security-role*, env-entry*, ejb-ref*)
 !ELEMENT icon (small-icon?, large-icon?)

 ...

 !ATTLIST remoteid ID #IMPLIED
 !ATTLIST ejb-link
 id ID #IMPLIED
]



   
  
   strainformatique@Gra
  
 veleau.com   To:  [EMAIL PROTECTED]  
  
  cc:  
  
  Subject:  SilverStream and Struts
  
   09.07.2001 10:55
  
  Please respond to
  
struts-user
  
   
  
   
  



Hi everybody,

I have a problem with the struts example 1.0 and SilverStream 3.7.2.
When I deploy the war, the server console display:

resolveEntity('-//Apache Software Foundation//DTD Struts Configuration
1.0//EN', 'http://jakarta.apache.org/struts/dtds/struts-config_1_0.dtd')
 Not registered, use system identifier

Any idea ?

Best regards,
Christophe Cosnefroy










Re: where'is the reference manual about strus-config.xml

2001-07-06 Thread guido . roth


Hi

The best description I found is in the DTD:

http://jakarta.apache.org/struts/dtds/struts-config_1_0.dtd

Guido Roth



   
 
  UEHARA Junji 
 
   [EMAIL PROTECTED]   To:  [EMAIL PROTECTED]   
 
   .co.jp   cc:   
 
 Subject:  where'is the reference manual about 
strus-config.xml 
   
 
06.07.2001 
 
 14:51 
 
Please respond 
 
to struts-user 
 
   
 
   
 


Hi,
I'm searching detail manual of strus-config.xml to write
and configure it. Please tell me where it is.
I can't find it.

--
Junji Uehara









Re: variable number of inputs

2001-07-04 Thread guido . roth


I was asking a very similar question to the mailing list a few days ago.
This is the conclusion I did draw from the answers I got:


The answers are:
- Struts 1.0 does not support variable indexing
- there exists a workaround employing some JSP code(see below)
- there exists an inofficial implementation of the feature by Dave Hayes on
http://www.husted.com/about/struts/resources.htm#extensions (I did not
employ it, as I want to stick with the official Struts).

The solution to my problem thus looks like that:

...
html:form name=report type=ReportForm scope=session action=log.do
% String accountVal = null; %
% String amountVal = null; %
% String remarkVal = null; %
logic:iterate name=report property=entries scope=session id=entry
indexId=entryId
tr
td#bean:write name=entryId//td
td
  % accountVal = entry[ + entryId + ].account; %
  html:text property=%=accountVal%/
/td
td
  % amountVal = entry[ + entryId + ].amount; %
  html:text property=%=amountVal%/
/td
td
  % remarkVal = entry[ + entryId + ].remark; %
  html:text property=%=remarkVal%/
/td
/tr
/logic:iterate
...
/html:form
...


|-+|
|Guido Roth   |SYSTOR AG   |
| ||
| ||
|   Tel. +41 1 405 35 12  |   Fax +41 1 405 31 13  |
| ||
| ||
|  [EMAIL PROTECTED]  |  Baslerstr. 60 |
| |   8048 Zürich  |
|-+|




   
 
   Mike Thompson 
 
   mrt@instanton.   To:  [EMAIL PROTECTED] 
 
  com   cc:   
 
 Subject:  Re: variable number of inputs   
 
   
 
03.07.2001 
 
 16:01 
 
Please respond 
 
to struts-user 
 
   
 
   
 


Struts does not necessairly create an ActionForm out of the returned data,
it uses the current one and repopulates it via the property names specified
in your html:form.  What you need are indexed properties, see archive.
You'll end up having something like:

throw all this in an iterate tag to iterate over all the rows in your form.
You'll need to declare an index variable in your jsp.

   html:form action=/lookup
 table
%
int index = 0;
%

!-- iterate tag goes here --
   tr
 tdhtml:text property='%= person[ + index + ].first
%'//td
 tdhtml:text property='%= person[ + index + ].last
%'//td
 tdhtml:text property='%= person[ + index + ].phone
%'//td
   /tr

%
++index;
%

 /table
   /html:form


- Original Message -
From: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, July 03, 2001 8:21 AM
Subject: variable number of inputs


 Newbie question...

 I need to have a table where each row will have multiple input fields
 and these fields make up a single record of information. I do not
 know before I generate the table how many rows it will have. When the
 user modifies this table and sends it back, struts will want to make
 an ActionForm out of the returned data. The question is, how do I
 handle the variable number of rows?

 For example, if each row has a first name, last name, and phone number,
 and I happen to have two rows, I might do something like:

   html:form action=/lookup
 table
   tr
 tdhtml:text property=first//td
 tdhtml:text property=last//td
 tdhtml:text property=phone//td
   /tr
   tr
 tdhtml:text property=first//td
 tdhtml:text property=last//td
 tdhtml:text property=phone//td
   /tr
 /table
   /html:form

 (Of course, since the number of rows is variable, I'd actually do

Re: proposal: splitting struts mailing list

2001-07-03 Thread guido . roth


Exactly my opinion as well. If splitting is necessary, some other
split-boundary should be found. Maybe one could try splitting between the
Java-centred part and the HTML-centered part. But this is not convincing to
me.

Guido



   
 
  Peter Alfors 
 
   peter.alfors@i   To:  [EMAIL PROTECTED]   
 
rista.com   cc:   
 
 Subject:  Re: proposal: splitting struts 
mailing list  
   
 
02.07.2001 
 
 19:57 
 
Please respond 
 
to struts-user 
 
   
 
   
 


The problem with splitting into two lists is that the advanced users will
not be around to answer the beginner questions.
I agree that there is a lot of traffic on this list, both beginner and
advanced.  I see it as a benefit though.
The beginners get to learn from the advanced, and the advanced (developers)
get to see the typical types of questions that are asked.  This may then
lead to a better design, or better documentation, etc.

Just my two cents.   :)

Pete


Norman Timmler wrote:

 hi,

 the daily mails in this mailinglist incrased a lot past the last month.
 what do you think about to split the mailinglist into two. eg. into a
 beginner and advanced one.

 perhaps this could fit everybodys needs.

 norman

 . . . . . . . . . . . . . . . . . . . . . . . . .

 Norman Timmler
 application developer

 neteye GmbH
 Alsterchaussee 3
 20149 Hamburg
 Tel +49-(0)40 85 40 26 -40
 Fax +49-(0)40 85 40 26 -10
 [EMAIL PROTECTED]
 http://neteye.de










RE: Something strange about iterate tag

2001-06-29 Thread guido . roth


Hi

The Struts documentation states that the result of the getter must be a
'java.util.Collection'; String[] is no Collection.

Regards, Guido



   

  Laurent Delvaux  

   Laurent.Delvaux@v   To:  [EMAIL PROTECTED], 
[EMAIL PROTECTED]
   altech.fr   cc:

Subject:  RE: Something strange about 
iterate tag
   

 29.06.2001 10:03  

Please respond to  

  struts-user  

   

   



Yes, I have one! It is the only place where it didn't work in my entire
site!

-Message d'origine-
De : David Winterfeldt [mailto:[EMAIL PROTECTED]]
Envoyé : jeudi 28 juin 2001 16:02
À : [EMAIL PROTECTED]
Objet : Re: Something strange about iterate tag


Do you have a setObjectives method in your bean?  You
need it for the PropertyUtils to find the method (has
to do with the JavaBean spec).

David

--- [EMAIL PROTECTED]
[EMAIL PROTECTED] wrote:
 Hello struts users,

 I have a very strange problem in a jsp!! Indeed, the
 iterate tag works well for a property but doesn't
 work
 properly for another:
  * In my JSP:
  logic:iterate id=prerequisite name=course
 property=preRequisites
bean:write name=prerequisite/
  /logic:iterate
  logic:iterate id=objective name=course
 property=objectives
bean:write name=objective/
  /logic:iterate
  * In my bean:
 public String[] getObjectives() {return
 objectives;}
 public String[] getPreRequisites()
 {return (String[]) preRequisites.clone();}
 The first iterate tag is OK (preRequistes), but the
 second doesn't work (objectives) and provide this
 error: No getter method for property objectives of
 bean
 course .
 Please help me, a objectives getter is already
 present
 in my bean !!!



__
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail
http://personal.mail.yahoo.com/


=
Ce message et toutes les pièces jointes sont propriété de VALTECH et
susceptibles de contenir des informations confidentielles à l'intention
exclusive de ses destinataires. Si vous avez reçu ce message par erreur
ou si celui ci vous est parvenu incomplet ou altéré, merci d'en avertir
l'expéditeur par retour.Toute utilisation, diffusion ou publication non
expressément autorisée par nous par écrit est strictement interdite.
 --

This message and any attachments are Valtech property and may contain
iconfidential information intended solely for the addressees. If your are
not the intended recipient of this message or if you have received it
uncomplete or altered, please notify the author by replying to his e-mail
immediately. Any unauthorised use, diffusion or dissemination not
expressly authorised by us in writing is strictly prohibited.
=
Copyright Valtech 2000











indexing in tag 'iterate'

2001-06-29 Thread guido . roth

Hi

I need a form representing a two-dimensional array of input fields.

Can anybody tell me what the appropriate solution in Struts 1.0 looks like?

Despite numerous attempts to solve this with Struts, I did not succeed. My
attempted solution (in fact, one of them) looks like that
('account', 'amount' and 'remark' are indexed properties of the Bean
represented by 'report'):

...
table
tr
thAccount/ththAmount/ththRemark/th
/tr
bean:define id=report type=ReportForm toScope=session  name=select
property=report scope=session/
html:form name=report type=ReportForm scope=session action=log.do
logic:iterate name=report property=entries id=entry indexId
=entryId
tr
tdhtml:text name=report property=account[entryId]//td
tdhtml:text name=report property=amount[entryId]//td
tdhtml:text name=report property=remark[entryId]//td
/tr
/logic:iterate
trtd colspan=3center
html:submit
  bean:message key=button.submit/
/html:submit
/td/tr
/html:form
/table

This causes the exception:

java.lang.IllegalArgumentException: Invalid indexed property
'account[entryId]'
at
org.apache.struts.util.PropertyUtils.getIndexedProperty(PropertyUtils.java:308)
at
org.apache.struts.util.PropertyUtils.getNestedProperty(PropertyUtils.java,
Compiled Code)
at
org.apache.struts.util.PropertyUtils.getProperty(PropertyUtils.java:453)
at
org.apache.struts.util.RequestUtils.lookup(RequestUtils.java:503)
at
org.apache.struts.taglib.html.BaseFieldTag.doStartTag(BaseFieldTag.java:188)
at _0002freport_0002ejspreport_jsp_38._jspService
(_0002freport_0002ejspreport_jsp_38.java, Compiled Code)
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,
Compiled Code)
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:1758)
at
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1595)
at
org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:509)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
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.connector.Ajp12ConnectionHandler.processConnection(Ajp12ConnectionHandler.java:166)
at
org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java,
Compiled Code)
at
org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java,
Compiled Code)
at java.lang.Thread.run(Thread.java:479)

If I replace the index variable 'entryId' by a literal number (see below),
this works so far (though it is not 'meaningful', ); thus the environment
(beans etc.) seems to be OK.
...
table
tr
thAccount/ththAmount/ththRemark/th
/tr
bean:define id=report type=ReportForm toScope=session  name=select
property=report scope=session/
html:form name=report type=ReportForm scope=session action=log.do
logic:iterate name=report property=entries id=entry indexId
=entryId
tr
tdhtml:text name=report property=account[2]//td
tdhtml:text name=report property=amount[2]//td
tdhtml:text name=report property=remark[2]//td
/tr
/logic:iterate
trtd colspan=3center
html:submit
  bean:message key=button.submit/
/html:submit
/td/tr
/html:form
/table

I suppose there must be a solution in Struts for this standard problem. How
does it look like?

Thanks if you can bring me on the right track.

Guido