RE: checkbox and iterate problem

2003-02-26 Thread pqin
Have to set default value in reset method.

Regards,
 
 
PQ
 
This Guy Thinks He Knows Everything
This Guy Thinks He Knows What He Is Doing

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
Sent: February 26, 2003 1:18 PM
To: [EMAIL PROTECTED]
Subject: checkbox and iterate problem

Hi,
 I'm having a problem with checkboxes and I was hoping someone could help.

 The short version is:
   when using logic:iteratate over an array of checkboxes, the setter
method is not called after submit

 Long version
   I have class   CheckableString { String str; boolean checked = false;
// etc.. };
   I have a Form
   HostForm extends ActionForm {
 CheckableString[] mFolders = new CheckableString[100];
public CheckableString getFolder(int n) {
System.err.println(HostForm getFolder a  + mFolders[n]);
return mFolders[n];
}
public CheckableString[] getFolder() {
System.err.println(HostForm getFolder b  + this);
for (int i = 0; i != mFolders.length; i++) {
System.err.println(HostForm getFolder b  +
mFolders[i]);
}
return mFolders;
}
public void setFolder(int n, CheckableString folders) {
System.err.println(HostForm setFolder a  + folders +   +
this);
mFolders[n] = folders;
}
public void setFolder(CheckableString[] folders) {
System.err.println(HostForm setFolder b  + this);
mFolders = folders;
}
public void reset(ActionMapping a, HttpServletRequest b) {
System.err.println(HostForm reset  + this);
flag = false;
for (int i = 0; i != mFolders.length; i++) {
System.err.println(HostForm reset 
+ mFolders[i]);
if (mFolders[i] != null)

mFolders[i].setChecked(false);
}
}
}

I have an Action class setup the form, populating values from a
database,
it then forwards to a jsp page
html:form
..
logic:iterate id=quack name=hostForm property=folder
indexId=index
logic:present name='quack'
  tr
th align=left
   html:checkbox indexed='true' value='true' property=checked
name='quack' /
   bean:write name=quack/   bean:write name=index/
/th
  /tr
/logic:present
/logic:iterate



The form is populated correctly, items marked as true are selected. And
looking at the logs the getter function is called
The problem is when I submit, the setter function is NEVER called, and the
Form is not populated.
note: If I have a simple non-indexed checkbox, then that works as expected
and the setter is called

I am using struts 1.1RC1

Anyone got any ideas ??, I'm stumped

Thanks

Neal






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


RE: checkbox and iterate problem

2003-02-26 Thread pqin
try Boolean.FALSE (Object) instead of false (which is a primitive type).

Regards,
 
 
PQ
 
This Guy Thinks He Knows Everything
This Guy Thinks He Knows What He Is Doing

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
Sent: February 26, 2003 2:04 PM
To: [EMAIL PROTECTED]
Subject: RE: checkbox and iterate problem

I have a Reset method, and I am calling  mFolders[i].setChecked(false) for
each item in my array. Is that what you mean by setting the default value
?
If so, it hasn't fixed my problem.

Thanx

 Have to set default value in reset method.

 Regards,


 PQ

 This Guy Thinks He Knows Everything
 This Guy Thinks He Knows What He Is Doing

 -Original Message-
 From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
 Sent: February 26, 2003 1:18 PM
 To: [EMAIL PROTECTED]
 Subject: checkbox and iterate problem

 Hi,
  I'm having a problem with checkboxes and I was hoping someone could
 help.

  The short version is:
when using logic:iteratate over an array of checkboxes, the setter
 method is not called after submit

  Long version
I have class   CheckableString { String str; boolean checked = false;
 // etc.. };
I have a Form
HostForm extends ActionForm {
  CheckableString[] mFolders = new CheckableString[100];
   public CheckableString getFolder(int n) {
   System.err.println(HostForm getFolder a  + mFolders[n]);
   return mFolders[n];
   }
   public CheckableString[] getFolder() {
   System.err.println(HostForm getFolder b  + this);
   for (int i = 0; i != mFolders.length; i++) {
   System.err.println(HostForm getFolder b  +
 mFolders[i]);
   }
   return mFolders;
   }
   public void setFolder(int n, CheckableString folders) {
   System.err.println(HostForm setFolder a  + folders +   +
 this);
   mFolders[n] = folders;
   }
   public void setFolder(CheckableString[] folders) {
   System.err.println(HostForm setFolder b  + this);
   mFolders = folders;
   }
   public void reset(ActionMapping a, HttpServletRequest b) {
   System.err.println(HostForm reset  + this);
   flag = false;
   for (int i = 0; i != mFolders.length; i++) {
   System.err.println(HostForm reset 
 + mFolders[i]);
   if (mFolders[i] != null)

 mFolders[i].setChecked(false);
   }
   }
   }

   I have an Action class setup the form, populating values from a
 database,
 it then forwards to a jsp page
 html:form
 ..
 logic:iterate id=quack name=hostForm property=folder
 indexId=index
 logic:present name='quack'
   tr
 th align=left
html:checkbox indexed='true' value='true' property=checked
 name='quack' /
bean:write name=quack/   bean:write name=index/
 /th
   /tr
 /logic:present
 /logic:iterate
 


 The form is populated correctly, items marked as true are selected. And
 looking at the logs the getter function is called
 The problem is when I submit, the setter function is NEVER called, and
 the Form is not populated.
 note: If I have a simple non-indexed checkbox, then that works as
 expected and the setter is called

 I am using struts 1.1RC1

 Anyone got any ideas ??, I'm stumped

 Thanks

 Neal






 - 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: Tomcat 4.1.18, DBCP, DataSources - What are people using?

2003-02-26 Thread pqin
What is the bug that you discovered? Mine works just fine.

Tomcat 4.1.18
Struts 1.1-rc1
Oracle 8i

Regards,
 
 
PQ
 
This Guy Thinks He Knows Everything
This Guy Thinks He Knows What He Is Doing

-Original Message-
From: David Haynes [mailto:[EMAIL PROTECTED] 
Sent: February 26, 2003 4:43 PM
To: [EMAIL PROTECTED]
Subject: Tomcat 4.1.18, DBCP, DataSources - What are people using?

After working on this for most of the day, I have discovered that Tomcat
4.1.18 and DBCP do not play well together. There is a bug against Tomcat
for this (I have *got* to remember to check the bugs databases sooner
;-) ), but no analysis or corrective action has been recorded to date.
 
So, my question is this. What are people using for their DataSource?
 
My environment is:
Tomcat 4.1.18
Struts 1.1rc1
Oracle 9i
JDBC
 
Thanks!
-david-


RE: Tomcat 4.1.18, DBCP, DataSources - What are people using?

2003-02-26 Thread pqin
Make sure commons-dbcp and pooling are not in your common/lib, use tomcat's.

Besides, I don't use struts datasource, I use Tomcat JNDI datasource and
pooling.

Regards,
 
 
PQ
 
This Guy Thinks He Knows Everything
This Guy Thinks He Knows What He Is Doing

-Original Message-
From: David Haynes [mailto:[EMAIL PROTECTED] 
Sent: February 26, 2003 5:12 PM
To: 'Struts Users Mailing List'
Subject: RE: Tomcat 4.1.18, DBCP, DataSources - What are people using?

I'm setting up named data sources with the following:
data-sources
data-source key=eha
type=org.apache.commons.dbcp.BasicDataSource
set-property property=autoCommit
value=false/
set-property property=description
value=EHA Definition/
set-property property=driverClass
value=oracle.jdbc.driver.OracleDriver/
set-property property=maxCount
value=4/
set-property property=minCount
value=2/
set-property property=url

value=jdbc:oracle:thin:@citation:1521/citation/
set-property property=user
value=david/
set-property property=password
value=secret/
/data-source
/data-sources

In my Action, I reference this as:
DataSource ds = getDataSource(req, eha);

Tomcat reports the following in catalina.out:
SQLException: Cannot load JDBC driver class 'null'

-david-


-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
Sent: February 26, 2003 4:55 PM
To: [EMAIL PROTECTED]
Subject: RE: Tomcat 4.1.18, DBCP, DataSources - What are people using?

What is the bug that you discovered? Mine works just fine.

Tomcat 4.1.18
Struts 1.1-rc1
Oracle 8i

Regards,
 
 
PQ
 
This Guy Thinks He Knows Everything
This Guy Thinks He Knows What He Is Doing

-Original Message-
From: David Haynes [mailto:[EMAIL PROTECTED] 
Sent: February 26, 2003 4:43 PM
To: [EMAIL PROTECTED]
Subject: Tomcat 4.1.18, DBCP, DataSources - What are people using?

After working on this for most of the day, I have discovered that Tomcat
4.1.18 and DBCP do not play well together. There is a bug against Tomcat
for this (I have *got* to remember to check the bugs databases sooner
;-) ), but no analysis or corrective action has been recorded to date.
 
So, my question is this. What are people using for their DataSource?
 
My environment is:
Tomcat 4.1.18
Struts 1.1rc1
Oracle 9i
JDBC
 
Thanks!
-david-


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


RE: Tomcat 4.1.18, DBCP, DataSources - What are people using?

2003-02-26 Thread pqin
Sorry, make sure top use commons-dbcp and pooling in tomcat's common/lib.
Since Tomcat JNDI is tomcat's not struts'.

Regards,
 
 
PQ
 
This Guy Thinks He Knows Everything
This Guy Thinks He Knows What He Is Doing

-Original Message-
From: Raible, Matt [mailto:[EMAIL PROTECTED] 
Sent: February 26, 2003 5:24 PM
To: 'Struts Users Mailing List'
Subject: RE: Tomcat 4.1.18, DBCP, DataSources - What are people using?

I use Tomcat's JNDI database, not struts - my config is below.  Make sure
that classes12.jar is in common/lib.

Matt

web.xml
resource-ref
descriptionDB Connection/description
res-ref-namejdbc/mydb/res-ref-name
res-typejavax.sql.DataSource/res-type
res-authContainer/res-auth
/resource-ref

webapps/mycontext.xml
Resource name=jdbc/mydb auth=Container
type=javax.sql.DataSource/

ResourceParams name=jdbc/mydb
parameter
namefactory/name
valueorg.apache.commons.dbcp.BasicDataSourceFactory/value
/parameter
!-- Maximum number of dB connections in pool. 
Set to 0 for no limit. --
parameter
namemaxActive/name
value50/value
/parameter
!-- Maximum number of idle dB connections to retain in pool.
Set to 0 for no limit. --
parameter
namemaxIdle/name
value10/value
/parameter
!-- Maximum time to wait for a dB connection to become available
 in ms, in this example 10 seconds. An Exception is thrown if
 this timeout is exceeded.  Set to -1 to wait indefinitely. --
parameter
namemaxWait/name
value1/value
/parameter
!-- Database username and password for connections  --
parameter
nameusername/name
valueusername/value
/parameter
parameter
namepassword/name
valuepassword/value
/parameter
!-- Class name for Oracle JDBC driver --
parameter
namedriverClassName/name
valueoracle.jdbc.pool.OracleConnectionPoolDataSource/value
/parameter
!-- The JDBC connection url for connecting to your db. --
parameter
nameurl/name
valuejdbc:oracle:thin:@hostname:1521:SID/value
/parameter
parameter
nameremoveAbandoned/name
valuetrue/value
/parameter
parameter
nameremoveAbandonedTimeout/name
value60/value
/parameter
parameter
namelogAbandoned/name
valuetrue/value
/parameter
parameter
namevalidationQuery/name
valueSELECT 1 FROM DUAL/value
/parameter
/ResourceParams

 -Original Message-
 From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
 Sent: Wednesday, February 26, 2003 3:15 PM
 To: [EMAIL PROTECTED]
 Subject: RE: Tomcat 4.1.18, DBCP, DataSources - What are people using?
 
 
 Make sure commons-dbcp and pooling are not in your common/lib, use
 tomcat's.
 
 Besides, I don't use struts datasource, I use Tomcat JNDI 
 datasource and
 pooling.
 
 Regards,
  
  
 PQ
  
 This Guy Thinks He Knows Everything
 This Guy Thinks He Knows What He Is Doing
 
 -Original Message-
 From: David Haynes [mailto:[EMAIL PROTECTED] 
 Sent: February 26, 2003 5:12 PM
 To: 'Struts Users Mailing List'
 Subject: RE: Tomcat 4.1.18, DBCP, DataSources - What are people using?
 
 I'm setting up named data sources with the following:
 data-sources
   data-source key=eha
 type=org.apache.commons.dbcp.BasicDataSource
   set-property property=autoCommit
   value=false/
   set-property property=description
   value=EHA Definition/
   set-property property=driverClass
   value=oracle.jdbc.driver.OracleDriver/
   set-property property=maxCount
   value=4/
   set-property property=minCount
   value=2/
   set-property property=url
   
 value=jdbc:oracle:thin:@citation:1521/citation/
   set-property property=user
   value=david/
   set-property property=password
   value=secret/
   /data-source
 /data-sources
 
 In my Action, I reference this as:
 DataSource ds = getDataSource(req, eha);
 
 Tomcat reports the following in catalina.out:
 SQLException: Cannot load JDBC driver class 'null'
 
 -david-
 
 
 -Original Message-
 From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
 Sent: February 26, 2003 4:55 PM
 To: [EMAIL PROTECTED]
 Subject: RE: Tomcat 4.1.18, DBCP, DataSources - What are people using?
 
 What is the bug that you discovered? Mine works just fine.
 
 Tomcat 4.1.18
 Struts 1.1-rc1
 Oracle 8i
 
 Regards,
  
  
 PQ
  
 This Guy Thinks He Knows Everything
 This Guy Thinks He Knows 

RE: checkbox and iterate problem

2003-02-26 Thread pqin
Mine is Collection, so I iterate thru the collection and set false
(String) to each checked.

Regards,
 
 
PQ
 
This Guy Thinks He Knows Everything
This Guy Thinks He Knows What He Is Doing

-Original Message-
From: Neal [mailto:[EMAIL PROTECTED] 
Sent: February 26, 2003 5:20 PM
To: [EMAIL PROTECTED]
Subject: RE: checkbox and iterate problem

I changed everything from boolean (primative) to Boolean (Object type), no
difference
I still see the same behavior.
After submit my setter function is not called.
but for a non-indexed checkbox it is called.

However the getter() is always called.

Neal

 try Boolean.FALSE (Object) instead of false (which is a primitive type).

 Regards,


 PQ

 This Guy Thinks He Knows Everything
 This Guy Thinks He Knows What He Is Doing

 -Original Message-
 From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
 Sent: February 26, 2003 2:04 PM
 To: [EMAIL PROTECTED]
 Subject: RE: checkbox and iterate problem

 I have a Reset method, and I am calling  mFolders[i].setChecked(false)
 for each item in my array. Is that what you mean by setting the default
 value ?
 If so, it hasn't fixed my problem.

 Thanx

 Have to set default value in reset method.

 Regards,


 PQ

 This Guy Thinks He Knows Everything
 This Guy Thinks He Knows What He Is Doing

 -Original Message-
 From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
 Sent: February 26, 2003 1:18 PM
 To: [EMAIL PROTECTED]
 Subject: checkbox and iterate problem

 Hi,
  I'm having a problem with checkboxes and I was hoping someone could
 help.

  The short version is:
when using logic:iteratate over an array of checkboxes, the
 setter
 method is not called after submit

  Long version
I have class   CheckableString { String str; boolean checked =
 false;
 // etc.. };
I have a Form
HostForm extends ActionForm {
  CheckableString[] mFolders = new CheckableString[100];
  public CheckableString getFolder(int n) {
  System.err.println(HostForm getFolder a  + mFolders[n]);
  return mFolders[n];
  }
  public CheckableString[] getFolder() {
  System.err.println(HostForm getFolder b  + this);
  for (int i = 0; i != mFolders.length; i++) {
  System.err.println(HostForm getFolder b  +
 mFolders[i]);
  }
  return mFolders;
  }
  public void setFolder(int n, CheckableString folders) {
  System.err.println(HostForm setFolder a  + folders +   +
 this);
  mFolders[n] = folders;
  }
  public void setFolder(CheckableString[] folders) {
  System.err.println(HostForm setFolder b  + this);
  mFolders = folders;
  }
  public void reset(ActionMapping a, HttpServletRequest b) {
  System.err.println(HostForm reset  + this);
  flag = false;
  for (int i = 0; i != mFolders.length; i++) {
  System.err.println(HostForm reset 
 + mFolders[i]);
  if (mFolders[i] != null)

 mFolders[i].setChecked(false);
  }
  }
  }

  I have an Action class setup the form, populating values from a
 database,
 it then forwards to a jsp page
 html:form
 ..
 logic:iterate id=quack name=hostForm property=folder
 indexId=index
 logic:present name='quack'
   tr
 th align=left
html:checkbox indexed='true' value='true' property=checked
 name='quack' /
bean:write name=quack/   bean:write name=index/
 /th
   /tr
 /logic:present
 /logic:iterate
 


 The form is populated correctly, items marked as true are selected.
 And looking at the logs the getter function is called
 The problem is when I submit, the setter function is NEVER called, and
 the Form is not populated.
 note: If I have a simple non-indexed checkbox, then that works as
 expected and the setter is called

 I am using struts 1.1RC1

 Anyone got any ideas ??, I'm stumped

 Thanks

 Neal






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




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




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


RE: Reporting an Exception message in a JSP.

2003-02-25 Thread pqin
If you want to show your error message on the page where error occurs, there
is no easy way than html:error/.

Regards,
 
 
PQ
 
This Guy Thinks He Knows Everything
This Guy Thinks He Knows What He Is Doing

-Original Message-
From: ROSSEL Olivier [mailto:[EMAIL PROTECTED] 
Sent: February 25, 2003 10:03 AM
To: '[EMAIL PROTECTED]'
Subject: Reporting an Exception message in a JSP.

I want to display the error message of an SQLException
in my JSP.

At first, I tried to set an ActionError with this message and
to display it via html:errors/.
It does not work because ActionError accepts as an input
string the key of a property.

So what's the nicest way to show to the user the error message
that I get from my SQLException ?


---cut here---


This e-mail is intended only for the above addressee. It may contain
privileged information. If you are not the addressee you must not copy,
distribute, disclose or use any of the information in it. If you have
received it in error please delete it and immediately notify the sender.
Security Notice: all e-mail, sent to or from this address, may be
accessed by someone other than the recipient, for system management and
security reasons. This access is controlled under Regulation of
Investigatory Powers Act 2000, Lawful Business Practises.

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


RE: Reporting an Exception message in a JSP.

2003-02-25 Thread pqin
I usually log SQLExceptions in log file and display An unexpected error
occurred, please contact your sys admin.

Regards,
 
 
PQ
 
This Guy Thinks He Knows Everything
This Guy Thinks He Knows What He Is Doing

-Original Message-
From: John Espey [mailto:[EMAIL PROTECTED] 
Sent: February 25, 2003 10:19 AM
To: Struts Users Mailing List
Subject: RE: Reporting an Exception message in a JSP.

Quick questiondo you really want the user to see a SQLException message?

Assuming that is really what you want, there are constructors for AE that
take a key and up to four objects that will be substituted in the error
value that is specified for the key.  The key and value appear in
ApplicationResources.properties.  So you could do the following in your
action:
catch (SQLException e)
{
ActionErrors errors = new ActionErrors();
errors.add(ActionErrors.GLOBAL_ERROR, new
ActionError(sql.exception,
e.getMessage()));
saveErrors(request, errors);
return mapping.findForward(systemexception);
}


and then have this entry:
sql.exception=A database access error occurred.  {0}

The error message should then have the exception's message appear in it in
your error page.

Hope this helps



 -Original Message-
 From: ROSSEL Olivier [mailto:[EMAIL PROTECTED]
 Sent: Tuesday, February 25, 2003 9:03 AM
 To: '[EMAIL PROTECTED]'
 Subject: Reporting an Exception message in a JSP.


 I want to display the error message of an SQLException
 in my JSP.

 At first, I tried to set an ActionError with this message and
 to display it via html:errors/.
 It does not work because ActionError accepts as an input
 string the key of a property.

 So what's the nicest way to show to the user the error message
 that I get from my SQLException ?


 ---cut here---


 This e-mail is intended only for the above addressee. It may contain
 privileged information. If you are not the addressee you must not copy,
 distribute, disclose or use any of the information in it. If you have
 received it in error please delete it and immediately notify the sender.
 Security Notice: all e-mail, sent to or from this address, may be
 accessed by someone other than the recipient, for system management and
 security reasons. This access is controlled under Regulation of
 Investigatory Powers Act 2000, Lawful Business Practises.

 -
 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: Reporting an Exception message in a JSP.

2003-02-25 Thread pqin
Solution 1:

- Add error to ActionMessage.
- Display the above message as a hidden field on the same page.
- Meanwhile, display a friendly message to user on the same page.

Solution 2:

- log exception to a file.
- display friendly message to user on the same page.


Regards,
 
 
PQ
 
This Guy Thinks He Knows Everything
This Guy Thinks He Knows What He Is Doing

-Original Message-
From: Robert S. Sfeir [mailto:[EMAIL PROTECTED] 
Sent: February 25, 2003 10:30 AM
To: Struts Users Mailing List
Subject: Re: Reporting an Exception message in a JSP.


On Tuesday, Feb 25, 2003, at 10:14 US/Eastern, David Graham wrote:

 Well, I would never show my user an error message from some low level 
 system such as the database.  If you really want them to see this info 
 you could define a message key as anything={0} and substitute your SQL 
 message.  I highly discourage this but it's an option.

True but in my case I find it sometimes easier to turn on debugging 
from my browser on a live app to see what's causing the exception the 
user is seeing without having to look at logs or anything, so while the 
user never sees this error in normal processing, I can see the 
exception when trying to debug and figure out what's going on on a live 
app.

I don't know if this was the original poster's intent though.


R

--
Robert S. Sfeir
Senior Java Engineer
Codepuccino, Inc.
[EMAIL PROTECTED]

definition - Codepuccino n:
A Little JSP mixed with lots of Java, usually served with Servlets, a 
Datasource, a sprinkle of XML, and sometimes EJB.  (See Great MVC 
Frameworks)


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


RE: Netscape 4.7x and Struts performance problems

2003-02-25 Thread pqin
I have to disagree with Craig on the issue of banishing ns4. We are all
working on a *nix box. There are not many choices besides mozilla or ns.

Regards,
 
 
PQ
 
This Guy Thinks He Knows Everything
This Guy Thinks He Knows What He Is Doing

-Original Message-
From: Vinh Tran [mailto:[EMAIL PROTECTED] 
Sent: February 25, 2003 5:33 PM
To: Struts Users Mailing List
Subject: RE: Netscape 4.7x and Struts performance problems

I have to believe your issue is with nested tables and not Struts. Are you
experiencing performance problems with only pages containing nested tables?
The issue with nested tables has been fixed in Netscape 7. Try this browser
to see if the performance issues go away.

Vinh

-Original Message-
From: Craig R. McClanahan [mailto:[EMAIL PROTECTED]
Sent: Tuesday, February 25, 2003 5:02 PM
To: Struts Users Mailing List
Subject: Re: Netscape 4.7x and Struts performance problems




On Tue, 25 Feb 2003, scarter wrote:

 Date: Tue, 25 Feb 2003 14:09:53 -0500
 From: scarter [EMAIL PROTECTED]
 Reply-To: Struts Users Mailing List [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Subject: Netscape 4.7x and Struts performance problems

 Several months ago there was a discussion in this list about poor
 performance of Struts applications when using Netscape 4.7x as a
 browser.  I've been developing in Netscape for quite a few years now and
 I don't think I've ever seen a more obvious difference between the
 performance of IE and Netscape.  I have other applications that are not
 based on Struts that perform much better, so the obvious thing is that
 this problem has to be related to Struts somehow, although its not clear
 how.


This could also be an artifact of the servlet container you are running.
For example, the peformance difference from running JSP pages with lots of
custom tags (i.e. your typical Struts-based app) on current Tomcat 4.1.x
releases, versus older ones, is nothing short of amazing due to
improvements in the JSP page compiler.

But these issues would cause visible performance differences for all
browsers, not just Netscape 4.7.x.

 Has anyone determined what causes this problem and how to resolve it?
 I'm aware that Netscape has a difficult time rendering nested tables,
 which we have minimized, however, other than use of Struts taglibs,
 there are no differences between the pages I am using now and the ones I
 have that do not use Struts, except that the non-struts ones perform
 much better in Netscape.


You're probably not going to like my advice, but IMHO Netscape 4.x should
be banished from the list of browsers supported by modern webapps.
Besides the performance related issues you allude to (which a server side
framework can't really do anything about), 4.x support for CSS and
JavaScript is pretty hideous.

 Any advice would be greatly appreciated.

 Thanks,

 Scott Carter


Craig

-
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: Netscape 4.7x and Struts performance problems

2003-02-25 Thread pqin
This time I agree. :)

Regards,
 
 
PQ
 
This Guy Thinks He Knows Everything
This Guy Thinks He Knows What He Is Doing

-Original Message-
From: Craig R. McClanahan [mailto:[EMAIL PROTECTED] 
Sent: February 25, 2003 5:47 PM
To: Struts Users Mailing List
Subject: RE: Netscape 4.7x and Struts performance problems



On Tue, 25 Feb 2003 [EMAIL PROTECTED] wrote:

 Date: Tue, 25 Feb 2003 17:33:50 -0500
 From: [EMAIL PROTECTED]
 Reply-To: Struts Users Mailing List [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Subject: RE: Netscape 4.7x and Struts performance problems

 I have to disagree with Craig on the issue of banishing ns4. We are all
 working on a *nix box. There are not many choices besides mozilla or ns.


Mozilla 1.2.1 kicks butt on Linux for me, including better performance
than Netscape on basically every website and webapp I access with it.  In
addition to the incremental rendering of nested tables (which improves
*perceived* performance even if it didn't change the total amount of time
requird), it's just faster at rendering everything than 4.7 was.

If you need to stick with the brand name to satisfy pointy-haired bosses,
Netscape 7 is based on the same rendering engine (Gecko) as Mozilla, so it
shares the improved performance and standards conformance (although it's
based on Mozilla 1.0 code rather than 1.1).

 Regards,


 PQ

Craig

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


how old is struts

2003-02-21 Thread pqin
Craig,

 

Since you are one of the developers of struts, can you tell me how old is
this project?

 

 

Regards,

 

 

 

PQ

 

This Guy Thinks He Knows Everything

This Guy Thinks He Knows What He Is Doing

 



RE: how old is struts

2003-02-21 Thread pqin
I asked this question is because there is a funny recruitment ad from a
major Canadian bank hiring some one with 2 - 3 years experience of struts.

Regards,
 
 
PQ
 
This Guy Thinks He Knows Everything
This Guy Thinks He Knows What He Is Doing

-Original Message-
From: Trieu, Danny [mailto:[EMAIL PROTECTED] 
Sent: February 21, 2003 4:40 PM
To: 'Struts Users Mailing List'
Subject: RE: how old is struts

I started looking into Struts about 2yrs ago, and it was about 6mons old
since Craig donated it.

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
Sent: Friday, February 21, 2003 1:34 PM
To: [EMAIL PROTECTED]
Subject: how old is struts


Craig,

 

Since you are one of the developers of struts, can you tell me how old is
this project?

 

 

Regards,

 

 

 

PQ

 

This Guy Thinks He Knows Everything

This Guy Thinks He Knows What He Is Doing

 


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


RE: html:select validation

2003-02-05 Thread pqin
I suspect that you have to override reset method in your ActionForm class to
set default value of checkbox.

Regards,
 
 
PQ
 
This Guy Thinks He Knows Everything
This Guy Thinks He Knows What He Is Doing

-Original Message-
From: Suresh Addagalla [mailto:[EMAIL PROTECTED]] 
Sent: February 5, 2003 9:27 AM
To: 'Struts Users Mailing List'
Subject: html:select validation

Hi,

I have an html:select with multiple option as follows.

html:select multiple=true size=3 property=serviceSetOfService
  html:options collection=serviceSets property=code
labelProperty=name/
/html:select

My validator fails to validate the above one for required. If I leave
the selection box without selecting and submit the form, Validator
doesn't complain. Pls let me know if anyone has a clue why this is
happening.

My validation.xml has:

field property=serviceSetOfService
depends=required
arg0 key=text.services.serviceset/
 /field

Thanks,
Suresh




RE: nested taglibs / Struts 1.1 beta 3

2003-02-05 Thread pqin
If you don't want to pay for it right because of time constraint, you will
have to pay even more in the future. Upgrading from 1.0 to 1.1 as soon as
possible should reduce the pain.

Nested tag: I don't have any problem, could you post your code so we can
have a look?


Regards,
 
 
PQ
 
This Guy Thinks He Knows Everything
This Guy Thinks He Knows What He Is Doing

-Original Message-
From: Sri Sankaran [mailto:[EMAIL PROTECTED]] 
Sent: February 5, 2003 9:32 AM
To: Struts Users Mailing List
Subject: RE: nested taglibs / Struts 1.1 beta 3

I faced a similar error in porting my application from Struts 1.0.2 to
1.1b3.   Problem persists on nightly (as late as Jan 31) as well.  I have
even written to Arron to see if he is aware of a problem.

You *may* be able to work around this problem by including the
nested_1_0.jar -- the jar that is to be used with Struts 1.0.  Since 'n'
comes before 's' alphabetically, this jar file is loaded before struts.jar.


While this may get you past the current problem you may trip up on others.
In my case, including nested_1_0.jar fixed the first problem but this
solution failed on a subsequent page -- I think  on a nested:define.

So, what am *I* doing?  I am back at Struts 1.0.2 since I don't have the
time to rewrite my entire application in a manner that works with 1.1.  Time
permitting, I might try to trace the cause of the error in the nested tags.

Sri

-Original Message-
From: Christoph Rooms [mailto:[EMAIL PROTECTED]] 
Sent: Wednesday, February 05, 2003 9:01 AM
To: [EMAIL PROTECTED]
Subject: nested taglibs / Struts 1.1 beta 3


hi all,

My application, using nested taglibs, used to work fine under struts 1.1
beta 1. 

I upgraded now to 1.1 beta version 3, and i suddenly get this error witin my
jsp page. 

javax.servlet.jsp.JspException: No getter method for property
translatedObjects[0].language of bean team

I feel like this is a bug ? Anyone else found this bug ?

Also strange is that he will not show this error within by Tiles page ... he
will just give a blank page. I needed to forward my action to the actual jsp
itself. 

Anyone ? 

Thanks, Christoph

Christoph Rooms
TAM
+ 32 475 531 529

Novell Positioned as a Leader in Analyst Firm's Metadirectory Magic
Quadrant 
Novell is the first, and thus far only, company to enter the Leader Quadrant
of Gartner's Metadirectory Services Magic Quadrant. Leaders are vendors who
are performing well today, have a clear vision of market direction, and are
actively building competencies to sustain their leadership position in the
market. Read more and find out how to access the report at
www.novell.com/news/press/archive/2002/08/pr02058.html


-
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: Again: to include or not to include thirdparty jars in my distribution?

2003-02-05 Thread pqin
I am not expert. I use Tomcat and struts. I found that even though my app
uses commons-dbcp, I don't have to include it into my WEB-INF/lib because it
is in Tomcat's common/lib. I guess the requirement is container based. Of
course, if not to include only works if all apps use the same release of
3rd party lib.

Regards,
 
 
PQ
 
This Guy Thinks He Knows Everything
This Guy Thinks He Knows What He Is Doing

-Original Message-
From: Marco Tedone [mailto:[EMAIL PROTECTED]] 
Sent: February 5, 2003 9:45 AM
To: Struts-user-list 
Subject: Again: to include or not to include thirdparty jars in my
distribution?

Hi,
 
as my first question has not been replied but i'm sure that this is a
community of expert, i make again the question:
 
shall i include thirdparty jars in my distribution? Thirdparty like commons,
Jboss clients, xmlparsers and so on...
 
Regards,
 
Marco



action mapping

2003-02-05 Thread pqin
I remembered some one on the list had said that ActionMapping is deprecated
in 1.1b3. If ActionMapping is deprecated, why all those Action.execute still
accept ActionMapping as argument?

 

Regards,

 

 

 

PQ

 

This Guy Thinks He Knows Everything

This Guy Thinks He Knows What He Is Doing

 




RE: How do i keep the commons-*.jar files from being required? (Weblogic 5.1)

2003-02-05 Thread pqin
I think Tomcat is more friendly to struts than other containers because it
has some of the commons-* jars installed in common/lib. Even though I didn't
include commons-pool and commons-dbcp in my WEB-INF/lib, my commons
implementation of connection pool still works - I know it breaks the rule.

Regards,
 
 
PQ
 
This Guy Thinks He Knows Everything
This Guy Thinks He Knows What He Is Doing

-Original Message-
From: Craig R. McClanahan [mailto:[EMAIL PROTECTED]] 
Sent: February 5, 2003 11:58 AM
To: Struts Users Mailing List
Subject: Re: How do i keep the commons-*.jar files from being required?
(Weblogic 5.1)



On Wed, 5 Feb 2003 [EMAIL PROTECTED] wrote:

 Date: Wed, 5 Feb 2003 11:02:19 -0500 (EST)
 From: [EMAIL PROTECTED]
 Reply-To: Struts Users Mailing List [EMAIL PROTECTED]
 To: Struts Users Mailing List [EMAIL PROTECTED]
 Subject: How do i keep the commons-*.jar files from being required?
 (Weblogic 5.1)

 hi folks,

   I just upgraded from struts 1.0.2 to 1.1b3 and when i restarted my app
server (Weblogic 5.1) it complains with the output below.  I added the
commons-beanutils.jar to the classpath, then it complained about another
commons-*.jar.  How can i make struts not require these jars?  I didn't have
to use them in 1.0.2, but now i don't know what to do.


Struts 1.1 itself requires all of the commons-*.jar files that it ships
with.  It won't run without them, so you must include them as well as
struts.jar in your webapp.

 TIA,
 Jason


Craig

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



RE: How do i keep the commons-*.jar files from being required? (Weblogic 5.1)

2003-02-05 Thread pqin
Maybe they are trying to save disk space.

Regards,
 
 
PQ
 
This Guy Thinks He Knows Everything
This Guy Thinks He Knows What He Is Doing

-Original Message-
From: David Graham [mailto:[EMAIL PROTECTED]] 
Sent: February 5, 2003 12:58 PM
To: [EMAIL PROTECTED]
Subject: RE: How do i keep the commons-*.jar files from being required?
(Weblogic 5.1)

But the version of those commons jars may be different than what Struts 
requires.  I'm amazed by the amount of time people spend on this issue when 
they could just copy all the jars into WEB-INF/lib and be done with it.

David



From: [EMAIL PROTECTED]
Reply-To: Struts Users Mailing List [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Subject: RE: How do i keep the commons-*.jar files from being required? 
(Weblogic 5.1)
Date: Wed, 5 Feb 2003 12:52:07 -0500

I think Tomcat is more friendly to struts than other containers because it
has some of the commons-* jars installed in common/lib. Even though I 
didn't
include commons-pool and commons-dbcp in my WEB-INF/lib, my commons
implementation of connection pool still works - I know it breaks the 
rule.

Regards,


PQ

This Guy Thinks He Knows Everything
This Guy Thinks He Knows What He Is Doing

-Original Message-
From: Craig R. McClanahan [mailto:[EMAIL PROTECTED]]
Sent: February 5, 2003 11:58 AM
To: Struts Users Mailing List
Subject: Re: How do i keep the commons-*.jar files from being required?
(Weblogic 5.1)



On Wed, 5 Feb 2003 [EMAIL PROTECTED] wrote:

  Date: Wed, 5 Feb 2003 11:02:19 -0500 (EST)
  From: [EMAIL PROTECTED]
  Reply-To: Struts Users Mailing List [EMAIL PROTECTED]
  To: Struts Users Mailing List [EMAIL PROTECTED]
  Subject: How do i keep the commons-*.jar files from being required?
  (Weblogic 5.1)
 
  hi folks,
 
I just upgraded from struts 1.0.2 to 1.1b3 and when i restarted my app
server (Weblogic 5.1) it complains with the output below.  I added the
commons-beanutils.jar to the classpath, then it complained about another
commons-*.jar.  How can i make struts not require these jars?  I didn't 
have
to use them in 1.0.2, but now i don't know what to do.
 

Struts 1.1 itself requires all of the commons-*.jar files that it ships
with.  It won't run without them, so you must include them as well as
struts.jar in your webapp.

  TIA,
  Jason
 

Craig

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


_
Help STOP SPAM with the new MSN 8 and get 2 months FREE*  
http://join.msn.com/?page=features/junkmail


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



RE: how to access a specific object inside a List efficiently

2003-02-05 Thread pqin
TreeMap should solve the problem, sorted + quick-lookup.

Regards,
 
 
PQ
 
This Guy Thinks He Knows Everything
This Guy Thinks He Knows What He Is Doing

-Original Message-
From: Rob Kischuk [mailto:[EMAIL PROTECTED]] 
Sent: February 5, 2003 12:57 PM
To: 'Struts Users Mailing List'
Subject: RE: how to access a specific object inside a List efficiently

The problem you're hitting is that there's really no concept of a key in a
List - it's just an ordered collection of objects.  The closest you'd find
is the contains( Object o) method, but that looks for the entire object and
not just a key.  I would suggest using a HashMap for what you're looking
for.

As for the break on logic:iterate, I think the closest way to approximate
this is by setting up a flag for the loop such that you can do this:

set up loop flag
logic:iterate
  logic:equals name=loopFlag value=true
(do important stuff)
  /logic:equals
   set loopFlag to false when criteria are met
/logic:iterate

This won't save the loop iterations, but will keep extra content from being
written after you meet the criteria.  If possible, however, you may want to
trim your data set in the Action before you ever get to the jsp.

-Rob

-Original Message-
From: Derek Shen [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, February 05, 2003 12:51 PM
To: [EMAIL PROTECTED]
Subject: how to acccess a specific object inside a List efficiently


I have trouble to access a specific object inside a List based on a key. 
Before the first page, I load all the objects(meetings) into a list and only

show the name of the meeting to the user. By following the link (with id as 
parameter), user goes to the next page. Based on the id, I want to show the 
detail of the object (meeting). For my current implementation, I have to 
iterate through every single object in the list and try to match the key. It

works, but pretty stupid. Is there a better way to do it? Or should I use 
Hashmap (keyed by id) at the very beginning instead?

Also, to use logic:iterate, is there something like a break?

Thanks!
ds

First page:
  logic:iterate id=m name=meetings
  li
html:link
  forward=showMeeting
  paramId=id
  paramProperty=id
  paramName=m
  bean:write name=m property=name/nbsp;
/html:link
 /li
  /logic:iterate
It will build:
http://myproject/showMeeting?id=1

Second Page:
logic:iterate id=row name=meetings
logic:equal name=row property=id value=%=request.getParameter   
(id)%
  tr
TH align=right width=50%Meeting Name:/TH
TD align=leftbean:write name=row property=name//TD
  /tr
  ...
/logic:equal
/logic:iterate

_
MSN 8 helps eliminate e-mail viruses. Get 2 months FREE*.  
http://join.msn.com/?page=features/virus


-
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: How do i keep the commons-*.jar files from being required? (Weblogic 5.1)

2003-02-05 Thread pqin
Doesn't fit into a floppy.

Regards,
 
 
PQ
 
This Guy Thinks He Knows Everything
This Guy Thinks He Knows What He Is Doing

-Original Message-
From: David Graham [mailto:[EMAIL PROTECTED]] 
Sent: February 5, 2003 1:21 PM
To: [EMAIL PROTECTED]
Subject: RE: How do i keep the commons-*.jar files from being required?
(Weblogic 5.1)

Maybe they are trying to save disk space.

LOL, the total size of all the Struts 1.1 jars is 1.35MB!

David






_
STOP MORE SPAM with the new MSN 8 and get 2 months FREE*  
http://join.msn.com/?page=features/junkmail


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



RE: Struts Tools

2003-02-05 Thread pqin
I used your struts console in forte/netbeans without any problem.

Now that I have switched to Eclipse and installed your plugin 3.2. Eclipse
throws NullPointerException when I try to access the Preference - Workbench
or - file association.

Regards,
 
 
PQ
 
This Guy Thinks He Knows Everything
This Guy Thinks He Knows What He Is Doing

-Original Message-
From: James Holmes [mailto:[EMAIL PROTECTED]] 
Sent: February 5, 2003 1:12 PM
To: Struts Users Mailing List
Subject: RE: Struts Tools

Struts Console also has a plugin for Eclipse (albeit
less integrated) that supports the parameter field
of mappings.

-james
http://www.jamesholmes.com/struts/


--- [EMAIL PROTECTED] wrote:
 Just tried easy struts, don't why it didn't show me
 the parameter of a
 mapping.
 
 Regards,
  
  
 PQ
  
 This Guy Thinks He Knows Everything
 This Guy Thinks He Knows What He Is Doing
 
 -Original Message-
 From: alexj [mailto:[EMAIL PROTECTED]] 
 Sent: February 5, 2003 1:03 PM
 To: Struts Users Mailing List
 Subject: Re: Struts Tools
 
 I have use many IDE to developp with struts,
 JBuilder 8, JDevelopper,
 NetBeans, WSAP 5 but
 I like better Eclipse.
 Personaly I don't think the modeler include with
 WSAP is really an help.
 Eclipse is so ligth and in association with Easy
 Struts it's the best tools
 I've try.(and free)
 
 Chears.
 
 --
 Alexandre Jaquet
 
 
 - Original Message -
 From: Sri Sankaran [EMAIL PROTECTED]
 To: Struts Users Mailing List
 [EMAIL PROTECTED]
 Sent: Wednesday, February 05, 2003 6:55 PM
 Subject: RE: Struts Tools
 
 
 Last week's meeting of the local WebSphere Users'
 Group (WUG) included a
 demonstration of the WebSphere Studio Site Developer
 (WSSD) including Struts
 tooling.  It is quite impressive.
 
 Through the use of wizards and other intuitive aids
 WSSD eases the process
 of developing a Struts-enabled application.  It
 includes wizards for
 generating Action classes, ActionForms, mappings and
 the struts config file.
 The Web Diagram Editor (WDE -- or woody as its
 called) is quite impressive.
 It allows you to visually create form beans, actions
 and build mappings by
 drawing connectors between the various components. 
 WSSD also has this next
 generation wizard that they call Cheatsheet.  It
 literally walks you
 through the process of building a Struts-based
 application.
 
 I am not totally sold on the idea of graphical aids
 for everything but it's
 there for those who like it
 
 Sri
 
 -Original Message-
 From: Expedito Reinaldo da Silva Júnior
 [mailto:[EMAIL PROTECTED]]
 Sent: Wednesday, February 05, 2003 12:35 PM
 To: [EMAIL PROTECTED]
 Subject: Struts Tools
 
 
 Hi, All!
 
 I don´t know if I'm asking to the right list, but I
 have a question: I'd
 like to know what's the best IDE/tool to help
 construction web applications
 with Struts. I've seen some tools in the Struts
 resources page but I'm not
 impressed with them. In truth, I thought in a tool
 helping us to 'draw'
 pages with areas (tiles), buttons, input boxes, etc,
 in a way that we can
 access its properties and configure its name,
 validation rules, default
 values and so on. After creating our 'views', we
 could make the sequence of
 pages, like forward and redirect pages; and all
 visually. After all, the
 tool could generate my JSPs and the
 struts-config.xml file correctly. From
 the input boxes we could know what input fields the
 view need and generate
 the expected DynaBeans, with the respectives
 validations rules (previously
 setted). Following this idea, I thing we can
 generate our Views, FormBeans
 (DynaBeans) and Validations, and the ActionBean's
 skeleton; the user will
 just need to program the
 business rules (ActionForm.execute()).
 
 I've recently searched for drawing tools to create
 such 'framework' (or ide)
 and I find that MS Visio and System Architect has
 features that could
 produce this results. In truth, I want something
 like AllienFactory

(http://www.alien-factory.co.uk/struts/struts-index.html),
 but doing much
 more things visually.
 
 A few days ago, I've managed some training courses
 and I find that the big
 problem about the Java Language and the technologies
 it involves are the
 IDEs we have! They are very poor (I don't know about
 JBuilder... I know it's
 very good...)!!! How can we convince VB and Delphi
 programmers to migrate to
 Java with such tools?? So, I was looking at ASP .NET
 and its IDE facilities
 (I sugest you to know and you will undertand me) and
 that time I thougth
 'why cannot we have something like this'?? I really
 don't like the
 'DarkSide', but its framework helps a lot its
 programmers.
 
 Struts is the right framework,
 because its MVC separation allow us to generate a
 tool to reach such
 facilities. What do you think about it? Please
 help me make Java very
 easy besides a great language!!! I know that good
 Java programmers are also
 great experts in Design Patterns, architects and so
 on, but our language
 (Java) can 

RE: using tokens in struts,

2003-02-04 Thread pqin
Token works perfect for my app.

In my load action, I set token by saveToken(request).

In my submit action, I check token by isTokenValid(request); if invalid, I
forwards request to an error page.

Very simple.

Regards,
 
 
PQ
 
This Guy Thinks He Knows Everything
This Guy Thinks He Knows What He Is Doing

-Original Message-
From: Ashish Kulkarni [mailto:[EMAIL PROTECTED]] 
Sent: February 4, 2003 1:57 PM
To: [EMAIL PROTECTED]
Subject: using tokens in struts, 

Hi,
I was trying to get a example which shows how to use
tokens in struts, yesterday i got a previous post from
this forum, so i tried it and it did not work for me
I am using struts1.1b2
Does any one has used token to avoid multiple
submits??
if so can u post some example or some article where i
can get the info
the ose which i got was 
http://www.mail-archive.com/struts-user@jakarta.apache.org/msg52700.html

need help


=
A$HI$H

__
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com

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



RE: using tokens in struts,

2003-02-04 Thread pqin
In your DispatchTestAction class, after you populate the form bean
(request.setAttribute), call saveToken(request) ;

In your DoAction class, before you submit to database, check token
isTokenValid(request); if valid, continue process and resetToken(request);
otherwise, return a global forward which will forward your request to an
error page.

One thing you might change in your DoAction class is not to reload jsp,
instead, forward to DispatchTestAction class so that DispatchTestAction
class saves a new token for next submission.

I usually use a BaseAction class to save token, check token and reset token.
What my execute method looks like:

if (!validateLogin(request))
return mapping.findForward(getForwardError());
if (!validateTxnToken(mapping, request)) = check token
return mapping.findForward(getForwardError());
if (!validateActionForm(form, request))
return new ActionForward(mapping.getInput());

try
{
ActionForward forward =
performPostValidationAction(mapping, form, request,
response);
handleTxnToken(mapping, request); = save or reset token
return forward;
}
catch (Exception ex)
{
validateInternal(true, err.unexpected, request);
return new ActionForward(mapping.getInput());
}




Regards,
 
 
PQ
 
This Guy Thinks He Knows Everything
This Guy Thinks He Knows What He Is Doing

-Original Message-
From: Ashish Kulkarni [mailto:[EMAIL PROTECTED]] 
Sent: February 4, 2003 2:56 PM
To: Struts Users Mailing List
Subject: RE: using tokens in struts, 

Hi PQ,

Suppose this is my scenarion,
dispatchTest.do ---  update.jsp (on submit) ---
doAction.do (on success) --update.jsp 
dispatchTest.do populates the form bean and passes it
to update.jsp , which displays the data for the user
to change, and then press submit , which will call
doAction class which will update the database and
forward the request to update.jsp, 
So where should i put the saveToken(request) and where
should i test isValidToken(request)
Also is there some thing i need to define in
struts-config.xml for it

Ashish

--- [EMAIL PROTECTED] wrote:
 Token works perfect for my app.
 
 In my load action, I set token by
 saveToken(request).
 
 In my submit action, I check token by
 isTokenValid(request); if invalid, I
 forwards request to an error page.
 
 Very simple.
 
 Regards,
  
  
 PQ
  
 This Guy Thinks He Knows Everything
 This Guy Thinks He Knows What He Is Doing
 
 -Original Message-
 From: Ashish Kulkarni
 [mailto:[EMAIL PROTECTED]] 
 Sent: February 4, 2003 1:57 PM
 To: [EMAIL PROTECTED]
 Subject: using tokens in struts, 
 
 Hi,
 I was trying to get a example which shows how to use
 tokens in struts, yesterday i got a previous post
 from
 this forum, so i tried it and it did not work for me
 I am using struts1.1b2
 Does any one has used token to avoid multiple
 submits??
 if so can u post some example or some article where
 i
 can get the info
 the ose which i got was 

http://www.mail-archive.com/struts-user@jakarta.apache.org/msg52700.html
 
 need help
 
 
 =
 A$HI$H
 
 __
 Do you Yahoo!?
 Yahoo! Mail Plus - Powerful. Affordable. Sign up
 now.
 http://mailplus.yahoo.com
 

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


=
A$HI$H

__
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com

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



RE: DynaValidatorForm exception.

2003-02-04 Thread pqin
WEB-INF/lib

Regards,
 
 
PQ
 
This Guy Thinks He Knows Everything
This Guy Thinks He Knows What He Is Doing

-Original Message-
From: Jay Wright [mailto:[EMAIL PROTECTED]] 
Sent: February 4, 2003 3:35 PM
To: 'Struts Users Mailing List'
Subject: RE: DynaValidatorForm exception.


Where is the best place to put the struts jar files in tomcat 4.0.4?  In the
webapps WEB-INF or in a tomcat lib directory?

 -Original Message-
 From: Jay Wright [mailto:[EMAIL PROTECTED]]
 Sent: Tuesday, February 04, 2003 12:27 PM
 To: 'Struts Users Mailing List'
 Subject: RE: DynaValidatorForm exception.
 
 
 
 I've seen this problem posted all through the archives, but 
 never with a
 solution to the problem.   Is no one else encountering it 
 anymore?  Is there
 a solution that I've missed?  Any assistance would be highly welcomed.
 
  -Original Message-
  From: Jay Wright [mailto:[EMAIL PROTECTED]]
  Sent: Monday, February 03, 2003 4:58 PM
  To: '[EMAIL PROTECTED]'
  Subject: DynaValidatorForm exception.
  
  
  
  I've seen a number of postings regarding a ServletException 
  that is thrown
  when a struts tag can't create a DynaValidatorForm:
  
  javax.servlet.ServletException: Exception creating bean of class
  org.apache.struts.validator.DynaValidatorForm: {1}
  
  Basically, when we restart tomcat (4.0.4 on unix, struts 
  1.1-b2) we are
  likely to see this error the first time we try to access our 
  webapp.  But
  then a second (sometimes third) restart of tomcat will clear 
  the problem and
  the webapps will function properly.  
  
  Is there any reason for this?  Does it have to do with the 
  location of the
  struts jar file?  Does it need to be in the WEB-INF/lib or 
  the common/lib or
  other part of the path?
  
  Has anyone been able to overcome this annoyance?
  
  Jay
  
  
 -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
  
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 

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



RE: problem of mapping

2003-01-31 Thread pqin
Those two parameters are totally different definitions.

Parameter in url is servlet request's parameter. Parameter in mapping is a
property of ActionConfig class.


Regards,
 
 
PQ
 
This Guy Thinks He Knows Everything
This Guy Thinks He Knows What He Is Doing

-Original Message-
From: Aislan Fernandes [mailto:[EMAIL PROTECTED]] 
Sent: January 31, 2003 3:11 PM
To: [EMAIL PROTECTED]
Subject: problem of mapping

I have a problem to get value from parameter of a mapping inside of an 
action: 

IN ACTION: 

String parameter = mapping.getParameter(); 
System.out.println(pam :  + parameter); 

IN STRUT-CONFIG: 

  action path=/alterarSenha parameter=show 
type=com.neus.componentes.usuario.gui.UsuarioAction 
  /action 

action path=/alterarSenha parameter=change 
type=com.neus.componentes.usuario.gui.UsuarioAction 
  /action 

So, the string parameter shoud be show or change in output action. It 
depends only of the url in a form page: 

-- form action=alterarSenha.do?show ... 
or 
-- form action=alterarSenha.do?change ... 

But, just out in output in action change. why?? 
It seems that the second paragraf in the struts-config rewrite the first 
paragraf. I'm still a beginner of struts! :/ 

thanks 

Aislan 

_
Voce quer um iGMail protegido contra vírus e spams? 
Clique aqui: http://www.igmailseguro.ig.com.br


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



RE: proper use of back button -- design patterns

2003-01-31 Thread pqin
I want to bring up another issue.

The default behavior of RequestProcessor is to save everything into a new
ActionForm then do the validation. If token is invalid, why should we bother
populating the ActionForm at all?
 
Regards,
 
 
PQ
 
This Guy Thinks He Knows Everything
This Guy Thinks He Knows What He Is Doing

-Original Message-
From: David Graham [mailto:[EMAIL PROTECTED]] 
Sent: January 31, 2003 3:55 PM
To: [EMAIL PROTECTED]
Subject: RE: proper use of back button -- design patterns

The tokens are used for the user clicking the back button and trying to 
submit the form again.  What you describe would have to occur if the user 
clicked the submit button twice.  So, use js to prevent the double clicking 
and tokens to be sure the form is not submitted twice.

David






From: Espey, John [EMAIL PROTECTED]
Reply-To: Struts Users Mailing List [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]
Subject: RE: proper use of back button -- design patterns
Date: Fri, 31 Jan 2003 15:24:37 -0500

The javascript would be there as the first line of defense because the 
action will only be called once, and the submission will go through 
(assuming they do not have jscript turned off of course).  If an error 
occurs in that submission, the appropriate error handling will occur.

Contrast this to the situation where I check the token and forward 
somewhere else.  I don't know what happened in the first action submission.

  It could have been successful, it could have caused errors, the user will

have no idea.  All they will know is that they double submitted.  They 
could have kicked off a long asynchronous process, but because they were 
forwarded to badToken, they decide to go kick it off again.  Do you see 
now my issue with the token checking?  It seems like it really doesn't buy 
you a whole lot because you can't cancel the fact that the first submission

cause an action to execute.

   -Original Message-
   From: David Graham [mailto:[EMAIL PROTECTED]]
   Sent: Fri 1/31/2003 3:07 PM
   To: [EMAIL PROTECTED]
   Cc:
   Subject: RE: proper use of back button -- design patterns




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


_
Tired of spam? Get advanced junk mail protection with MSN 8. 
http://join.msn.com/?page=features/junkmail


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



RE: html:multibox no selection (Struts 1.1b2)

2003-01-31 Thread pqin
In reset method of your ActionForm, set default value of checkbox.

Regards,
 
 
PQ
 
This Guy Thinks He Knows Everything
This Guy Thinks He Knows What He Is Doing

-Original Message-
From: Johan Kumps [mailto:[EMAIL PROTECTED]] 
Sent: January 31, 2003 4:47 PM
To: Struts mailing
Subject: html:multibox no selection (Struts 1.1b2)

Hi all,

It seems that my setXxx method in my form bean is not called when I do not
check any checkboxes in the multibox.

Please consider following code :

...
html:multibox name='configForm' property='myHandlers'
bean:write name='handler'/
/html:multibox
bean:write name='handler'/
...


...
private String[] myHandlers = {};
...
public void setMyHandlers (String[] myHandlers) {
this.myHandlers = myHandlers;
}

public String[] getMyHandlers() {
return this.myHandlers;
}
...

Am I doing somthis wrong here?

Please help me with this one.

Kind regards,
Johan
---
This mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.445 / Virus Database: 250 - Release Date: 21/01/2003


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



RE: html:multibox no selection (Struts 1.1b2)

2003-01-31 Thread pqin
Then set unchecked value.

Regards,
 
 
PQ
 
This Guy Thinks He Knows Everything
This Guy Thinks He Knows What He Is Doing

-Original Message-
From: Johan Kumps [mailto:[EMAIL PROTECTED]] 
Sent: January 31, 2003 4:53 PM
To: Struts Users Mailing List
Subject: RE: html:multibox no selection (Struts 1.1b2)

I do not have a default value. The user can choose between two options. He
can select both checkboxes, one of both or none.

What is going wrong?

Johan

-Oorspronkelijk bericht-
Van: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Verzonden: vrijdag 31 januari 2003 22:49
Aan: [EMAIL PROTECTED]
Onderwerp: RE: html:multibox no selection (Struts 1.1b2)


In reset method of your ActionForm, set default value of checkbox.

Regards,


PQ

This Guy Thinks He Knows Everything
This Guy Thinks He Knows What He Is Doing

-Original Message-
From: Johan Kumps [mailto:[EMAIL PROTECTED]]
Sent: January 31, 2003 4:47 PM
To: Struts mailing
Subject: html:multibox no selection (Struts 1.1b2)

Hi all,

It seems that my setXxx method in my form bean is not called when I do not
check any checkboxes in the multibox.

Please consider following code :

...
html:multibox name='configForm' property='myHandlers'
bean:write name='handler'/
/html:multibox
bean:write name='handler'/
...


...
private String[] myHandlers = {};
...
public void setMyHandlers (String[] myHandlers) {
this.myHandlers = myHandlers;
}

public String[] getMyHandlers() {
return this.myHandlers;
}
...

Am I doing somthis wrong here?

Please help me with this one.

Kind regards,
Johan
---
This mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.445 / Virus Database: 250 - Release Date: 21/01/2003


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

---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.445 / Virus Database: 250 - Release Date: 21/01/2003

---
This mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.445 / Virus Database: 250 - Release Date: 21/01/2003


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



RE: html:multibox no selection (Struts 1.1b2)

2003-01-31 Thread pqin
You override the reset method to set unchecked value.

1. You know how many elements in your array, so instantiates your array.
2. You know the unchecked value of each element, so do a loop and set
default value to each element.



Regards,
 
 
PQ
 
This Guy Thinks He Knows Everything
This Guy Thinks He Knows What He Is Doing

-Original Message-
From: Johan Kumps [mailto:[EMAIL PROTECTED]] 
Sent: January 31, 2003 4:58 PM
To: Struts Users Mailing List
Subject: RE: html:multibox no selection (Struts 1.1b2)

Sorry,

Can you give an example?

Johan

-Oorspronkelijk bericht-
Van: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Verzonden: vrijdag 31 januari 2003 22:57
Aan: [EMAIL PROTECTED]
Onderwerp: RE: html:multibox no selection (Struts 1.1b2)


Then set unchecked value.

Regards,
 
 
PQ
 
This Guy Thinks He Knows Everything
This Guy Thinks He Knows What He Is Doing

-Original Message-
From: Johan Kumps [mailto:[EMAIL PROTECTED]] 
Sent: January 31, 2003 4:53 PM
To: Struts Users Mailing List
Subject: RE: html:multibox no selection (Struts 1.1b2)

I do not have a default value. The user can choose between two options. He
can select both checkboxes, one of both or none.

What is going wrong?

Johan

-Oorspronkelijk bericht-
Van: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Verzonden: vrijdag 31 januari 2003 22:49
Aan: [EMAIL PROTECTED]
Onderwerp: RE: html:multibox no selection (Struts 1.1b2)


In reset method of your ActionForm, set default value of checkbox.

Regards,


PQ

This Guy Thinks He Knows Everything
This Guy Thinks He Knows What He Is Doing

-Original Message-
From: Johan Kumps [mailto:[EMAIL PROTECTED]]
Sent: January 31, 2003 4:47 PM
To: Struts mailing
Subject: html:multibox no selection (Struts 1.1b2)

Hi all,

It seems that my setXxx method in my form bean is not called when I do not
check any checkboxes in the multibox.

Please consider following code :

...
html:multibox name='configForm' property='myHandlers'
bean:write name='handler'/
/html:multibox
bean:write name='handler'/
...


...
private String[] myHandlers = {};
...
public void setMyHandlers (String[] myHandlers) {
this.myHandlers = myHandlers;
}

public String[] getMyHandlers() {
return this.myHandlers;
}
...

Am I doing somthis wrong here?

Please help me with this one.

Kind regards,
Johan
---
This mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.445 / Virus Database: 250 - Release Date: 21/01/2003


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

---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.445 / Virus Database: 250 - Release Date: 21/01/2003

---
This mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.445 / Virus Database: 250 - Release Date: 21/01/2003


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

---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.445 / Virus Database: 250 - Release Date: 21/01/2003

---
This mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.445 / Virus Database: 250 - Release Date: 21/01/2003


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



RE: Automatic refresh - IS THIS POSSIBLE?

2003-01-30 Thread pqin
Any solution without using JavaScript?

Regards,
 
 
PQ
 
This Guy Thinks He Knows Everything
This Guy Thinks He Knows What He Is Doing

-Original Message-
From: Mark Galbreath [mailto:[EMAIL PROTECTED]] 
Sent: January 30, 2003 9:37 AM
To: 'Struts Users Mailing List'
Subject: RE: Automatic refresh - IS THIS POSSIBLE? 

Yes, it's possible.  I've done it with a processing... animated progress
bar (though for some reason it works better in Navigator than IE).  You can
see it after you enter your credit card information at
http://shop.t-mobile.com.  :-)

Mark

PS.  I'll send you the code this weekend if you reply privately with your
credit card number and exp. date.

-Original Message-
From: Roger Fortier [mailto:[EMAIL PROTECTED]] 
Sent: Thursday, January 30, 2003 9:21 AM

Check out this article from JavaPro magazine. 

Send Users a Browser Message

http://www.javapro.com

Click Archives, then select the January 2001 issue from the archives.

-Original Message-
From: Sowbhagya Valli Suryadevara [mailto:[EMAIL PROTECTED]] 
Sent: Thursday, January 30, 2003 5:57 AM

We are using the struts  tiles  framework in our project. There is a
particular request that consumes a lot of time (20 seconds). Instead of
showing a blank page is it possible to show a Please Wait  message while
the processing is happening in the background. Then when the processing is
over the page should come up automatically.

IS THIS POSSIBLE?



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



RE: tokens and set-property

2003-01-30 Thread pqin
Try to utilize the parameter in your action mapping.

For loading action, parameter = load; for submission action, parameter =
submit.

Base action class logic:

If parameter is load
saveToken(request)
If parameter is submit
isTokenValid(request)
submit
resetToken(request)


Regards,
 
 
PQ
 
This Guy Thinks He Knows Everything
This Guy Thinks He Knows What He Is Doing

-Original Message-
From: Jerome Jacobsen [mailto:[EMAIL PROTECTED]] 
Sent: January 30, 2003 12:28 PM
To: Struts Users Mailing List
Subject: RE: tokens and set-property

The set-property applies to the ActionMapping, not the Action.  You can
subclass ActionMapping and add a useToken property to it.  Then the
action entity will need the className attribute set to your
ActionMapping subclass.

action className=com.blah.MyActionMapping path=blah...
 set-property property=useToken value=true/
/action


 -Original Message-
 From: [EMAIL PROTECTED]
 [mailto:[EMAIL PROTECTED]]
 Sent: Thursday, January 30, 2003 12:19 PM
 To: [EMAIL PROTECTED]
 Subject: tokens and set-property


 I'd like to use the set-property element of struts-config to tell
 my action
 whether to expect a token.  For example, I have an action like this:

 action path=blah...
 set-property property=useToken value=true/
 /action

 I'm using an abstract action subclass that itself is a superclass to my
 real actions.  It contains a boolean useToken property.  I also tries a
 String but it didn't matter.  That property never gets set to
 what I specify
 in the struts-config file.  Any suggestions?

 thanks

 john

 john gregg
 Wells Fargo Services Company
 Minneapolis, MN




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



RE: Forms and getting the ActionServlet from the form

2003-01-30 Thread pqin
What do you need to get the ActionServlet in your ActionForm?

Regards,
 
 
PQ
 
This Guy Thinks He Knows Everything
This Guy Thinks He Knows What He Is Doing

-Original Message-
From: bkafka [mailto:[EMAIL PROTECTED]] 
Sent: January 30, 2003 4:28 PM
To: Struts Users Mailing List
Subject: Re: Forms and getting the ActionServlet from the form

The HttpServletRequest is not available from something extending ActionForm.
I do use that when I'm in an Action.
- Original Message -
From: David Graham [EMAIL PROTECTED]
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Thursday, January 30, 2003 12:33 PM
Subject: Re: Forms and getting the ActionServlet from the form


 You could use the HttpServletRequest to get the HttpSession to get the
 ServletContext.

 David






 From: bkafka [EMAIL PROTECTED]
 Reply-To: bkafka [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Subject: Forms and getting the ActionServlet from the form
 Date: Thu, 30 Jan 2003 12:24:01 -0700
 
 Hi,
 
  I have a Form which extends ActionForm and need to get the
 ActionServlet instance. When I
 attempt to do this using this.getServlet() method I am returned a null
 reference. My actual goal is to get the ServletContext which I should be
 able to get from the ActionServlet instance. Anybody have an idea why I'd
 be getting back a null reference? Using Struts 1.1/Tomcat 4.1.8/jdk1.4.1
 
 


 _
 Add photos to your messages with MSN 8. Get 2 months FREE*.
 http://join.msn.com/?page=features/featuredemail


 -
 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: Forms and getting the ActionServlet from the form

2003-01-30 Thread pqin
I prefer your workaround. It is simply not good idea to me to touch servlet
request or ActionMapping or ActionServlet in ActionForm.

Regards,
 
 
PQ
 
This Guy Thinks He Knows Everything
This Guy Thinks He Knows What He Is Doing

-Original Message-
From: bkafka [mailto:[EMAIL PROTECTED]] 
Sent: January 30, 2003 5:12 PM
To: Struts Users Mailing List
Subject: Re: Forms and getting the ActionServlet from the form

I am trying to get a property passed from a plugin to initialize a List. I
have a workaround, which is getting it from the Action and then putting it
in a hidden field but it bothers me that I can't get from the form when the
method is advertised.

- Original Message -
From: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, January 30, 2003 2:46 PM
Subject: RE: Forms and getting the ActionServlet from the form


 What do you need to get the ActionServlet in your ActionForm?

 Regards,


 PQ

 This Guy Thinks He Knows Everything
 This Guy Thinks He Knows What He Is Doing

 -Original Message-
 From: bkafka [mailto:[EMAIL PROTECTED]]
 Sent: January 30, 2003 4:28 PM
 To: Struts Users Mailing List
 Subject: Re: Forms and getting the ActionServlet from the form

 The HttpServletRequest is not available from something extending
ActionForm.
 I do use that when I'm in an Action.
 - Original Message -
 From: David Graham [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
 Sent: Thursday, January 30, 2003 12:33 PM
 Subject: Re: Forms and getting the ActionServlet from the form


  You could use the HttpServletRequest to get the HttpSession to get the
  ServletContext.
 
  David
 
 
 
 
 
 
  From: bkafka [EMAIL PROTECTED]
  Reply-To: bkafka [EMAIL PROTECTED]
  To: [EMAIL PROTECTED]
  Subject: Forms and getting the ActionServlet from the form
  Date: Thu, 30 Jan 2003 12:24:01 -0700
  
  Hi,
  
   I have a Form which extends ActionForm and need to get the
  ActionServlet instance. When I
  attempt to do this using this.getServlet() method I am returned a null
  reference. My actual goal is to get the ServletContext which I should
be
  able to get from the ActionServlet instance. Anybody have an idea why
I'd
  be getting back a null reference? Using Struts 1.1/Tomcat
4.1.8/jdk1.4.1
  
  
 
 
  _
  Add photos to your messages with MSN 8. Get 2 months FREE*.
  http://join.msn.com/?page=features/featuredemail
 
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 


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



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



RE: what does RT Expr mean

2003-01-29 Thread pqin
Means using JSTL?

Regards,
 
 
PQ
 
This Guy Thinks He Knows Everything
This Guy Thinks He Knows What He Is Doing

-Original Message-
From: Sundar Narasimhan [mailto:[EMAIL PROTECTED]] 
Sent: January 29, 2003 9:27 AM
To: [EMAIL PROTECTED]
Subject: what does RT Expr mean

In the bottom of the documentation on the attributes of several tags I
see [RT Expr].. what does that mean? Is it documented anywhere?

Thanks.

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



RE: get data to Collection

2003-01-29 Thread pqin
public void reset(ActionMapping mapping, HttpServletRequest request) {
read = new ArrayList();
//skip others params
}

Regards,
 
 
PQ
 
This Guy Thinks He Knows Everything
This Guy Thinks He Knows What He Is Doing

-Original Message-
From: Kafka [mailto:[EMAIL PROTECTED]] 
Sent: January 29, 2003 5:02 PM
To: Struts Users Mailing List
Subject: get data to Collection

Hello,
I think, this problem many times was solve here,
but I don't find particular answer.
How I can use Form class, if I don't know how many
are rows? Must I use Collection? Maybe I can see example,
because I can not find decision.

Now my jsp:

logic:notEmpty name=access 
logic:iterate id=daiktas name=access scope=session
  html:multibox property=read name = daiktas 
   bean:write name = daiktas  property=read/
  /html:multibox
  bean:write  name = daiktas property=read/
/logic:iterate
/logic:notEmpty

Form.class
 private Collection read = new ArrayList();
//skip

 public void setRead(Collection read)
 {
this.read.addAll(read);
  }

public Collection getRead()
{
return this.read ;
}
public void reset(ActionMapping mapping, HttpServletRequest request) {
//skip others params
read.clear();
}

but I get error:
description The server encountered an internal error (Internal Server Error)
that prevented it from fulfilling this request.
exception
javax.servlet.ServletException: BeanUtils.populate
 at org.apache.struts.util.RequestUtils.populate(RequestUtils.java:988)




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



session size and struts

2003-01-27 Thread pqin
I know the implementation of session is container dependant. I know struts
put a lot of stuff in the http session.

 

Can any one tell me how big is a session if I implement Tomcat 4.1.x +
struts 1.1 beta?

 

Regards,

 

 

 

PQ

 

This Guy Thinks He Knows Everything

This Guy Thinks He Knows What He Is Doing

 




RE: Default Form Values

2003-01-24 Thread pqin
Instantaitates a new form bean, request.setAttribute, load page.

If it is DynaActionForm, set default in your struts config file.

Regards,
 
 
PQ
 
This Guy Thinks He Knows Everything
This Guy Thinks He Knows What He Is Doing

-Original Message-
From: Weber, Jeremy [mailto:[EMAIL PROTECTED]] 
Sent: January 24, 2003 9:16 AM
To: 'Struts Users Mailing List' (E-mail)
Subject: Default Form Values

Where should the default values for forms go?  In the jsp, form bean or some
other config file?

Thanks

Jeremy Weber
[EMAIL PROTECTED]

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



RE: db connection pool question [solved]

2003-01-23 Thread pqin
If you use oracle.jdbc.pool.OracleConnectionPoolDataSource, what will be the
url?

Regards,
 
 
PQ
 
This Guy Thinks He Knows Everything
This Guy Thinks He Knows What He Is Doing

-Original Message-
From: Raible, Matt [mailto:[EMAIL PROTECTED]] 
Sent: January 23, 2003 11:53 AM
To: 'Struts Users Mailing List'
Cc: Immel, Richard
Subject: RE: db connection pool question [solved]

Using the following in my DBCP Connection Pool solved my problem:

parameter
namedriverClassName/name
valueoracle.jdbc.pool.OracleConnectionPoolDataSource/value
/parameter

However, for the JDBCRealm, I still have to use:

driverName=oracle.jdbc.driver.OracleDriver

Thanks,

Matt

 -Original Message-
 From: mech [mailto:[EMAIL PROTECTED]]
 Sent: Wednesday, January 22, 2003 12:10 PM
 To: 'Struts Users Mailing List'
 Subject: RE: db connection pool question
 
 
 I can't tell for Oracle, but for MySQL and the Struts Connection Pool
 you have to set some kind of autoReconnect=true for your connection
 url setup. Otherwise your connection pool will contain only stale
 connections after a certain timeout. 
 MySQL kicked me out after 8 hours of inactivity. 
 Without autoreconnect you will just pick a dead connection 
 out of this
 pool, get an exception, most likely even close the broken 
 connection in
 your finally-block and put it back into the pool. Next time you grab
 another dead connection and so on and forth.
 
 By the way... Are the certain pro and cons for the struts connection
 pool vs. the tomcat datasource connection pool?
 As far as I know the tomcat connection pool works only via jndi setup
 whereas struts utilized the oldfashioned way. And moreover 
 you have to
 set it up in struts-config.xml which is a bit tricky for deployment.
 
 Michael
 
  -Original Message-
  From: Raible, Matt [mailto:[EMAIL PROTECTED]] 
  Sent: Mittwoch, 22. Januar 2003 17:18
  To: 'Struts Users Mailing List'
  Subject: RE: db connection pool question
  
  
  After waiting 24 hours, I'm still experiencing the same 
  problem with Oracle and a connection pool (DBCP) in Tomcat.  
  I guess I'll try configuring Oracle's connection pool??
  
  Matt
  
   -Original Message-
   From: Raible, Matt
   Sent: Tuesday, January 21, 2003 8:22 AM
   To: 'Struts Users Mailing List'
   Subject: RE: db connection pool question
   
   
   Actually, the solution that I had only works for MySQL.  I'm
   having the same problem with Oracle.  Funny - I just posted a 
   message to the commons-user group asking this same question.  
   I'll try adding the validationQuery parameter:
   
   parameter
  namevalidationQuery/name
  valueSELECT 'CRAP' FROM DUAL/value /parameter
   
   Thanks,
   
   Matt
   
-Original Message-
From: Pani, Gourav [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, January 21, 2003 7:58 AM
To: 'Struts Users Mailing List'
Subject: RE: db connection pool question


please look at the thread with subject Problem with JDBC 
   Struts 
Connection Pool (possible to recon nect?).  Matt Raible had a 
solution to that by setting autoReconnect=true

-Original Message-
From: david chan [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, January 21, 2003 9:56 AM
To: Struts Users Mailing List
Subject: db connection pool question


Hi,
 I am using a connection pool from 
org.apache.commons.dbcp.BasicDataSourceFactory and the 
 driver is 
oracle.jdbc.driver.OracleDriver. It works great until if 
  the server 
idle for a few days, then the connection object seems 
 broken with 
this error:  begin error mesg ===
java.sql.SQLException: Io exception: Software caused
connection abort: socket wr
ite error   at
oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:168)
  at
oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:210)
at
oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:323)
  at

  oracle.jdbc.driver.OracleStatement.init(OracleStatement.java:417)
   at

  oracle.jdbc.driver.OracleStatement.init(OracleStatement.java:432)
   at

   
  
 oracle.jdbc.driver.OraclePreparedStatement.init(OraclePreparedState
ment.java:182)   at

   
  
 oracle.jdbc.driver.OracleConnection.privatePrepareStatement(OracleCon
nection.java:602)at

   
  
 oracle.jdbc.driver.OracleConnection.prepareStatement(OracleConnection
.java:538)at
org.apache.commons.dbcp.DelegatingConnection.prepareStatement(
DelegatingConn
ection.java:197)
...
=  end of error mesg 

What happen and how can I prevent this?
Thanks.
David



__
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now. 
http://mailplus.yahoo.com

--
To unsubscribe, e-mail: 
  

RE: To check if user is logged in

2003-01-22 Thread pqin
Will this filter work with struts Action class?

Regards,
 
 
PQ
 
This Guy Thinks He Knows Everything
This Guy Thinks He Knows What He Is Doing

-Original Message-
From: Mohan Radhakrishnan [mailto:[EMAIL PROTECTED]] 
Sent: January 22, 2003 7:58 AM
To: 'Struts Users Mailing List'
Subject: RE: To check if user is logged in

Hi,
I can think of the following

1. Write Request Filters according to the Servlet spec.
2. Extend the Struts1.1 RequestProcessor

Mohan

-Original Message-
From: Suresh Addagalla [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, January 22, 2003 6:21 PM
To: 'Struts Users Mailing List'
Subject: RE: To check if user is logged in


Hi,

Are you talking about CheckLoginTag.java in struts-example.war?

This implements the check using a custom tag. But I need to forward to
login page even before I forward my request to the JSP, in my controller
itself.

Suresh

-Original Message-
From: julian green [mailto:[EMAIL PROTECTED]] 
Sent: Wednesday, January 22, 2003 6:22 PM
To: Struts Users Mailing List
Subject: Re: To check if user is logged in


have a look at the struts example that comes with struts.   It has an 
example of what you are doing in there.




--
To unsubscribe, e-mail:   
mailto:struts-user-[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-config.xml and DynaBeans

2003-01-22 Thread pqin
Can you give me an example of your factory?

Regards,
 
 
PQ
 
This Guy Thinks He Knows Everything
This Guy Thinks He Knows What He Is Doing

-Original Message-
From: Robert Taylor [mailto:[EMAIL PROTECTED]] 
Sent: January 22, 2003 7:56 AM
To: Struts Users Mailing List
Subject: RE: Struts-config.xml and DynaBeans

MJ,

using Digester and org.apache.commons.beanutils package, its not
that difficult to do this.

In our most recent project, we leverage DynaBeans heavily for creating
view objects to avoid having to physically create them (RowSetDynaClass
was not around). We define them in an xml file and read them into
memory at run time. So when we need a view it looks something like this:

ViewFactory vf = ViewFactory.getInstance();
DynaBean view = vf.getView(myView);

Adding a new view is as simple as adding a few lines of XML. This approach
allows use to leverage DynaBeans and not necessarily be dependent on Struts.

robert




 -Original Message-
 From: MJ McLaren, Information Systems and Computing
 [mailto:[EMAIL PROTECTED]]
 Sent: Wednesday, January 22, 2003 7:30 AM
 To: [EMAIL PROTECTED]
 Subject: Struts-config.xml and DynaBeans


 Hi,

 This is my very first contribution.  I am new to Struts and fairly new to
 JSP (so go easy on me).  I am working on a project that is considering
 using Struts 1.1.  So far I am very impressed, anything that reduces the
 amount of Java code I need to write gets my vote.

 I have been looking at dynabeans and the struts version of
 DynaActionFormClass.  I noted that in the Struts configuration file the
 section for describing form-beans.  This is great but being a very lazy
 programmer, what about a section for describing any type of DynaBean and
 not just form-beans specifically.

 The temptation is to write any DynaBean that I use in my web
 application as
 a form-bean in the Struts-Config file even when I have no intention of
 making it an actual form-bean i.e. writing a validate method or
 using it
 via a form.

 Other than that fact that it make my Struts configuration file confusing,
 any reason why I should not be doing 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]



RE: Why is the reset method called when I submit the form?

2003-01-22 Thread pqin
I guess struts calls reset in order to save all your input and then does the
validation

Regards,
 
 
PQ
 
This Guy Thinks He Knows Everything
This Guy Thinks He Knows What He Is Doing

-Original Message-
From: Jeremy Cavagnolo [mailto:[EMAIL PROTECTED]] 
Sent: January 22, 2003 2:53 PM
To: [EMAIL PROTECTED]
Subject: Why is the reset method called when I submit the form?

It seems that when I submit my form, the reset method is called before
the validate method.  I am using struts 1.0.2.  

Any insight?

-Jeremy




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



RE: html:rewrite gets the error message Body is supposed to be empty for html:rewrite

2003-01-21 Thread pqin
Replace  with '

a class=menuItem href='html:rewrite page=/main.do/'Main/a

Regards,
 
 
PQ
 
This Guy Thinks He Knows Everything
This Guy Thinks He Knows What He Is Doing

-Original Message-
From: Jagdish Arora [mailto:[EMAIL PROTECTED]] 
Sent: January 21, 2003 2:06 AM
To: Struts Users Mailing List
Subject: Re: html:rewrite gets the error message Body is supposed to be
empty for html:rewrite

try
  a class=menuItem href=html:rewrite page=/main.do/Main/a

- Original Message -
From: Jason Yam [EMAIL PROTECTED]
To: 'Struts Users Mailing List' [EMAIL PROTECTED]
Sent: Tuesday, January 21, 2003 1:09 AM
Subject: html:rewrite gets the error message Body is supposed to be empty
for html:rewrite


 Hi everyone,

 I get this error during executing html:rewrite.  Anyone know how to
 solve this problem?

 Error message:
  Body is supposed to be empty for html:rewrite

 Source code:
 a class=menuItem href=html:rewrite
 page=/main.do/html:rewriteMain/a

 Thank you

 Jason


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



RE: DynaActionForm question

2003-01-21 Thread pqin
Is it possible to instantiate an instance of DynaActionForm before I
populate the page?

Regards,
 
 
PQ
 
This Guy Thinks He Knows Everything
This Guy Thinks He Knows What He Is Doing

-Original Message-
From: Craig R. McClanahan [mailto:[EMAIL PROTECTED]] 
Sent: January 20, 2003 7:58 PM
To: Struts Users Mailing List
Subject: Re: DynaActionForm question



On Mon, 20 Jan 2003, Giri Alwar wrote:


 I have a question for the folks in general. What is the main reason for
 using the DynaActionForm class (as opposed to writing your own
ActionForm)?

That's it in a nutshell :-).  Having to write fewer classes is goodness.

 While you don't have to write your own class with DynaActionForm, aren't
you
 restricting yourself to using Struts taglibs (especially the bean
taglibs?).

You're certainly dependent on commons-beanutils.

 What if you want to use JSTL now or sometime in the future?

If you look closely at the public API for DynaActionForm, you'll see the
getMap() method.  This returns the name/value map for the properties of
the DynaBean, and makes it pretty easy to use JSTL with DynaActionForm
beans.  For example, the following are essentially equivalent:

  bean:write name=customer property=name/

  c:out value=${customer.map.name}/

if customer points at a DynaActionForm bean.

 With the IDE's
 that we all use today, creating an ActionForm class with getter/setter
 methods is a breeze. Hence, what do you truly gain by using
DynaActionForm?

Not everyone has (or likes) an IDE.

 Giri


Craig


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



follow up on action mapping

2003-01-20 Thread pqin
Last week I asked if action mapping's input accepts action. The answer is
Yes after I did a test.

 

action path=/myAction1 type=myActionClass1 input=/myAction2.do

  forward../

/action

 

input can be a page or an action.

 

Regards,

 

 

 

PQ

 

This Guy Thinks He Knows Everything

This Guy Thinks He Knows What He Is Doing

 




RE: Display values after validation (was RE: action input)

2003-01-17 Thread pqin
It only resets numeric. For example, there is an amount property of your
bean which is a Double. If you enter abc and submit, abc is reset to 0.0. To
avoid this, change Double to String so struts can keep the original value.

Regards,
 
 
PQ
 
This Guy Thinks He Knows Everything
This Guy Thinks He Knows What He Is Doing

-Original Message-
From: Susan Bradeen [mailto:[EMAIL PROTECTED]] 
Sent: January 17, 2003 8:23 AM
To: Struts Users Mailing List
Subject: Display values after validation (was RE: action input)

But by using an action path for input instead of a JSP, isn't the 
ActionForm reset, so you no longer have your form values to show in the 
JSP again? How do you redisplay the incorrect values the user typed into 
the JSP? 

Susan Bradeen

On 01/16/2003 03:22:14 PM Mark Galbreath wrote:

 Try it and see.
 
 input is the application-relative path to the input form to which 
control
 should be returned if a validation error is encountered and you have to
 specify the name attribute of the form bean associated with the action.
 
 Mark
 
 -Original Message-
 From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
 Sent: Thursday, January 16, 2003 2:58 PM
 To: [EMAIL PROTECTED]
 Subject: action input
 
 
 action path=/myAction type=fully.qualified.action.class.name
 input=mypage.jsp
 
 
 
 Can I set input=myAction2.do?
 
 
 
 Regards,
 
 
 
 
 
 
 
 PQ
 
 
 
 This Guy Thinks He Knows Everything
 
 This Guy Thinks He Knows What He Is Doing
 
 
 
 
 
 
 --
 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: Action without forward ?

2003-01-16 Thread pqin
My writer writes binaries to output stream.

Stmt is an Oracle BFILE, response is HttpServletResponse, length doesn't
matter.

InputStream in = null ;
BufferedInputStream bis = null ;
ServletOutputStream writer = null ;
 
try
{
stmt.openFile() ;
in = stmt.getBinaryStream() ;
bis = new BufferedInputStream(in) ;
int length ;
byte[] buf = new byte[512] ;
writer = response.getOutputStream() ;
response.setContentType(application/pdf) ;
while ((length=bis.read(buf))!= -1)
{
writer.write(buf) ;
}
}
finally
{
if (writer != null)
writer.close() ;
if (in != null)
in.close() ;
if (bis != null)
bis.close() ;
if (stmt != null)
stmt.closeFile() ;
}
}

In my Action class, I return null.

It works perfectly if Adobe Acrobat Reader is installed.


Regards,
 
 
PQ
 
This Guy Thinks He Knows Everything
This Guy Thinks He Knows What He Is Doing

-Original Message-
From: Marcus Biel [mailto:[EMAIL PROTECTED]] 
Sent: January 16, 2003 7:37 AM
To: [EMAIL PROTECTED]
Subject: Re: Action without forward ?

 I don't understand why you cannot directly use the PDF-generator servlet,
by
 adding a dedicated mapping in your web.xml.
It needs to go through the request processor, to check if the user is
logged in
or not. 

 perform() method in any action MAY return an ActionForward, but CAN return
 null if it has build the response for the client browser. This is commonly
 used for PDF or Excel generation, where they're is no need for a JSP.

It writes the binary value(pdf) into the response.getOutputStream,
with content-Type application/pdf und with content-length set.
But in the browser nothing can be seen, even though the pdf that gets
created correctly,
and the browser is loading the pdf-plugin.


Any ideas ?

marcus



[EMAIL PROTECTED] schrieb:
 
 perform() method in any action MAY return an ActionForward, but CAN return
 null if it has build the response for the client browser. This is commonly
 used for PDF or Excel generation, where they're is no need for a JSP.
 
 I don't understand why you cannot directly use the PDF-generator servlet,
by
 adding a dedicated mapping in your web.xml.
 
 Nico.
 
  Hi, I am using Struts 1.02 and got the following Problem:
  I need to create a JSP where u can select to create a pdf or excel file.
 
  The problem is, I didn't programm the Action to create the file, a
  colleague did.
  So I need some way to call his Servlet. I tried to map directly to it,
  that did not work. So I wrote an Action that called a method to create
  this pdf / excel file,
  depending on the parameters given.
 
  The problem is, that after this method there is no forward anymore, as
  the control is given to the servlet
  to create the file, and thats it. But the
  public ActionForward perform(
  ActionMapping mapping,
  ActionForm form,
  HttpServletRequest request,
  HttpServletResponse response)
  {
 
  needs some forward.
  For the moment I wrote return null but imho thats no prober solution.
 
  Maybe you got an idea.
 
 
  thanks,
 
  marcus
 
 --
 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: numberFormat

2003-01-16 Thread pqin
Is there a struts documentation that explains what those formats are?

Regards,
 
 
PQ
 
This Guy Thinks He Knows Everything
This Guy Thinks He Knows What He Is Doing

-Original Message-
From: Mark Galbreath [mailto:[EMAIL PROTECTED]] 
Sent: January 16, 2003 10:13 AM
To: 'Struts Users Mailing List'
Subject: RE: numberFormat

moneyFormat=$###,###,##0.00

Mark

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]] 
Sent: Thursday, January 16, 2003 10:03 AM

What is the proper format string to put into ApplicationResources.properties
to get

bean:write  name=foo property=bar formatKey=moneyFormat/

to produce   $3,456.00 from an integer?

Steve



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



RE: numberFormat

2003-01-16 Thread pqin
That means struts supports all the java number formats. Great.

Regards,
 
 
PQ
 
This Guy Thinks He Knows Everything
This Guy Thinks He Knows What He Is Doing

-Original Message-
From: Gabrovsky, Ivaylo [mailto:[EMAIL PROTECTED]] 
Sent: January 16, 2003 11:21 AM
To: [EMAIL PROTECTED]
Subject: RE: numberFormat

You can find it in JDK API
http://java.sun.com/j2se/1.4.1/docs/api/
java.text.NumberFormat

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Thursday, January 16, 2003 11:11 AM
To: [EMAIL PROTECTED]
Subject: RE: numberFormat


Is there a struts documentation that explains what those formats are?

Regards,
 
 
PQ
 
This Guy Thinks He Knows Everything
This Guy Thinks He Knows What He Is Doing

-Original Message-
From: Mark Galbreath [mailto:[EMAIL PROTECTED]] 
Sent: January 16, 2003 10:13 AM
To: 'Struts Users Mailing List'
Subject: RE: numberFormat

moneyFormat=$###,###,##0.00

Mark

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]] 
Sent: Thursday, January 16, 2003 10:03 AM

What is the proper format string to put into ApplicationResources.properties
to get

bean:write  name=foo property=bar formatKey=moneyFormat/

to produce   $3,456.00 from an integer?

Steve



--
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: complexed structures/objects

2003-01-16 Thread pqin
Dot notation always works.

For example

public class ClassA
{
private ClassB b

public class ClassB
{
private String c

in struts, logic or bean:write, you refer a.b.c

Regards,
 
 
PQ
 
This Guy Thinks He Knows Everything
This Guy Thinks He Knows What He Is Doing

-Original Message-
From: Michael Mashian [mailto:[EMAIL PROTECTED]] 
Sent: January 16, 2003 11:19 AM
To: 'Struts Users Mailing List'
Subject: complexed structures/objects

guys.

can someone please help with retrieving data from complexed
structures/objects using tags ?



RE: Struts taglibs - Is data grid possible

2003-01-16 Thread pqin
COM is similar to CORBA/RMI but not CORBA, am I right?

Regards,
 
 
PQ
 
This Guy Thinks He Knows Everything
This Guy Thinks He Knows What He Is Doing

-Original Message-
From: Mark Galbreath [mailto:[EMAIL PROTECTED]] 
Sent: January 16, 2003 11:15 AM
To: 'Struts Users Mailing List'
Subject: RE: Struts taglibs - Is data grid possible 

I come from a VB/ASP background and COM has no similarity to an applet.  COM
is server-side technology and applets are client-side technology.  The
closest similarity between Java and M$ would be JSP = ASP/VB Script.

Also, it is easy to auto-download the correct JVM to IE if an appropriate
JVM is not found.

Mark

-Original Message-
From: Haseltine, Celeste [mailto:[EMAIL PROTECTED]] 
Sent: Thursday, January 16, 2003 10:41 AM


You must be coming from a VB background, as a DataGrid and a MSFlexGrid are
both MS COM components.

The equivalent of a COM component in Java is an applet.  But I caution you
on using applets in a web/browser based application UNLESS you are writing
an application for intranet (read: internal company) use.  For internet use,
where the general public will be using your web site, many of your IE users
will have problems running an applet, and will most likely give up on using
your site, rather than trying to figure out whether they have the right
version of the JRE installed on their machine, along with IE, to run your
applet.



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



action input

2003-01-16 Thread pqin
action path=/myAction type=fully.qualified.action.class.name
input=mypage.jsp

 

Can I set input=myAction2.do?

 

Regards,

 

 

 

PQ

 

This Guy Thinks He Knows Everything

This Guy Thinks He Knows What He Is Doing

 




bean:write and embedded html tag

2003-01-15 Thread pqin
My ActionForm is
 
public class MyActionForm extends ActionForm
{
private String myMessage ;
 
public String getMyMessage()
{
return myMessage ;
}
}
 
Now that I set myMessage to line_1brline_2 so as to display it on the
page as
 
line_1
line_2
 
If I use bean:write name=myActionForm property=myMessage/ in jsp, I
would get line_1brline_2 on the page.
 
Without using struts-EL and scriptlet, is there any solution printing out
 
line_1
line_2
 
 
Regards,
 
 
 
PQ
 
This Guy Thinks He Knows Everything
This Guy Thinks He Knows What He Is Doing
 



RE: bean:write and embedded html tag

2003-01-15 Thread pqin
Good point

Regards,
 
 
PQ
 
This Guy Thinks He Knows Everything
This Guy Thinks He Knows What He Is Doing

-Original Message-
From: Sri Sankaran [mailto:[EMAIL PROTECTED]] 
Sent: January 15, 2003 2:26 PM
To: Struts Users Mailing List
Subject: RE: bean:write and embedded html tag

Have you tried setting the filter attribute of bean:write to false?

Sri

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] 
Sent: Wednesday, January 15, 2003 2:23 PM
To: [EMAIL PROTECTED]
Subject: bean:write and embedded html tag


My ActionForm is
 
public class MyActionForm extends ActionForm
{
private String myMessage ;
 
public String getMyMessage()
{
return myMessage ;
}
}
 
Now that I set myMessage to line_1brline_2 so as to display it on the
page as
 
line_1
line_2
 
If I use bean:write name=myActionForm property=myMessage/ in jsp, I
would get line_1brline_2 on the page.
 
Without using struts-EL and scriptlet, is there any solution printing out
 
line_1
line_2
 
 
Regards,
 
 
 
PQ
 
This Guy Thinks He Knows Everything
This Guy Thinks He Knows What He Is Doing
 

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



RE: Migrating from 1.0 to 1.1 ERRORS

2003-01-15 Thread pqin
Agree. I also found that JK2 connector is much easier to setup and is very
stable.

Regards,
 
 
PQ
 
This Guy Thinks He Knows Everything
This Guy Thinks He Knows What He Is Doing

-Original Message-
From: Craig R. McClanahan [mailto:[EMAIL PROTECTED]] 
Sent: January 15, 2003 4:44 PM
To: Struts Users Mailing List
Subject: Re: Migrating from 1.0 to 1.1 ERRORS



On Wed, 15 Jan 2003, Mark Lepkowski wrote:

 Date: Wed, 15 Jan 2003 16:07:13 -0500
 From: Mark Lepkowski [EMAIL PROTECTED]
 Reply-To: Struts Users Mailing List [EMAIL PROTECTED]
 To: Struts Users Mailing List [EMAIL PROTECTED]
 Subject: Re: Migrating from 1.0 to 1.1 ERRORS

  Another potential cause in your case -- if you're using Tomcat 3.2.x,
  you'll need to upgrade.  That version has some nasty bugs in its class
  loader than make Struts 1.1 not work.

 Is Tomcat v3.3.1 sufficient for Struts v1.1 (we need to use a Tomcat
 engine that's like WebSphere v4.0)?


It should be.  You'll also like the performance improvements of either
3.3.1 or 4.1.18 :-).

Note also that 4.1.18 can be used to develop Servlet 2.2/JSP 1.1 apps
(compatible with WebSphere v4.0), as long as you're careful to avoid the
features from the newer specs.

Craig


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



RE: Collection within Collection

2003-01-14 Thread pqin
Try nested:iterate tag

Regards,
 
 
PQ
 
This Guy Thinks He Knows Everything
This Guy Thinks He Knows What He Is Doing

-Original Message-
From: Cohan, Sean [mailto:[EMAIL PROTECTED]] 
Sent: January 14, 2003 9:59 AM
To: Struts (E-mail)
Subject: Collection within Collection

I have a collection (of ArrayLists) within a collection of (ArrayLists).
That is:

public class HistoryItemImpl implements HistoryItem {

private String objectName;
private List deltaList; ...
}

public class DeltaItemImpl implements DeltaItem {

private String columnName;
private Object oldValue;
private Object newValue; ...
}

In my action class I call a method that returns a collection of
historyItems.  I set that in request scope:

 request.setAttribute(historyItems, historyList);

And then iterate though it on me page:

  logic:iterate id=historyItem name=historyItems
type=com.gosps.cbd.util.HistoryItem 

For each historyItem iteration, I want to iterate though the deltaItems:

logic:iterate id=deltaItem name=deltaItems
type=com.gosps.cbd.util.DeltaItem 

How can I do this?  How do I refer to the deltaItem collection within each
historyItem collection?

Thanks.


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



RE: Collection Population Post-Validation Best Practice

2003-01-14 Thread pqin
I usually use two Action classes.

- LoadAction class to check if user is returned from page. Then I can
decide whether I shall populate page using what he has entered before or
instantiate a new page.
- Action class to process form submission and chain to next
LoadAction.

Regards,
 
 
PQ
 
This Guy Thinks He Knows Everything
This Guy Thinks He Knows What He Is Doing

-Original Message-
From: Robert Taylor [mailto:[EMAIL PROTECTED]] 
Sent: January 14, 2003 10:13 AM
To: Struts Users Mailing List
Subject: RE: Collection Population Post-Validation Best Practice

Personally, I like to keep my ActionForms as dumb as possible (I actually
use DynaValidatorActionForms). I see them as simple data transport
mechanism. When ever I have to prepopulate the ActionForm for a prepare
type of Action I do it within a the Action class (not explicitely - I
delegate to a service layer to handle this).

For me, this keeps things separate, simple and cohesive.

robert

 -Original Message-
 From: Phase Web and Multimedia [mailto:[EMAIL PROTECTED]]
 Sent: Tuesday, January 14, 2003 10:12 AM
 To: Struts Users Mailing List
 Subject: RE:Collection Population Post-Validation Best Practice


 Greetings again,

 I appreciate the afformentioned approaches (Robert, Karim, Puneet). I find
 Roberts to be the most logical, simple and clean for myself. I use
 LookupDispatchAction so this would actually be easy to do. I was
 getting the
 loop for the very reason you mentioned :-D. It was a test app to
 see how to
 address the problem of populating collections post validation and I was
 calling the process Action.

 So the practice would be to separate the entry Action from the process
 Action. Use the entry action as your input for errors and it will have the
 logic to populate your collections prior to showing the page.

 It also seems to me that the ActionForm does not exclude us from making
 calls to our business logic from within the validate method. So if I have
 any standard prepopulation (post validation)... I can just call my logic
 classes and set the appropriate members of the ActionForm from within the
 validate prior to the ActionErrors returning to the input page.

 Something like (with validator):

 public MyActionForm extends ValidatorActionForm {

 ...

 public void setMyCollection(ArrayList myCollection) {

   this.myCollection = myCollection;

 }

 ...

 public ActionErrors validate(
   ActionMapping mapping,
   HttpServletRequest request)
 {

 // run my validator validation and capture error
 ActionErrors errors = super.validate(mapping,request);

 // run my own validation
 if (x != 5) {

   errors.add(myErrorMessage,
   new ActionError(my.custom.error));

 }

 if (errors.empty())
 {
return null;
 } else {
   ...
   // populate ActionForm collections here and return errors
   this.myCollection = MyLogicClass.getMyCollection();
 //retrieves Collection

   return errors;
 }


 }

 }

 So then here is the final question:
 Is it appropriate practice to have logic classes being called in the
 validate method to populate collections in the form? What's the official
 position?

 Thanks,
 Brandon Goodin
 Phase Web and Multimedia
 P (406) 862-2245
 F (406) 862-0354
 [EMAIL PROTECTED]
 http://www.phase.ws


 -Original Message-
 From: Karim Saloojee [mailto:[EMAIL PROTECTED]]
 Sent: Tuesday, January 14, 2003 5:41 AM
 To: Struts Users Mailing List
 Subject: Re: [Our Practice]Collection Population Post-Validation Best
 Practice


 Hi

 What we have done is introduce a ListManager class. This is a singleton
 object that is accessible from the form via its superclass (our custom
 superclass).

 What we have done in our form is have two fields for a
 collection, i.e. our
 dropdown list. The first field is used to populate the values of the list
 and the second is used to store the selected value.

 E.G.:
 public Collection getListOfPeople() {
   return ListManager.getInstance().getPeople();
 }

 public String getSelectedPerson() {
   return selectedPerson;
 }

 public void setSelectedPerson(String selectedPerson) {
   this.selectedPerson = selectedPerson;
 }

 Our JSP is coded so that the setup of the dropdown calls getListOfPeople()
 and the selected item populates setSelectedPerson(). The taglib
 allows this
 Struts 1.1 b2.

 This allows us to store the forms in the request and never have to worry
 about pre-populating them, this seems to work very well for us.

 I would appreciate feedback wrt this approach.

 Regards,
 Karim



 - Original Message -
 From: Puneet Agarwal [EMAIL PROTECTED]
 To: Struts Users Mailing List [EMAIL PROTECTED];
 [EMAIL PROTECTED]
 Sent: Tuesday, January 14, 2003 1:41 PM
 Subject: Re: [Our Practice]Collection Population Post-Validation Best
 Practice


  Even we had a similar problem in our application:
 
  Agree that making the ActionForm scope to be session may
 cause problems,
  but storing the information in 

RE: How to reset session-scoped Dyna bean values

2003-01-13 Thread pqin
Can you discard this bean and instantiate a new one?

Regards,
 
 
PQ
 
This Guy Thinks He Knows Everything
This Guy Thinks He Knows What He Is Doing

-Original Message-
From: Affan Qureshi [mailto:[EMAIL PROTECTED]] 
Sent: January 13, 2003 12:07 AM
To: struts-user
Subject: How to reset session-scoped Dyna bean values

A rather basic question: How to reset/empty the property values in a session
bean when I get to page 1 in a wizard type interface?

I have a wizard type interface where I need to retain values throught
four/five screens. But when I want to start a new process from screen 1 I
get the same values back that I had entered in the prev process. How can I
reset them? My form bean is a DynaActionForm and I have tried setting the
initial property to  and false but this does not seem to work. What am I
doing wrong?

Thanks in advance..

Affan



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



RE: Cannot find bean...

2003-01-13 Thread pqin
In your struts conf xml, define the action and set scope to request.

action path=/myAction
  type=myActionClassName
  input=myJSPPage
  scope=request
forward name=success path=/nextAction /
/action

Regards,
 
 
PQ
 
This Guy Thinks He Knows Everything
This Guy Thinks He Knows What He Is Doing

-Original Message-
From: Cohan, Sean [mailto:[EMAIL PROTECTED]] 
Sent: January 12, 2003 11:05 AM
To: Struts (E-mail)
Subject: Cannot find bean...

I'm struggling with the exception below trying to figure out how to resolve
it.  It appears when I add the following hidden parameter to the form.

  html:hidden property=method/

I have the parameter getter and setters in the form class, and as a
parameter in the action mapping.  Can someone steer me in the right
direction? Thanks.

Here's the exception

org.apache.jasper.JasperException: Cannot find bean
org.apache.struts.taglib.html.BEAN in any scope


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



RE: ActionErrors question

2003-01-10 Thread pqin
html:errors bundle=yourbundle/

Regards,
 
 
PQ
 
This Guy Thinks He Knows Everything
This Guy Thinks He Knows What He Is Doing

-Original Message-
From: Andy Kriger [mailto:[EMAIL PROTECTED]] 
Sent: January 10, 2003 3:51 PM
To: Struts Users Mailing List
Subject: RE: ActionErrors question

So the bundle that holds the errors depends on the bundle that the keys come
from? Is there any way to separate this so that all errors always go to one
bundle regardless of where the message keys are stored? (that design seems
out-of-line with the rest of Struts which usually has good

-Original Message-
From: Alvarado, Juan (c) [mailto:[EMAIL PROTECTED]]
Sent: Friday, January 10, 2003 15:32
To: 'Struts Users Mailing List'
Subject: RE: ActionErrors question


It sounds to me like the keys that you are using in your action errors are
in the non-default message resource file in your application; the one with
the key defined.

If you don't want to use the bundle attribute in your call to
html:errors... I suggest you move those keys to the default message
resource file in your app.

-Original Message-
From: Andy Kriger [mailto:[EMAIL PROTECTED]]
Sent: Friday, January 10, 2003 3:34 PM
To: Struts Users Mailing List
Subject: ActionErrors question


I have 2 message-resources defined in my webapp (one has a key defined the
other does not). In one action, I am getting messages from the non-default
message-resource (the one with a key defined). In that action I also create
an errors object and add errors to it...

getResource(request, key)
ActionErrors errors = new ActionErrors();
errors.add(ActionErrors.GLOBAL_ERROR, new ActionError(key, val1, val2);
saveErrors(request, errors);
mapping.findForward(...);

In the JSP I display the errors...
html:errors /

However, this displays nothing _unless_ I do html:errors bundle=key/

Why are the errors added in the 'key' bundle instead of the default bundle?

This is with Struts 1.1b2.

thx
andy



--
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: forwarding to unrelated pages

2003-01-09 Thread pqin
I create two Actions, one for loading page, the other for form submission.

Regards,
 
 
PQ
 
This Guy Thinks He Knows Everything
This Guy Thinks He Knows What He Is Doing

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]] 
Sent: January 9, 2003 11:29 AM
To: [EMAIL PROTECTED]
Subject: forwarding to unrelated pages

Hi all,
 
I'm pretty new to Struts but I've been following it for a long time.  Now
that I'm starting to use it, I'm trying to figure out the best way to make
objects available to a jsp that aren't involved in the processing of the
previous action.  I know about HttpServletResponse.addAttribute(), but what
if the action has little or nothing to do with the subsequent jsp?  In my
pre-Struts days, I would create something like 2 actions--the first one
services the incoming request, forwards to the next one, and the second only
gathers whatever info is needed by the next jsp (that way I can decouple
processing of unrelated concerns.)  Should I continue to do something like
this?  Or maybe create custom tags that know how to retrieve objects that
aren't in the response?  I'd appreciate some ideas.
 
thanks
 
john
 

john gregg
Wells Fargo Service Corporation
Minneapolis, MN

 



session scope ActionForm

2003-01-08 Thread pqin
I am a bit confused about session scope of ActionForm.
 
For example, in my ActionForm testForm
 
private String field1 ;
private String filed2 ;
 
I instantiate testForm in a PageOneLoadAction
 
TestForm testForm = new TestForm() ;
Request.getSession().setAttribute(testForm, testForm) ;
 
On page one, I only need to enter field 1
 
html:form 
...
html:text property=field1/
/html:form
 
Once I subimit, I assume that value of field 1 is saved into testForm.
 
Now I load page 2 which only requires user entering field 2.
 
html:form...
...
html:text property=field2/
/html:form
 
If I submit, value of field 2 is saved into testForm. Will value of field 1
be kept in testForm?
 
 
Regards,
 
 
 
PQ
 
This Guy Thinks He Knows Everything
This Guy Thinks He Knows What He Is Doing
 



RE: value=bean:write../ question

2003-01-08 Thread pqin
No, it will still be set.

Regards,
 
 
PQ
 
This Guy Thinks He Knows Everything
This Guy Thinks He Knows What He Is Doing

-Original Message-
From: Siggelkow, Bill [mailto:[EMAIL PROTECTED]] 
Sent: January 8, 2003 3:55 PM
To: 'Struts Users Mailing List'
Subject: RE: value=bean:write../ question

You are right, Paul -- sorry for the confusion.  Another important point is
if you use the input type=hidden... tag versus the struts
html:hidden... tag the value will not be set automatically based on
properties of the form bean.

-Original Message-
From: Paul Linden [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, January 08, 2003 3:01 PM
To: Struts Users Mailing List
Subject: Re: value=bean:write../ question


input type=hidden name=sectionName value=bean:write name=ac 
property=section.name/ /
is just text with a custom tag in the middle. There's nothing special 
about input ...

html:hidden  is a custom tag that has to be evaluated before the 
response is even sent.

It would have been more accurate for Bill to say that you can't have a 
tag as the value of an attribute in a *custom* tag.

Paul

Vijay Balakrishnan wrote:

Hi,

Thanks for your replies.I looked at an example in the Struts In action
book and so I tried this and it worked:

input type=hidden name=sectionName value=bean:write name=ac
property=section.name/ /

After all,by the time it gets to the browser,its all the same.


Vijay



You could use:

bean:define name=myBean property=myProperty id=myId type=String/

... value=%= myId% ..


-Original Message-
From: Siggelkow, Bill [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, January 08, 2003 5:36 AM
To: 'Struts Users Mailing List'
Subject: RE: value=bean:write../ question


You cannot use a tag as a value of an attribute in a tag -- you need to use
a Runtime Expression (or expression language if you are using JSTL) as in
the following:

html:hidden property=sectionName
value=%=ac.getSection().getName()%/

-Original Message-
From: Vijay Balakrishnan [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, January 07, 2003 8:15 PM
To: 'Struts Users Mailing List'
Subject: value=bean:write../ question


Hi,

This code works:

tiles:put name=topleftbean:write name=ac
property=section.name/./tiles:put

But this code doesn't work:
html:hidden property=sectionName value=bean:write name=ac
property=section.name/ /

Can someone explain what I need to do ?

Thanks,
Vijay

--
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: Multiple Controllers struts-config

2003-01-07 Thread pqin
Please excuse my curiosity and ignorant. If we can access pages using https
why bother using SSLext?

Regards,
 
 
PQ
 
This Guy Thinks He Knows Everything
This Guy Thinks He Knows What He Is Doing

-Original Message-
From: Steve Vanspall [mailto:[EMAIL PROTECTED]] 
Sent: January 6, 2003 9:29 PM
To: Struts User Mailing List
Subject: Multiple Controllers struts-config

Hi there,

I am trying to use the SSLext extension as well as the ActionPluginExt
extension for Struts

I am using Struts 1.1b2

According to the DTD I can have only one controller tag deifined.

each of these extensions require their own controller. Is there a way around
this limitation?

Regards

Steve Vanspall


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



RE: using Log4J

2003-01-07 Thread pqin
What's the benefit of using commons-logging if I have log4j setup and
working?

Regards,
 
 
PQ
 
This Guy Thinks He Knows Everything
This Guy Thinks He Knows What He Is Doing

-Original Message-
From: Dan Tran [mailto:[EMAIL PROTECTED]] 
Sent: January 7, 2003 1:43 AM
To: Struts Users Mailing List
Subject: Re: using Log4J

Struts source code uses common-logging interface which will use log4j
implementation if you place log4j.properties in the classpath.

So take a look at the source.

-D


- Original Message -
From: usha [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, January 06, 2003 9:00 PM
Subject: using Log4J


 Hi

 can anybody tell me how where i can get the examples using LOG4J in
struts.

 thanks
 usha


 --
 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: using Log4J

2003-01-07 Thread pqin
So having a wrapper around my log4j won't reduce the performance?

Regards,
 
 
PQ
 
This Guy Thinks He Knows Everything
This Guy Thinks He Knows What He Is Doing

-Original Message-
From: Karl Baum [mailto:[EMAIL PROTECTED]] 
Sent: January 7, 2003 11:12 AM
To: Struts Users Mailing List
Subject: Re: using Log4J

The main benefit is that you are not pinning the user of your package to a
specific Logger.  By editing configurations or implementing some interfaces,
commons logging can wrap almost any Logging utility.


- Original Message -
From: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, January 07, 2003 9:56 AM
Subject: RE: using Log4J


 What's the benefit of using commons-logging if I have log4j setup and
 working?

 Regards,


 PQ

 This Guy Thinks He Knows Everything
 This Guy Thinks He Knows What He Is Doing

 -Original Message-
 From: Dan Tran [mailto:[EMAIL PROTECTED]]
 Sent: January 7, 2003 1:43 AM
 To: Struts Users Mailing List
 Subject: Re: using Log4J

 Struts source code uses common-logging interface which will use log4j
 implementation if you place log4j.properties in the classpath.

 So take a look at the source.

 -D


 - Original Message -
 From: usha [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Monday, January 06, 2003 9:00 PM
 Subject: using Log4J


  Hi
 
  can anybody tell me how where i can get the examples using LOG4J in
 struts.
 
  thanks
  usha
 
 
  --
  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: Display the content of a form.

2003-01-07 Thread pqin
One dirty trick is to use enable/disable.

Regards,
 
 
PQ
 
This Guy Thinks He Knows Everything
This Guy Thinks He Knows What He Is Doing

-Original Message-
From: ROSSEL Olivier [mailto:[EMAIL PROTECTED]] 
Sent: January 7, 2003 11:06 AM
To: '[EMAIL PROTECTED]'
Subject: Display the content of a form.

At the end of a multiple-pages form, I wish to have a page that 
displays, as HTML, the content of the form previously filled.

What's the best process for that?

Should I put the formBean into request scope, and use bean:write to
display each field?


---cut here---


This e-mail is intended only for the above addressee. It may contain
privileged information. If you are not the addressee you must not copy,
distribute, disclose or use any of the information in it. If you have
received it in error please delete it and immediately notify the sender.
Security Notice: all e-mail, sent to or from this address, may be
accessed by someone other than the recipient, for system management and
security reasons. This access is controlled under Regulation of
Investigatory Powers Act 2000, Lawful Business Practises.

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



RE: Indexed property

2003-01-07 Thread pqin
Override reset method in your ActionForm

Regards,
 
 
PQ
 
This Guy Thinks He Knows Everything
This Guy Thinks He Knows What He Is Doing

-Original Message-
From: Yujin Kim [mailto:[EMAIL PROTECTED]] 
Sent: January 7, 2003 1:21 PM
To: 'Struts Users Mailing List'
Subject: Indexed property

Hello,

I understand this topic has been discussed before, so I apologize for
posting this again.
Using strtus 1.1-b3, I'm creating a form bean that contains a
collection(ArrayList) and use it to populate the jsp using the iterate
tag.  With or without indexed attribute in the form elements (i.e
html:text  Indexed=true), I got the jsp to populate the data.
My problem is mostly in the action class where the form gets submitted.

If I don't set indexed=true, then the jsp is populated correctly. But
when the submit button is clicked, the the collection is always set to
null.

If I set indexed=true, and if I put indexed getter and setter methods
along with regular getter and setter for the collection, I would get No
getter method for property error when jsp is created.

If I set indexed=true, and if I don't have indexed getter and setter,
then jsp is created fine with correct indexed form field name, etc but I
would get java.lang.IndexOutOfBoundsException: Index: 0, Size: 0 error
on submit.

I've been struggling with this issue since yesterday, and I'm running
out of ideas now.

Any comments would be greatly appreciated.  
(And hopefully I described my problem for you to understand.)

Yujin

P.S: my apologies for not posting the sourcecode.  I don't want to post
it as is, and I'm a bit tight on time to meet the deadline, so I didn't
want to spend too much time on reformatting the source code I have.  I
would send it out if any of you think it's necessary.



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



RE: PrePopulation of FormBean Values

2003-01-06 Thread pqin
I do it this way

In your action class, instantiate a new ActionForm, populate values, and
then request.set(yourformbeanname in struts conf xml, yourinstance).

Regards,
 
 
PQ
 
This Guy Thinks He Knows Everything
This Guy Thinks He Knows What He Is Doing

-Original Message-
From: ashokd [mailto:[EMAIL PROTECTED]] 
Sent: May 2, 2002 6:23 AM
To: Struts Users Mailing List
Subject: PrePopulation of FormBean Values

Hi,

How to propopulate the Form values in a Form (which is using the Struts
FormBean)

The scope of the FormBean is request.

Please provide an example on this.

Thanks in Advance,
Ashok.D


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



RE: Struts equivalent of if...else (newbie)

2003-01-06 Thread pqin
logic:equal = if...then
logic:notEqual else

Regards,
 
 
PQ
 
This Guy Thinks He Knows Everything
This Guy Thinks He Knows What He Is Doing

-Original Message-
From: Suresh Addagalla [mailto:[EMAIL PROTECTED]] 
Sent: January 6, 2003 9:19 AM
To: 'Struts Users Mailing List'
Subject: RE: Struts equivalent of if...else (newbie)

Well, as you guessed, I do have scriptlets. Now my effort is to minimize
or remove them completely.

And I tried to use logic with local variables, it worked. Thanks for
that. And still, logic:equal offers only if..then; is there any way to
simulate if..then..else?

Thanks,
Suresh

-Original Message-
From: Siggelkow, Bill [mailto:[EMAIL PROTECTED]] 
Sent: Monday, January 06, 2003 7:41 PM
To: 'Struts Users Mailing List'
Subject: RE: Struts equivalent of if...else (newbie)


I believe that the logic tags will work with a local variable 
-- anyway, if you don't want to use scriptlet, how did you 
create the local variable in the first place?

-Original Message-
From: Suresh Addagalla [mailto:[EMAIL PROTECTED]]
Sent: Monday, January 06, 2003 8:59 AM
To: [EMAIL PROTECTED]
Subject: Struts equivalent of if...else (newbie)


Hi,
 
I would like to know if Struts provides a custom tag for 
achieving if..then..else functionality.
 
I can not use logic:equal because the data for me is NOT 
coming from either a bean or through the request. I just need 
to compare a variable. Is there any option apart from writing 
a cryptic looking scriptlet?
 
Thanks,
Suresh


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





RE: a couple of questions

2003-01-06 Thread pqin
The template is like a super class, include jsp is like a subclass, can you
inherit super class imports in your subclass? No. 

Regards,
 
 
PQ
 
This Guy Thinks He Knows Everything
This Guy Thinks He Knows What He Is Doing

-Original Message-
From: Yan Zhu [mailto:[EMAIL PROTECTED]] 
Sent: January 6, 2003 11:37 AM
To: Struts Users Mailing List; [EMAIL PROTECTED]
Subject: Re: a couple of questions



One, possibly hokie way, of doing this would be to use parameters in your
resources.  For example, say your error resource is defined as
This makes the *entire* text of foo.error dynamic.


excellent, that is awesome!
no way to make individual prefix based on class though? :(

I have a root page layout tile that is something like:

%@ include file=header.jsp %
table
  .
  .
  tiles:insert attribute=nav/
  .
  .
  tiles:insert attribute=body/
  .
  .
/table

My individual tiles extend the layout tile.  The extensions in turn specify
the actual the values for the 'title' and 'body' attributes.  However, I
don't have to repeat 'hea

hmm, i have done the same thing, but my jsp imports etc don't seem to 
come over to each individual tiles..


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



RE: ApplicationResources.properties

2003-01-03 Thread pqin
Isn't it defined in struts config xml? message-resources parameter=/?

Regards,
 
 
PQ
 
This Guy Thinks He Knows Everything
This Guy Thinks He Knows What He Is Doing

-Original Message-
From: Jimmy Oh [mailto:[EMAIL PROTECTED]] 
Sent: January 3, 2003 12:27 AM
To: Struts Users
Subject: ApplicationResources.properties

Hi,
I am new to Struts.  I want to know whether is there a way (or is it
possible at all?) to put the `ApplicationResources.properties' file in
another directory other than in the `WEB-INF/classes' directory onwards?
That is, I do not want `ApplicationResources.properties' to be in
`WEB-INF/classes' or any of its sub-directories.

TIA
Jimmy


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



RE: Does not work to use SaveToken to avoid duplicated submit if I us e the same jsp as the form and also as the resulting page?

2003-01-03 Thread pqin
On top of this question, I would like to know if this token can resolve
issues casuing by depressing BackSpace key?

Regards,
 
 
PQ
 
This Guy Thinks He Knows Everything
This Guy Thinks He Knows What He Is Doing

-Original Message-
From: Jason Yam [mailto:[EMAIL PROTECTED]] 
Sent: January 3, 2003 1:26 AM
To: Struts Users Mailing List
Subject: Does not work to use SaveToken to avoid duplicated submit if I us e
the same jsp as the form and also as the resulting page?

Hi everyone,
 
I try to use Struts 1.0.2's SaveToken function to avoid duplicated
submit.  However I try to use the following logic to make it work:
 
Action = JSP (show the submit form without the data) = (click submit) =
Action with populated form = JSP (show the same jsp page to show the data
result)
 
I get the message duplicated request.
 
I think neither (1) it can use the same Action class to show and process
the data, nor (2) it can use the same jsp page to show the form and display
the result.  I use a debugger to know that the value of the hidden variable
for storing the saved session Token value is the same as the session Token
stored in session after I click the submit button.  That 's why the
isValidToken is false.  It is the bug in my coding or this is the default
behaviour of Struts?
 
Thank you!
 
Jason



RE: Struts based app. and SSL doesnt work together

2003-01-03 Thread pqin
Have you checked apache's ssl log?

Regards,
 
 
PQ
 
This Guy Thinks He Knows Everything
This Guy Thinks He Knows What He Is Doing

-Original Message-
From: Maris Orbidans [mailto:[EMAIL PROTECTED]] 
Sent: January 3, 2003 9:47 AM
To: Struts Users Mailing List; [EMAIL PROTECTED]
Subject: RE: Struts based app. and SSL doesnt work together



Mod_ssl 2.8.12
Apache HTTP server 1.3.27
Tomcat 4.0


Maris


 -Original Message-
 From: mech [mailto:[EMAIL PROTECTED]]
 Sent: Friday, January 03, 2003 3:59 PM
 To: 'Struts Users Mailing List'
 Subject: RE: Struts based app. and SSL doesnt work together
 
 
 Maybe describe your enviroment more. Because I have similar situation,
 but have no problem with my Tomcat 4.1.18, mod_jk 1.2.0, Apache 1.3.27
 setup (opensa.org Apache)
 
 I'm developing a Struts App which is using both http and https (mainly
 for login).
 I mainly use html:form - post, sometimes I use get parameters, but
 only to send to action.do?test=value at the moment.
 
 I have Apache on 80/443 and Tomcat on 8080/8443 with 8009 mod_jk.
 Everything works fine for me... No matter if I access Apache and it's
 SSL port or use Tomcat standalone (which I also configured to 
 use ssl on
 8443).
 
 Michael
 
  -Original Message-
  From: Maris Orbidans [mailto:[EMAIL PROTECTED]] 
  Sent: Freitag, 3. Januar 2003 14:36
  To: Struts Users Mailing List
  Subject: Struts based app. and SSL doesnt work together
  
  
  
  hello all
  
  We have finished a large project which was based on Struts. 
  Now our client wants to use SSL. 
  We set up SSL and now our app. doesnt work anymore. It seems 
  that form beans aren't being populated. 
  I think that maybe struts control servlet cant read GET 
  parameters for some reason.
  
  Our architecture consists of Apache HTTP server, which talks 
  to Tomcat. SSL support is installed in Apache server.
  
  Do you have ideas how to solve this problem ?
  
  
  Maris Orbidans
  app. architect
  
  --
  To unsubscribe, e-mail:   
  mailto:struts-user- [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: (http://jakarta.apache.org/struts/tags-tiles-1.1) cannot be resolved

2003-01-03 Thread pqin
Don't understand why you prefer an absolute path? I use relative path,

In web.xml

taglib
taglib-uri/tags/struts-tiles/taglib-uri
taglib-location/WEB-INF/struts-tiles.tld/taglib-location
/taglib

tld file is in my WEB-INF, struts.jar is in my WEB-INF/lib, and tiles plugin
is defined in struts config xml.

Regards,
 
 
PQ
 
This Guy Thinks He Knows Everything
This Guy Thinks He Knows What He Is Doing

-Original Message-
From: Daniel Grey [mailto:[EMAIL PROTECTED]] 
Sent: January 3, 2003 1:02 PM
To: Struts Users Mailing List
Subject: RE: (http://jakarta.apache.org/struts/tags-tiles-1.1) cannot be
resolved 

Yes I did - still get the same results. I've tried more variations on
that than I can remember.
Thanks

-Original Message-
From: Siggelkow, Bill [mailto:[EMAIL PROTECTED]]
Sent: Friday, January 03, 2003 6:33 AM
To: 'Struts Users Mailing List'
Subject: RE: (http://jakarta.apache.org/struts/tags-tiles-1.1) cannot be
resolved 


Did you try taking the version off the URI?  In other words, use:
http://jakarta.apache.org/struts/tags-tiles;

-Original Message-
From: Daniel Grey [mailto:[EMAIL PROTECTED]]
Sent: Thursday, January 02, 2003 5:21 PM
To: [EMAIL PROTECTED]
Subject: (http://jakarta.apache.org/struts/tags-tiles-1.1) cannot be
resolved 


I am trying to deploy a .ear file to JBOSS and canNot get around this
error:

org.apache.jasper.JasperException: null(-1,-1) This absolute uri
(http://jakarta.apache.org/struts/tags-tiles-1.1) cannot be resolved in
either web.xml or the jar files deployed with this application

There are a bunch of .jsp files that contain this reference:
%@ taglib uri=http://jakarta.apache.org/struts/tags-tiles-1.1;
prefix=tiles %

The web.xml has this reference:
 taglib
 
taglib-urihttp://jakarta.apache.org/struts/tags-tiles-1.1/taglib-uri
taglib-location/WEB-INF/struts-tiles.tld/taglib-location
  /taglib

The lib directory has struts.jar and the classes directory has the
classes
Does anyone have a clue on this?
HELP!
Thanks

--
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: (http://jakarta.apache.org/struts/tags-tiles-1.1) cannot be resolved

2003-01-03 Thread pqin
http://jakarta.apache.org/struts/dtds/struts-config_1_1.dtd

Regards,
 
 
PQ
 
This Guy Thinks He Knows Everything
This Guy Thinks He Knows What He Is Doing

-Original Message-
From: Daniel Grey [mailto:[EMAIL PROTECTED]] 
Sent: January 3, 2003 2:20 PM
To: Struts Users Mailing List
Subject: RE: (http://jakarta.apache.org/struts/tags-tiles-1.1) cannot be
resolved 

yes they're under there also - still doesn't work though
thanks

-Original Message-
From: Khalid K. [mailto:[EMAIL PROTECTED]]
Sent: Friday, January 03, 2003 10:47 AM
To: Struts Users Mailing List
Subject: Re: (http://jakarta.apache.org/struts/tags-tiles-1.1) cannot be
resolved 


the tld files are under the WEB-INF directory of your web app.
- Original Message -
From: Daniel Grey [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]
Sent: Friday, January 03, 2003 10:43 AM
Subject: RE: (http://jakarta.apache.org/struts/tags-tiles-1.1) cannot be
resolved


I just looked in the struts.jar and the tiles.jar and they both have a
META-INF/struts-tiles.tld.
Problem is that I inherited this monstrosity of files, jars, jsps etc.
It feelss like 20,000 leagues under the sea...
Thanks mucho


-Original Message-
From: Craig R. McClanahan [mailto:[EMAIL PROTECTED]]
Sent: Friday, January 03, 2003 10:28 AM
To: Struts Users Mailing List
Subject: RE: (http://jakarta.apache.org/struts/tags-tiles-1.1) cannot be
resolved




On Fri, 3 Jan 2003 [EMAIL PROTECTED] wrote:


 Don't understand why you prefer an absolute path? I use relative path,

 In web.xml

 taglib
 taglib-uri/tags/struts-tiles/taglib-uri
 taglib-location/WEB-INF/struts-tiles.tld/taglib-location
 /taglib


In a JSP 1.2 (or later) container, you can now nest multiple TLDS in the
META-INF/tlds subdirectory of a JAR file, and they will be
automatically
recognized by the container.  That means you do not have to use any
taglib directive at all in the web.xml file, if you don't want to, as
long as you use the official URIs for these libraries (it's in the uri
element of the TLD itself.

The Struts documentation still describes the techniques using taglib,
because the minimum platform is JSP 1.1 and automatic TLD recognition
for
multiple tag libraries does not work there.

Craig


--
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: (http://jakarta.apache.org/struts/tags-tiles-1.1) cannot be resolved

2003-01-03 Thread pqin
Forget META-INF (sorry Craig). I think I finally figured it out.

Let's go back to old release (1.1b2). In my web.xml, I define

taglib
taglib-urimytiles/taglib-uri
taglib-location/WEB-INF/struts-tiles.tld/taglib-location
/taglib

taglib-uri is just a reference that you will use in your jsp. Treat it as a
variable name.

%@ taglib uri='mytiles' prefix='tiles' %
tiles:insert ./

location is where your file is located, relative path, don't if absolute
path works.

Regards,
 
 
PQ
 
This Guy Thinks He Knows Everything
This Guy Thinks He Knows What He Is Doing

-Original Message-
From: Daniel Grey [mailto:[EMAIL PROTECTED]] 
Sent: January 3, 2003 1:02 PM
To: Struts Users Mailing List
Subject: RE: (http://jakarta.apache.org/struts/tags-tiles-1.1) cannot be
resolved 

Yes I did - still get the same results. I've tried more variations on
that than I can remember.
Thanks

-Original Message-
From: Siggelkow, Bill [mailto:[EMAIL PROTECTED]]
Sent: Friday, January 03, 2003 6:33 AM
To: 'Struts Users Mailing List'
Subject: RE: (http://jakarta.apache.org/struts/tags-tiles-1.1) cannot be
resolved 


Did you try taking the version off the URI?  In other words, use:
http://jakarta.apache.org/struts/tags-tiles;

-Original Message-
From: Daniel Grey [mailto:[EMAIL PROTECTED]]
Sent: Thursday, January 02, 2003 5:21 PM
To: [EMAIL PROTECTED]
Subject: (http://jakarta.apache.org/struts/tags-tiles-1.1) cannot be
resolved 


I am trying to deploy a .ear file to JBOSS and canNot get around this
error:

org.apache.jasper.JasperException: null(-1,-1) This absolute uri
(http://jakarta.apache.org/struts/tags-tiles-1.1) cannot be resolved in
either web.xml or the jar files deployed with this application

There are a bunch of .jsp files that contain this reference:
%@ taglib uri=http://jakarta.apache.org/struts/tags-tiles-1.1;
prefix=tiles %

The web.xml has this reference:
 taglib
 
taglib-urihttp://jakarta.apache.org/struts/tags-tiles-1.1/taglib-uri
taglib-location/WEB-INF/struts-tiles.tld/taglib-location
  /taglib

The lib directory has struts.jar and the classes directory has the
classes
Does anyone have a clue on this?
HELP!
Thanks

--
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 data-source vs. Tomcat JNDI registered DataSource

2003-01-03 Thread pqin
JNDI is way too easy.

Regards,
 
 
PQ
 
This Guy Thinks He Knows Everything
This Guy Thinks He Knows What He Is Doing

-Original Message-
From: Charlie Toohey [mailto:[EMAIL PROTECTED]] 
Sent: January 3, 2003 3:09 PM
To: [EMAIL PROTECTED]
Subject: Struts data-source vs. Tomcat JNDI registered DataSource

For those using Struts with Tomcat,
Any advantage or difference in using a Struts data source based on the
Jakarta Commons DataBase Connection Pool BasicDataSource class,
vs. using the Tomcat data source using the Jakarta Commons DBCP and 
Pool (configuring factory as
org.apache.commons.dbcp.BasicDataSourceFactory), 
registering the DataSource with a naming service based on JNDI ?

I was planning on configuring a DataSource with JNDI in web.xml/server.xml 
for database access, but then noticed that struts-config.xml has a 
data-source entry. 

Any opinions ?

- Charlie


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



RE: (http://jakarta.apache.org/struts/tags-tiles-1.1) cannot be resolved

2003-01-03 Thread pqin
Are your tlds located in myapp/WEB-INF?

Regards,
 
 
PQ
 
This Guy Thinks He Knows Everything
This Guy Thinks He Knows What He Is Doing

-Original Message-
From: Daniel Grey [mailto:[EMAIL PROTECTED]] 
Sent: January 3, 2003 3:32 PM
To: Struts Users Mailing List
Subject: RE: (http://jakarta.apache.org/struts/tags-tiles-1.1) cannot be
resolved 

I made that change, now the error message is:

org.apache.jasper.JasperException: null(-1,-1) File
/WEB-INF/pages/mytiles not found

web.xml entry is:
 taglib
taglib-urimytiles/taglib-uri
taglib-location/WEB-INF/struts-tiles.tld/taglib-location
  /taglib

the pages directory has a bunch of jsp's
This seems a little better...
thanks very much
d


-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Friday, January 03, 2003 11:38 AM
To: [EMAIL PROTECTED]
Subject: RE: (http://jakarta.apache.org/struts/tags-tiles-1.1) cannot be
resolved 


Forget META-INF (sorry Craig). I think I finally figured it out.

Let's go back to old release (1.1b2). In my web.xml, I define

taglib
taglib-urimytiles/taglib-uri
taglib-location/WEB-INF/struts-tiles.tld/taglib-location
/taglib

taglib-uri is just a reference that you will use in your jsp. Treat it
as a
variable name.

%@ taglib uri='mytiles' prefix='tiles' %
tiles:insert ./

location is where your file is located, relative path, don't if absolute
path works.

Regards,
 
 
PQ
 
This Guy Thinks He Knows Everything
This Guy Thinks He Knows What He Is Doing

-Original Message-
From: Daniel Grey [mailto:[EMAIL PROTECTED]] 
Sent: January 3, 2003 1:02 PM
To: Struts Users Mailing List
Subject: RE: (http://jakarta.apache.org/struts/tags-tiles-1.1) cannot be
resolved 

Yes I did - still get the same results. I've tried more variations on
that than I can remember.
Thanks

-Original Message-
From: Siggelkow, Bill [mailto:[EMAIL PROTECTED]]
Sent: Friday, January 03, 2003 6:33 AM
To: 'Struts Users Mailing List'
Subject: RE: (http://jakarta.apache.org/struts/tags-tiles-1.1) cannot be
resolved 


Did you try taking the version off the URI?  In other words, use:
http://jakarta.apache.org/struts/tags-tiles;

-Original Message-
From: Daniel Grey [mailto:[EMAIL PROTECTED]]
Sent: Thursday, January 02, 2003 5:21 PM
To: [EMAIL PROTECTED]
Subject: (http://jakarta.apache.org/struts/tags-tiles-1.1) cannot be
resolved 


I am trying to deploy a .ear file to JBOSS and canNot get around this
error:

org.apache.jasper.JasperException: null(-1,-1) This absolute uri
(http://jakarta.apache.org/struts/tags-tiles-1.1) cannot be resolved in
either web.xml or the jar files deployed with this application

There are a bunch of .jsp files that contain this reference:
%@ taglib uri=http://jakarta.apache.org/struts/tags-tiles-1.1;
prefix=tiles %

The web.xml has this reference:
 taglib
 
taglib-urihttp://jakarta.apache.org/struts/tags-tiles-1.1/taglib-uri
taglib-location/WEB-INF/struts-tiles.tld/taglib-location
  /taglib

The lib directory has struts.jar and the classes directory has the
classes
Does anyone have a clue on this?
HELP!
Thanks

--
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: (http://jakarta.apache.org/struts/tags-tiles-1.1) cannot be resolved

2003-01-03 Thread pqin
Check your jsp, is there any place in the jsp that explicitly looking for
tld in WEB-INF/pages?

Regards,
 
 
PQ
 
This Guy Thinks He Knows Everything
This Guy Thinks He Knows What He Is Doing

-Original Message-
From: Khalid K. [mailto:[EMAIL PROTECTED]] 
Sent: January 3, 2003 3:46 PM
To: Struts Users Mailing List
Subject: Re: (http://jakarta.apache.org/struts/tags-tiles-1.1) cannot be
resolved 

it looks like it is looking at WEB-INF/pages, not in WEB-INF
- Original Message -
From: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Friday, January 03, 2003 12:38 PM
Subject: RE: (http://jakarta.apache.org/struts/tags-tiles-1.1) cannot be
resolved


 Are your tlds located in myapp/WEB-INF?

 Regards,


 PQ

 This Guy Thinks He Knows Everything
 This Guy Thinks He Knows What He Is Doing

 -Original Message-
 From: Daniel Grey [mailto:[EMAIL PROTECTED]]
 Sent: January 3, 2003 3:32 PM
 To: Struts Users Mailing List
 Subject: RE: (http://jakarta.apache.org/struts/tags-tiles-1.1) cannot be
 resolved

 I made that change, now the error message is:

 org.apache.jasper.JasperException: null(-1,-1) File
 /WEB-INF/pages/mytiles not found

 web.xml entry is:
  taglib
 taglib-urimytiles/taglib-uri
 taglib-location/WEB-INF/struts-tiles.tld/taglib-location
   /taglib

 the pages directory has a bunch of jsp's
 This seems a little better...
 thanks very much
 d


 -Original Message-
 From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
 Sent: Friday, January 03, 2003 11:38 AM
 To: [EMAIL PROTECTED]
 Subject: RE: (http://jakarta.apache.org/struts/tags-tiles-1.1) cannot be
 resolved


 Forget META-INF (sorry Craig). I think I finally figured it out.

 Let's go back to old release (1.1b2). In my web.xml, I define

 taglib
 taglib-urimytiles/taglib-uri
 taglib-location/WEB-INF/struts-tiles.tld/taglib-location
 /taglib

 taglib-uri is just a reference that you will use in your jsp. Treat it
 as a
 variable name.

 %@ taglib uri='mytiles' prefix='tiles' %
 tiles:insert ./

 location is where your file is located, relative path, don't if absolute
 path works.

 Regards,


 PQ

 This Guy Thinks He Knows Everything
 This Guy Thinks He Knows What He Is Doing

 -Original Message-
 From: Daniel Grey [mailto:[EMAIL PROTECTED]]
 Sent: January 3, 2003 1:02 PM
 To: Struts Users Mailing List
 Subject: RE: (http://jakarta.apache.org/struts/tags-tiles-1.1) cannot be
 resolved

 Yes I did - still get the same results. I've tried more variations on
 that than I can remember.
 Thanks

 -Original Message-
 From: Siggelkow, Bill [mailto:[EMAIL PROTECTED]]
 Sent: Friday, January 03, 2003 6:33 AM
 To: 'Struts Users Mailing List'
 Subject: RE: (http://jakarta.apache.org/struts/tags-tiles-1.1) cannot be
 resolved


 Did you try taking the version off the URI?  In other words, use:
 http://jakarta.apache.org/struts/tags-tiles;

 -Original Message-
 From: Daniel Grey [mailto:[EMAIL PROTECTED]]
 Sent: Thursday, January 02, 2003 5:21 PM
 To: [EMAIL PROTECTED]
 Subject: (http://jakarta.apache.org/struts/tags-tiles-1.1) cannot be
 resolved


 I am trying to deploy a .ear file to JBOSS and canNot get around this
 error:

 org.apache.jasper.JasperException: null(-1,-1) This absolute uri
 (http://jakarta.apache.org/struts/tags-tiles-1.1) cannot be resolved in
 either web.xml or the jar files deployed with this application

 There are a bunch of .jsp files that contain this reference:
 %@ taglib uri=http://jakarta.apache.org/struts/tags-tiles-1.1;
 prefix=tiles %

 The web.xml has this reference:
  taglib

 taglib-urihttp://jakarta.apache.org/struts/tags-tiles-1.1/taglib-uri
 taglib-location/WEB-INF/struts-tiles.tld/taglib-location
   /taglib

 The lib directory has struts.jar and the classes directory has the
 classes
 Does anyone have a clue on this?
 HELP!
 Thanks

 --
 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: Iterate Index Evaluation

2003-01-03 Thread pqin
Can you use html-el?

Regards,
 
 
PQ
 
This Guy Thinks He Knows Everything
This Guy Thinks He Knows What He Is Doing

-Original Message-
From: Siggelkow, Bill [mailto:[EMAIL PROTECTED]] 
Sent: January 3, 2003 3:53 PM
To: 'Struts Users Mailing List'
Subject: RE: Iterate Index Evaluation

Strike that ... reverse it!  I was able to use the bean:define as follows:

logic:iterate indexId=ndx ...
  bean:define id=tmpMod value=%= String.valueOf(ndx.intValue() % 2)
%/
  logic:equal name=tmpMod value=0
even markup here
  /logic:equal
  logic:notEqual name=tmpMod value=0
odd markup here
  /logic:notEqual
/logic:iterate

Give it a try!  The expression is still a little wicked but not as evil as
the scriptlet.

-Original Message-
From: Siggelkow, Bill [mailto:[EMAIL PROTECTED]]
Sent: Friday, January 03, 2003 3:43 PM
To: 'Struts Users Mailing List'
Subject: RE: Iterate Index Evaluation


Er ... I think you may be right ... I know it can be done using scriptlet
for example:

logic:iterate indexId=index ...
  % if ((index % 2) == 0) {%
even row markup here
  % } else { %
odd row markup here
  % } %
/logic:iterate

But we all know how evil this is!

-Original Message-
From: Cohan, Sean [mailto:[EMAIL PROTECTED]]
Sent: Friday, January 03, 2003 3:05 PM
To: 'Struts Users Mailing List'
Subject: RE: Iterate Index Evaluation


Thanks, but I think there will be a problem with the bean:define since the
jsp 1.1 spec does not allow you to use the same bean name more than once in
a single page (which is what we would be doing in an iterate tag.)  Unless
I'm misinterpreting.

-Original Message-
From: Siggelkow, Bill [mailto:[EMAIL PROTECTED]]
Sent: Friday, January 03, 2003 2:49 PM
To: 'Struts Users Mailing List'
Subject: RE: Iterate Index Evaluation


Try something like ...

logic:iterate indexId=index ...
  bean:define id=indexMod2 value='%= index % 2 %'/
  logic:equal name=indexMod2 value=0
markup for even row here
  /logic:equal
  logic:notEqual name=indexMod2 value=0
markup for odd row here
  /logic:equal
/logic:iterate

-Original Message-
From: Cohan, Sean [mailto:[EMAIL PROTECTED]]
Sent: Friday, January 03, 2003 2:40 PM
To: Struts (E-mail)
Subject: Iterate Index Evaluation


I need to iterate over a collection and be able to tell whether the current
index is odd or even.  Any ideas on how I can use the logic tag for this?

logic:match name=index value=odd or even?


Thanks.


--
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: Updating collections of information

2003-01-03 Thread pqin
Greg,

I have to correct my posting.

In my OrderEntryForm, there is an instance variable called lineItems.

In my reset method,

I first instantiate it using lineItems = getOrder(request).getLineItems().
Then I set the checkbox and let struts to populate the line items. You don't
have to keep a copy in session, instead, you can

- keep the size in session.
- in reset method, instantiates a new lineItems(size in session).

I keep two copies (one in request is enough for init values) - because I am
dumb - because I am lazy - because I want to send that much information to
the database - because.. Two-copy will not work for a large multi-row
form (mine is only few rows).

All struts need is how to create a new instance of your collection, I give
it two much.

Regards,
 
 
PQ
 
This Guy Thinks He Knows Everything
This Guy Thinks He Knows What He Is Doing

-Original Message-
From: Greg Bearth [mailto:[EMAIL PROTECTED]] 
Sent: December 31, 2002 5:48 PM
To: 'Struts Users Mailing List'
Subject: RE: Updating collections of information

If your solution is working for you, it cannot be too dumb, and you are
ahead of me.  I agree with your guesses for struts behavior.  I added a line
in reset() to pull the collection bean out of the session and into the form.
This alleviates the NullPointerExeptions, but I am still missing the magic
that happens in the step where Struts saves all the values into this
object.  The sample app prints out A B C even though I modified the values
to be D E F.  It may be time to concede defeat.

I appreciate your time and assistance.

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, December 31, 2002 3:57 PM
To: [EMAIL PROTECTED]
Subject: RE: Updating collections of information


My solution is pretty dumb because it keeps two copies of ActionForm.

1. In orderEntryLoad action (before I load order entry page)

I retrieve line items from database and save two copies of them. One in the
session (see point 2), the other in the request so I have all the initial
values of this ActionForm.

2. In orderEntry action (after I click Submit button)

My guess for struts's behavior is

- Struts instantiates an instance of ActionForm.
- Struts calls reset method to create a new lineItems object. I override it
so as to make it an exact copy of the lineItems I stored in session.
- Struts saves all the values into this object.

Now I can save this ActionForm to database.




Regards,


PQ

This Guy Thinks He Knows Everything
This Guy Thinks He Knows What He Is Doing

-Original Message-
From: Greg Bearth [mailto:[EMAIL PROTECTED]]
Sent: December 31, 2002 4:36 PM
To: 'Struts Users Mailing List'
Subject: RE: Updating collections of information

PQ, please bear with me because I think you are doing what I would like to
do.  I sincerely appreciate the hand-holding as this is my first Struts
project.

In your example, the page displays line items and it appears the user could
potentially update stringOrderAmount and mark items for removal.  When the
form is submitted, does your action class simply call getLineItems() and it
returns a collection of line items with the updated stringOrderAmount(s) and
markedForRemoval flags?  I assume so, and this would be analogous to what I
am attempting to do.  I simply have one extra CollectionBean layer because
in reality, this bean has other attributes besides the collection.

Can you elaborate on what getOrder(...) does?  It returns an iterator, so
obviously it has access to a collection, but what collection (lineItems
variable in your form class?) and how did it get populated?  This is the
heart of what I am missing because my form always returns null on the call
to getCollectionBean().  After adding a line, this.collectionBean = new
CollectionBean(), to the CollectionForm constructor, then
getCollectionBean() returns an object, but calling getElements() on the
object returns null.  Does your form have session scope or request scope?
Is my problem related to putting the collection bean directly into the
session?  If so, how do I wrap it inside the form (the
PopulateCollectionAction doesn't know what Form is expected by the
subsequent UpdateCollectionAction)?

Also, you use a prefix of 'nested'.  To what tag library does this refer,
and is it important to the solution?

Sample Code I am using to test:
-

public class PopulateCollectionAction extends Action {
public ActionForward perform(ActionMapping actionMapping, ActionForm
actionForm, HttpServletRequest httpServletRequest, HttpServletResponse
httpServletResponse) throws IOException, ServletException {
Collection c = new ArrayList();
c.add(new ElementBean(A));
c.add(new ElementBean(B));
c.add(new ElementBean(C));
CollectionBean bean = new CollectionBean();
bean.setElements(c);


RE: (http://jakarta.apache.org/struts/tags-tiles-1.1) cannot be resolved

2003-01-03 Thread pqin
When I load Tomcat, I can see sth like this in log

2003-01-03 16:14:09 ContextConfig[/lciponline]:  Accumulating TLD resource
paths
2003-01-03 16:14:09 ContextConfig[/lciponline]:   Scanning taglib elements
in web.xml
2003-01-03 16:14:09 ContextConfig[/lciponline]:Adding path
'/WEB-INF/struts-bean.tld' for URI '/tags/struts-bean'
2003-01-03 16:14:09 ContextConfig[/lciponline]:Adding path
'/WEB-INF/struts-logic.tld' for URI '/tags/struts-logic'
2003-01-03 16:14:09 ContextConfig[/lciponline]:Adding path
'/WEB-INF/struts-html.tld' for URI '/tags/struts-html'
2003-01-03 16:14:09 ContextConfig[/lciponline]:Adding path
'/WEB-INF/struts-tiles.tld' for URI '/tags/struts-tiles'
2003-01-03 16:14:09 ContextConfig[/lciponline]:Adding path
'/WEB-INF/struts-nested.tld' for URI '/tags/struts-nested'
2003-01-03 16:14:09 ContextConfig[/lciponline]:   Scanning TLDs in /WEB-INF
subdirectory
2003-01-03 16:14:09 ContextConfig[/lciponline]:Adding path
'/WEB-INF/struts-bean.tld'
2003-01-03 16:14:09 ContextConfig[/lciponline]:Adding path
'/WEB-INF/struts-html.tld'
2003-01-03 16:14:09 ContextConfig[/lciponline]:Adding path
'/WEB-INF/struts-logic.tld'
2003-01-03 16:14:09 ContextConfig[/lciponline]:Adding path
'/WEB-INF/struts-nested.tld'
2003-01-03 16:14:09 ContextConfig[/lciponline]:Adding path
'/WEB-INF/struts-tiles.tld'
2003-01-03 16:14:09 ContextConfig[/lciponline]:   Scanning JARs in
/WEB-INF/lib subdirectory
2003-01-03 16:14:09 ContextConfig[/lciponline]:Adding path
'/WEB-INF/lib/commons-beanutils.jar'
2003-01-03 16:14:09 ContextConfig[/lciponline]:Adding path
'/WEB-INF/lib/commons-digester.jar'
2003-01-03 16:14:09 ContextConfig[/lciponline]:Adding path
'/WEB-INF/lib/commons-lang.jar'
2003-01-03 16:14:09 ContextConfig[/lciponline]:Adding path
'/WEB-INF/lib/commons-resources.jar'
2003-01-03 16:14:09 ContextConfig[/lciponline]:Adding path
'/WEB-INF/lib/commons-services.jar'
2003-01-03 16:14:09 ContextConfig[/lciponline]:Adding path
'/WEB-INF/lib/commons-validator.jar'
2003-01-03 16:14:09 ContextConfig[/lciponline]:Adding path
'/WEB-INF/lib/jakarta-oro.jar'
2003-01-03 16:14:09 ContextConfig[/lciponline]:Adding path
'/WEB-INF/lib/log4j-1.2.7.jar'
2003-01-03 16:14:09 ContextConfig[/lciponline]:Adding path
'/WEB-INF/lib/struts.jar'
2003-01-03 16:14:09 ContextConfig[/lciponline]:  Scanning JAR at resource
path '/WEB-INF/lib/jakarta-oro.jar'
2003-01-03 16:14:10 ContextConfig[/lciponline]:  Scanning JAR at resource
path '/WEB-INF/lib/commons-lang.jar'
2003-01-03 16:14:10 ContextConfig[/lciponline]:  Scanning TLD at resource
path '/WEB-INF/struts-logic.tld'
2003-01-03 16:14:10 ContextConfig[/lciponline]:  Scanning JAR at resource
path '/WEB-INF/lib/commons-validator.jar'
2003-01-03 16:14:10 ContextConfig[/lciponline]:  Scanning JAR at resource
path '/WEB-INF/lib/commons-services.jar'
2003-01-03 16:14:10 ContextConfig[/lciponline]:  Scanning JAR at resource
path '/WEB-INF/lib/commons-resources.jar'
2003-01-03 16:14:10 ContextConfig[/lciponline]:  Scanning JAR at resource
path '/WEB-INF/lib/commons-beanutils.jar'
2003-01-03 16:14:10 ContextConfig[/lciponline]:  Scanning TLD at resource
path '/WEB-INF/struts-tiles.tld'
2003-01-03 16:14:10 ContextConfig[/lciponline]:  Scanning JAR at resource
path '/WEB-INF/lib/commons-digester.jar'
2003-01-03 16:14:10 ContextConfig[/lciponline]:  Scanning TLD at resource
path '/WEB-INF/struts-nested.tld'
2003-01-03 16:14:10 ContextConfig[/lciponline]:  Scanning JAR at resource
path '/WEB-INF/lib/log4j-1.2.7.jar'
2003-01-03 16:14:10 ContextConfig[/lciponline]:  Scanning JAR at resource
path '/WEB-INF/lib/struts.jar'
2003-01-03 16:14:10 ContextConfig[/lciponline]:   Processing TLD at
'META-INF/tlds/struts-template.tld'
2003-01-03 16:14:10 ContextConfig[/lciponline]:   Processing TLD at
'META-INF/tlds/struts-bean.tld'
2003-01-03 16:14:10 ContextConfig[/lciponline]:   Processing TLD at
'META-INF/tlds/struts-nested.tld'
2003-01-03 16:14:10 ContextConfig[/lciponline]:   Processing TLD at
'META-INF/tlds/struts-logic.tld'
2003-01-03 16:14:10 ContextConfig[/lciponline]:   Processing TLD at
'META-INF/tlds/struts-html.tld'
2003-01-03 16:14:10 ContextConfig[/lciponline]:   Processing TLD at
'META-INF/tlds/struts-tiles.tld'
2003-01-03 16:14:10 ContextConfig[/lciponline]:  Scanning TLD at resource
path '/WEB-INF/struts-html.tld'
2003-01-03 16:14:10 ContextConfig[/lciponline]:  Scanning TLD at resource
path '/WEB-INF/struts-bean.tld'
2003-01-03 16:14:10 ContextConfig[/lciponline]: Pipline Configuration:
2003-01-03 16:14:10 ContextConfig[/lciponline]:
org.apache.catalina.core.StandardContextValve/1.0

Can you see it in your log file?


Regards,
 
 
PQ
 
This Guy Thinks He Knows Everything
This Guy Thinks He Knows What He Is Doing

-Original Message-
From: Daniel Grey [mailto:[EMAIL PROTECTED]] 
Sent: January 3, 2003 4:34 PM
To: Struts Users Mailing List
Subject: RE: (http://jakarta.apache.org/struts/tags-tiles-1.1) cannot be
resolved 


RE: Iterate Index Evaluation

2003-01-03 Thread pqin
Odd and even is not the only way of doing that, you can also switch between
1 and -1 regardless which row index is.

Regards,
 
 
PQ
 
This Guy Thinks He Knows Everything
This Guy Thinks He Knows What He Is Doing

-Original Message-
From: Piper, James D CECOM SEC EPS
[mailto:[EMAIL PROTECTED]] 
Sent: January 3, 2003 4:50 PM
To: 'Cohan, Sean'; 'Struts Users Mailing List'
Subject: RE: Iterate Index Evaluation

I found the RowTag by Amarda Business Systems Ltd useful for doing different
colors based on odd or even rows...

looking at their source they use logic like:
boolean evenNumber = (getRowNumber() % 2) == 0 ? true : false;

to determine odd or even where getRowNumber() essentialy gets the iterators
index.  Pretty much the same logic as what you came up with.

http://jakarta.apache.org/struts/resources/taglibs.html

- Jim Piper


-Original Message-
From: Cohan, Sean [mailto:[EMAIL PROTECTED]]
Sent: Friday, January 03, 2003 4:11 PM
To: 'Struts Users Mailing List'
Subject: RE: Iterate Index Evaluation


Thanks very much!  I will.

-Original Message-
From: Siggelkow, Bill [mailto:[EMAIL PROTECTED]]
Sent: Friday, January 03, 2003 3:53 PM
To: 'Struts Users Mailing List'
Subject: RE: Iterate Index Evaluation


Strike that ... reverse it!  I was able to use the bean:define as follows:

logic:iterate indexId=ndx ...
  bean:define id=tmpMod value=%= String.valueOf(ndx.intValue() % 2)
%/
  logic:equal name=tmpMod value=0
even markup here
  /logic:equal
  logic:notEqual name=tmpMod value=0
odd markup here
  /logic:notEqual
/logic:iterate

Give it a try!  The expression is still a little wicked but not as evil as
the scriptlet.

-Original Message-
From: Siggelkow, Bill [mailto:[EMAIL PROTECTED]]
Sent: Friday, January 03, 2003 3:43 PM
To: 'Struts Users Mailing List'
Subject: RE: Iterate Index Evaluation


Er ... I think you may be right ... I know it can be done using scriptlet
for example:

logic:iterate indexId=index ...
  % if ((index % 2) == 0) {%
even row markup here
  % } else { %
odd row markup here
  % } %
/logic:iterate

But we all know how evil this is!

-Original Message-
From: Cohan, Sean [mailto:[EMAIL PROTECTED]]
Sent: Friday, January 03, 2003 3:05 PM
To: 'Struts Users Mailing List'
Subject: RE: Iterate Index Evaluation


Thanks, but I think there will be a problem with the bean:define since the
jsp 1.1 spec does not allow you to use the same bean name more than once in
a single page (which is what we would be doing in an iterate tag.)  Unless
I'm misinterpreting.

-Original Message-
From: Siggelkow, Bill [mailto:[EMAIL PROTECTED]]
Sent: Friday, January 03, 2003 2:49 PM
To: 'Struts Users Mailing List'
Subject: RE: Iterate Index Evaluation


Try something like ...

logic:iterate indexId=index ...
  bean:define id=indexMod2 value='%= index % 2 %'/
  logic:equal name=indexMod2 value=0
markup for even row here
  /logic:equal
  logic:notEqual name=indexMod2 value=0
markup for odd row here
  /logic:equal
/logic:iterate

-Original Message-
From: Cohan, Sean [mailto:[EMAIL PROTECTED]]
Sent: Friday, January 03, 2003 2:40 PM
To: Struts (E-mail)
Subject: Iterate Index Evaluation


I need to iterate over a collection and be able to tell whether the current
index is odd or even.  Any ideas on how I can use the logic tag for this?

logic:match name=index value=odd or even?


Thanks.


--
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: Updating collections of information

2003-01-02 Thread pqin
1.1b2

Regards,
 
 
PQ
 
This Guy Thinks He Knows Everything
This Guy Thinks He Knows What He Is Doing

-Original Message-
From: Greg Bearth [mailto:[EMAIL PROTECTED]] 
Sent: December 31, 2002 6:01 PM
To: 'Struts Users Mailing List'
Subject: RE: Updating collections of information

PQ, can I ask one more question...what version of Struts are you using?  I
am using 1.0.2.

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, December 31, 2002 3:57 PM
To: [EMAIL PROTECTED]
Subject: RE: Updating collections of information


My solution is pretty dumb because it keeps two copies of ActionForm.

1. In orderEntryLoad action (before I load order entry page)

I retrieve line items from database and save two copies of them. One in the
session (see point 2), the other in the request so I have all the initial
values of this ActionForm.

2. In orderEntry action (after I click Submit button)

My guess for struts's behavior is

- Struts instantiates an instance of ActionForm.
- Struts calls reset method to create a new lineItems object. I override it
so as to make it an exact copy of the lineItems I stored in session.
- Struts saves all the values into this object.

Now I can save this ActionForm to database.




Regards,


PQ

This Guy Thinks He Knows Everything
This Guy Thinks He Knows What He Is Doing

-Original Message-
From: Greg Bearth [mailto:[EMAIL PROTECTED]]
Sent: December 31, 2002 4:36 PM
To: 'Struts Users Mailing List'
Subject: RE: Updating collections of information

PQ, please bear with me because I think you are doing what I would like to
do.  I sincerely appreciate the hand-holding as this is my first Struts
project.

In your example, the page displays line items and it appears the user could
potentially update stringOrderAmount and mark items for removal.  When the
form is submitted, does your action class simply call getLineItems() and it
returns a collection of line items with the updated stringOrderAmount(s) and
markedForRemoval flags?  I assume so, and this would be analogous to what I
am attempting to do.  I simply have one extra CollectionBean layer because
in reality, this bean has other attributes besides the collection.

Can you elaborate on what getOrder(...) does?  It returns an iterator, so
obviously it has access to a collection, but what collection (lineItems
variable in your form class?) and how did it get populated?  This is the
heart of what I am missing because my form always returns null on the call
to getCollectionBean().  After adding a line, this.collectionBean = new
CollectionBean(), to the CollectionForm constructor, then
getCollectionBean() returns an object, but calling getElements() on the
object returns null.  Does your form have session scope or request scope?
Is my problem related to putting the collection bean directly into the
session?  If so, how do I wrap it inside the form (the
PopulateCollectionAction doesn't know what Form is expected by the
subsequent UpdateCollectionAction)?

Also, you use a prefix of 'nested'.  To what tag library does this refer,
and is it important to the solution?

Sample Code I am using to test:
-

public class PopulateCollectionAction extends Action {
public ActionForward perform(ActionMapping actionMapping, ActionForm
actionForm, HttpServletRequest httpServletRequest, HttpServletResponse
httpServletResponse) throws IOException, ServletException {
Collection c = new ArrayList();
c.add(new ElementBean(A));
c.add(new ElementBean(B));
c.add(new ElementBean(C));
CollectionBean bean = new CollectionBean();
bean.setElements(c);

httpServletRequest.getSession().setAttribute(theCollectionBean, bean);
return(actionMapping.findForward(displayCollection));
//displayCollection.jsp
}
}

-

public class UpdateCollectionAction extends Action {
public ActionForward perform(ActionMapping actionMapping, ActionForm
actionForm, HttpServletRequest httpServletRequest, HttpServletResponse
httpServletResponse) throws IOException, ServletException {
CollectionForm f = (CollectionForm) actionForm;
Collection c = f.getCollectionBean().getElements();
//NullPointerException
for (Iterator i = c.iterator(); i.hasNext();)
//NullPointerException
{
ElementBean e = (ElementBean) i.next();
System.out.println(e.getValue());  //This should
print D E F.
}
return(actionMapping.findForward(start));  //index.jsp
}

-

public class CollectionForm extends ActionForm {
CollectionBean collectionBean;

public CollectionForm() {
this.collectionBean = new CollectionBean();
}

public CollectionBean getCollectionBean() {
return 

RE: ArrayDescriptor - GenericConnection exception

2003-01-02 Thread pqin
Oracle requires an explicit OracleConnection. Thus you have to get the
underlying connection of struts/tomcat connection by

((PoolableConnection) getConnection()).getDelegate()

Regards,
 
 
PQ
 
This Guy Thinks He Knows Everything
This Guy Thinks He Knows What He Is Doing

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] 
Sent: January 2, 2003 3:25 PM
To: [EMAIL PROTECTED]
Subject: ArrayDescriptor - GenericConnection exception


Hi, Folks:

Happy New Year!

I am having the same problem Eva had. Anyone has a solution?

Many thanks.

Patrick


[Mail Archive]
struts-user
Chronological --
Find 
Thread --
ArrayDescriptor - GenericConnection exception

* From: Eva Garabedian
* Subject: ArrayDescriptor - GenericConnection exception
* Date: Wed, 12 Jun 2002 16:24:31 -0700

Hello List - I've got a question about passing a string array into an
Oracle Procedure. 
Specifically, my ArrayDescriptor assignment line is throwing a struts
exception, whose message is simply
org.apache.struts.util.GenericConnection.
I'm using a CallableStatement in my Java code to pass my String[] to my
Oracle procedure. Before I added the String[] parameter, everything was
working quite nicely. Now when I run this I get the dreaded
NullPointerException in the Tomcat messages in my browser, and the first
System.out.println (found below) shows up, but the GenericConnection
exception is thrown before the second println executes. This leads me to
believe that the ArrayDescriptor is the culprit. In the following code,
please note that the user_type NL_GROUP exists in my database, created
by the user CREATOR.

Thanks in advance for any suggestions about where I should look for
help. 



Here is my related code: 
public boolean addCustomer(String userName, String password,
String[] nlGroup) throws Exception  {
 
   Connection conn = null;
   CallableStatement stmt = null;
   String sql = {call INS_CUSTOMER_AND_CONTACT_INFO(?, ?, ?)};
 
   try {
 conn = dataSource.getConnection();
 
 System.out.println(After getConnection. );
 
 ArrayDescriptor desc =
ArrayDescriptor.createDescriptor(CREATOR.NL_GROUP, conn);
 
 System.out.println(After arrayDescriptor assignment. );
 
 ARRAY newArray = new ARRAY(desc, conn, nlGroup);
 stmt = conn.prepareCall(sql);
 stmt.setString(1, userName);
 stmt.setString(2, password);
 ((OraclePreparedStatement)stmt).setArray(3, newArray);
.
.
.
 

* ArrayDescriptor - GenericConnection exception, Eva Garabedian


Chronological -- Thread --

Reply via email to



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



RE: problem streaming file to browser

2002-12-31 Thread pqin
Did u close all the resources before u return null?

Regards,
 
 
PQ
 
This Guy Thinks He Knows Everything
This Guy Thinks He Knows What He Is Doing

-Original Message-
From: Srinivas Sampige [mailto:[EMAIL PROTECTED]] 
Sent: December 30, 2002 9:13 PM
To: Sven Bischoff
Cc: [EMAIL PROTECTED]
Subject: RE: problem streaming file to browser

Hi
 Sven's suggestion on returning null in ReportAction got me past the
problem 
of not being able to run the report generation a second time
consecutively. 
Now, another problem still remains. In ReportAction depending on various 
conditions I am doing processing and forwarding back to the calling page or
if 
it is specifically a report generation I am returning a null(as per sven's 
suggestion). But what is happening here is if I keep doing a submit from the

JSP only for report generation consecutively  the report generation works. 
Now, when I do a submit for another operation from the same JSP  
ReportAction does the processing and forwards back to the JSP successfully, 
but then if I hit the report button i.e to generate a report... 
ReportAction breaks down with this exception (after the stack trace I have

typed in some of my thoughts so please read them)..

===
Error: 500
Location: /etrac/jsp/report.jsp
Internal Servlet Error:

javax.servlet.ServletException: OutputStream is already being used for this 
request
java.lang.Throwable(java.lang.String)
java.lang.Exception(java.lang.String)
javax.servlet.ServletException(java.lang.Throwable)
void 
org.apache.jasper.runtime.PageContextImpl.handlePageException(java.lang.Exce
pt
ion)
void 
jsp._0002fjsp_0002freport_0002ejspreport_jsp_43._jspService(javax.servlet.ht
tp
.HttpServletRequest, javax.servlet.http.HttpServletResponse)
void 
org.apache.jasper.runtime.HttpJspBase.service(javax.servlet.http.HttpServlet
Re
quest, javax.servlet.http.HttpServletResponse)
void
javax.servlet.http.HttpServlet.service(javax.servlet.ServletRequest, 
javax.servlet.ServletResponse)
void 
org.apache.jasper.servlet.JspServlet$JspCountedServlet.service(javax.servlet
.h
ttp.HttpServletRequest, javax.servlet.http.HttpServletResponse)
void
javax.servlet.http.HttpServlet.service(javax.servlet.ServletRequest, 
javax.servlet.ServletResponse)
void 
org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(javax.servlet
.h
ttp.HttpServletRequest, javax.servlet.http.HttpServletResponse, boolean)
void 
org.apache.jasper.servlet.JspServlet.serviceJspFile(javax.servlet.http.HttpS
er
vletRequest, javax.servlet.http.HttpServletResponse, java.lang.String, 
java.lang.Throwable, boolean)
void 
org.apache.jasper.servlet.JspServlet.service(javax.servlet.http.HttpServletR
eq
uest, javax.servlet.http.HttpServletResponse)
void
javax.servlet.http.HttpServlet.service(javax.servlet.ServletRequest, 
javax.servlet.ServletResponse)
void 
org.apache.tomcat.core.ServletWrapper.doService(org.apache.tomcat.core.Reque
st
, org.apache.tomcat.core.Response)
void
org.apache.tomcat.core.Handler.service(org.apache.tomcat.core.Request, 
org.apache.tomcat.core.Response)
void 
org.apache.tomcat.core.ServletWrapper.service(org.apache.tomcat.core.Request
, 
org.apache.tomcat.core.Response)
void 
org.apache.tomcat.facade.RequestDispatcherImpl.doForward(javax.servlet.Servl
et
Request, javax.servlet.ServletResponse)
void 
org.apache.tomcat.facade.RequestDispatcherImpl.forward(javax.servlet.Servlet
Re
quest, javax.servlet.ServletResponse)
void 
org.apache.struts.action.ActionServlet.processActionForward(org.apache.strut
s.
action.ActionForward, org.apache.struts.action.ActionMapping, 
org.apache.struts.action.ActionForm, javax.servlet.http.HttpServletRequest, 
javax.servlet.http.HttpServletResponse)
void 
org.apache.struts.action.ActionServlet.process(javax.servlet.http.HttpServle
tR
equest, javax.servlet.http.HttpServletResponse)
void 
com.boeing.etrac.action.EtracServlet.process(javax.servlet.http.HttpServletR
eq
uest, javax.servlet.http.HttpServletResponse)
void 
org.apache.struts.action.ActionServlet.doPost(javax.servlet.http.HttpServlet
Re
quest, javax.servlet.http.HttpServletResponse)
void 
javax.servlet.http.HttpServlet.service(javax.servlet.http.HttpServletRequest
, 
javax.servlet.http.HttpServletResponse)
void
javax.servlet.http.HttpServlet.service(javax.servlet.ServletRequest, 
javax.servlet.ServletResponse)
void 
org.apache.tomcat.core.ServletWrapper.doService(org.apache.tomcat.core.Reque
st
, org.apache.tomcat.core.Response)
void
org.apache.tomcat.core.Handler.service(org.apache.tomcat.core.Request, 
org.apache.tomcat.core.Response)
void 
org.apache.tomcat.core.ServletWrapper.service(org.apache.tomcat.core.Request
, 
org.apache.tomcat.core.Response)
void 

RE: [ANNOUNCEMENT] Struts 1.1 Beta 3 Released

2002-12-31 Thread pqin
Can you provide a list of changes/bug fixes since 1.1b2? All I have seen is
additions/changes/bug fixes since 1.0

Regards,
 
 
PQ
 
This Guy Thinks He Knows Everything
This Guy Thinks He Knows What He Is Doing

-Original Message-
From: Martin Cooper [mailto:[EMAIL PROTECTED]] 
Sent: December 31, 2002 4:31 AM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED];
[EMAIL PROTECTED]
Subject: [ANNOUNCEMENT] Struts 1.1 Beta 3 Released

The Struts team is proud to announce the release of Struts 1.1 Beta 3.
This release includes significant new functionality, while retaining full
backwards compatibility with earlier versions of Struts. It also
incorporates fixes for a number of bugs which were reported against
earlier versions.

The binary distribution is available at:

  http://jakarta.apache.org/builds/jakarta-struts/release/v1.1-b3/

and the source distribution is available at:

  http://jakarta.apache.org/builds/jakarta-struts/release/v1.1-b3/src/

In addition, the library distibution, which contains updated binaries
without the sample applications, is available at:

  http://jakarta.apache.org/builds/jakarta-struts/release/v1.1-b3/lib/

Details of the changes in this release are available in the Release Notes,
which can be found here:

  http://jakarta.apache.org/struts/userGuide/release-notes-1.1-b3.html

--
Martin Cooper


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



RE: Updating collections of information

2002-12-31 Thread pqin
This is a classic question. You have to override reset in your form to
correctly populate all the elements.

Regards,
 
 
PQ
 
This Guy Thinks He Knows Everything
This Guy Thinks He Knows What He Is Doing

-Original Message-
From: Greg Bearth [mailto:[EMAIL PROTECTED]] 
Sent: December 31, 2002 10:22 AM
To: [EMAIL PROTECTED]
Subject: Updating collections of information

I've read the Struts User Guide, Programming Jakarta Struts, searched
Google, and asked a couple of acquaintances, but have yet to find a
definitive answer to whether Struts can help me in the following situation.
The closest thing I've found is a reference to IndexTags under Struts
Resource.

I have a form which correctly displays information found in a collection of
beans.  However, each piece of displayed information is potentially
updateable.  When the form is subsequently submitted, does Struts
rebuild/update the collection of elements?  I suspect it doesn't because
attempting to retrieve the collection from the form bean returns null.  If
not, any suggestions as to how I should handle this?  Shall I resort to
using straight html elements with a naming convention and Java scriptlets,
as opposed to trying to use the struts html element tags?

Sample portion of JSP:
logic:iterate name=selectedBean id=element property=elements
type=xxx.yyy.ElementBean indexId=rowNum 
  tr class=%= rowNum.intValue() % 2 == 0 ? evenRow : oddrow % 
td align=lefthtml:text name=element property=propertyA//td
td align=centerhtml:checkbox name=element
property=propertyB/html:checkbox/td
td align=centerhtml:checkbox name=element
property=propertyC/html:checkbox/td
  /tr
/logic:iterate

I am using Struts 1.0.2 and Tomcat 4.1.12.

Any assistance, or confirmation that this is not possible with Struts will
be appreciated.  Thanks.

Greg Bearth
Fourth Generation, Inc.
175 East Fifth Street, Suite 251
St Paul  MN  55101
mailto:[EMAIL PROTECTED]
(651) 260-7643



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



RE: using logic:iterate to load html:link

2002-12-31 Thread pqin
Everybody is talking about struts-el. Is it part of struts.jar? where can I
find the doc for it?

Regards,
 
 
PQ
 
This Guy Thinks He Knows Everything
This Guy Thinks He Knows What He Is Doing

-Original Message-
From: Karr, David [mailto:[EMAIL PROTECTED]] 
Sent: December 31, 2002 11:02 AM
To: Struts Users Mailing List
Subject: RE: using logic:iterate to load html:link

You can do this with the Struts-EL library, which is part of the Struts
distribution.  Using this, your tag could look like this:

  html-el:link forward='${menuOpt[forward]}'
target='${menuOpt[target]}'/

The Struts-EL library uses the JSTL expression language engine for
evaluating attribute values.  Struts-EL requires a Servlet 2.3-compliant
container.

 -Original Message-
 From: Steven Dahlin [mailto:[EMAIL PROTECTED]]
 
 for my menu options I would like to load a dynamic list of 
 menu options which will be read by the jsp file.  The java 
 code will load a vector with the menu options like this:
 
 VectorvecMenuOpts= new Vector();
 Hashtable   htblMenuOpt = new Hashtable();
 
 htblMenuOpt.put( forward, forwardindicator );
 htblMenuOpt.put( target, _top );
 htblMenuOpt.put( description, labeltoshow );
 
 vecMenuOpts.add( htblMenuOpt );
 
 ... add other menu options and then write it in a bean to the 
 session ...
 
 The Jsp would look like this:
 
 logic:iterate id=menuOpt name=vecMenuOpts
 html:link  
  ... here is where I need to load the forward and target 
bean:write name=menuOpt property=description/
 /html:link
 /logic:iterate
 
 I would like to do this without having to use scriptlets.  Is 
 there a way to do this?

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



RE: Updating collections of information

2002-12-31 Thread pqin
public class OrderEntryForm extends ActionForm {

/**
 * list of line items.
 */
private Collection lineItems ;
/**
 * next withdraw from line item.
 */
private String nextWithdrawalDate ;
/**
 * instantiates an empty collection of line items.
 */
public OrderEntryForm() {
lineItems = new ArrayList() ;
}

/**
 * sets line items.
 *
 * @param   c   collection of line items.
 */
public void setLineItems(Collection c)
{
lineItems.addAll(c) ;
}

/**
 * returns line items.
 *
 * @return  lineItems   line items.
 */
public Collection getLineItems()
{
return lineItems ;
}

/**
 * add one line item to order entry form.
 *
 * @param   o   line item.
 */
public void addLineItem(OrderEntryLineItemForm o)
{
lineItems.add(o) ;
}

/**
 * I have to initialize the form otherwise got
IndexOutOfBoundsException. I also need to reset markedForRemoval.
 *
 * @param   mapping action mapping, no use.
 * @param   request request to find the numLineItems in session.
 */
public void reset(ActionMapping mapping, HttpServletRequest request)
{
Iterator iterator = getOrder(..) ;
while (iterator.hasNext())
{
((OrderEntryLineItemForm)
iterator.next()).setMarkedForRemoval(Boolean.FALSE) ;
}
}


}

Regards,
 
 
PQ
 
This Guy Thinks He Knows Everything
This Guy Thinks He Knows What He Is Doing

-Original Message-
From: Greg Bearth [mailto:[EMAIL PROTECTED]] 
Sent: December 31, 2002 1:36 PM
To: 'Struts Users Mailing List'
Subject: RE: Updating collections of information

I'm not sure I understand how I can override reset to solve this issue.  Can
you elaborate?  Do I have to create an empty collection or something?

To be clear, this is not the situation where checkboxes must be initialized
to false in the reset method.  I've already fallen for that one.  My issue
could simply be a collection of three beans which have String property
values A, B, C respectively (of course in real life the size of the
collection is not predetermined and the bean would have more properties).
These values are displayed using the logic:iterate tag and the html:text tag
(sample, untested code below).  My form bean would have getBeanCollection()
and setBeanCollection(Collection c) methods. Each bean in the collection has
a getString() and setString(String s) methods.  Assuming the user changes
the three values to D, E, F, how should my action class retrieve the
new values?  I'd like to call getBeanCollection() on the form bean and have
it return a collection of three beans in which the getString method returns
D, E, F respectively, but so far getBeanCollection() returns null.

logic:iterate name=selectedBean id=element property=beanCollection
type=xxx.yyy.ElementBean
  tr
td align=lefthtml:text name=element property=string//td
  /tr
/logic:iterate

I appreciate your time and patience.

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, December 31, 2002 10:20 AM
To: [EMAIL PROTECTED]
Subject: RE: Updating collections of information


This is a classic question. You have to override reset in your form to
correctly populate all the elements.

Regards,


PQ

This Guy Thinks He Knows Everything
This Guy Thinks He Knows What He Is Doing


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



RE: Updating collections of information

2002-12-31 Thread pqin
On the page:

nested:iterate property=lineItems id=orderEntryLineItemForm
TR
TD nowrapnested:hidden property=assetID/nested:write
property=assetName//TD
TD align=centernested:text property=stringOrderAmount//TD
TD align=center
nested:select property=nextTransactionDate
nested:options property=nextTransactionDateValues
labelProperty=nextTransactionDateLabels/
/nested:select
/TD
TD align=centernested:checkbox property=markedForRemoval
value=true//TD
/TR
/nested:iterate

Regards,
 
 
PQ
 
This Guy Thinks He Knows Everything
This Guy Thinks He Knows What He Is Doing

-Original Message-
From: Greg Bearth [mailto:[EMAIL PROTECTED]] 
Sent: December 31, 2002 1:36 PM
To: 'Struts Users Mailing List'
Subject: RE: Updating collections of information

I'm not sure I understand how I can override reset to solve this issue.  Can
you elaborate?  Do I have to create an empty collection or something?

To be clear, this is not the situation where checkboxes must be initialized
to false in the reset method.  I've already fallen for that one.  My issue
could simply be a collection of three beans which have String property
values A, B, C respectively (of course in real life the size of the
collection is not predetermined and the bean would have more properties).
These values are displayed using the logic:iterate tag and the html:text tag
(sample, untested code below).  My form bean would have getBeanCollection()
and setBeanCollection(Collection c) methods. Each bean in the collection has
a getString() and setString(String s) methods.  Assuming the user changes
the three values to D, E, F, how should my action class retrieve the
new values?  I'd like to call getBeanCollection() on the form bean and have
it return a collection of three beans in which the getString method returns
D, E, F respectively, but so far getBeanCollection() returns null.

logic:iterate name=selectedBean id=element property=beanCollection
type=xxx.yyy.ElementBean
  tr
td align=lefthtml:text name=element property=string//td
  /tr
/logic:iterate

I appreciate your time and patience.

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, December 31, 2002 10:20 AM
To: [EMAIL PROTECTED]
Subject: RE: Updating collections of information


This is a classic question. You have to override reset in your form to
correctly populate all the elements.

Regards,


PQ

This Guy Thinks He Knows Everything
This Guy Thinks He Knows What He Is Doing


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



RE: Updating collections of information

2002-12-31 Thread pqin
My solution is pretty dumb because it keeps two copies of ActionForm.

1. In orderEntryLoad action (before I load order entry page)

I retrieve line items from database and save two copies of them. One in the
session (see point 2), the other in the request so I have all the initial
values of this ActionForm.

2. In orderEntry action (after I click Submit button)

My guess for struts's behavior is

- Struts instantiates an instance of ActionForm.
- Struts calls reset method to create a new lineItems object. I override it
so as to make it an exact copy of the lineItems I stored in session.
- Struts saves all the values into this object.

Now I can save this ActionForm to database.




Regards,
 
 
PQ
 
This Guy Thinks He Knows Everything
This Guy Thinks He Knows What He Is Doing

-Original Message-
From: Greg Bearth [mailto:[EMAIL PROTECTED]] 
Sent: December 31, 2002 4:36 PM
To: 'Struts Users Mailing List'
Subject: RE: Updating collections of information

PQ, please bear with me because I think you are doing what I would like to
do.  I sincerely appreciate the hand-holding as this is my first Struts
project.

In your example, the page displays line items and it appears the user could
potentially update stringOrderAmount and mark items for removal.  When the
form is submitted, does your action class simply call getLineItems() and it
returns a collection of line items with the updated stringOrderAmount(s) and
markedForRemoval flags?  I assume so, and this would be analogous to what I
am attempting to do.  I simply have one extra CollectionBean layer because
in reality, this bean has other attributes besides the collection.

Can you elaborate on what getOrder(...) does?  It returns an iterator, so
obviously it has access to a collection, but what collection (lineItems
variable in your form class?) and how did it get populated?  This is the
heart of what I am missing because my form always returns null on the call
to getCollectionBean().  After adding a line, this.collectionBean = new
CollectionBean(), to the CollectionForm constructor, then
getCollectionBean() returns an object, but calling getElements() on the
object returns null.  Does your form have session scope or request scope?
Is my problem related to putting the collection bean directly into the
session?  If so, how do I wrap it inside the form (the
PopulateCollectionAction doesn't know what Form is expected by the
subsequent UpdateCollectionAction)?

Also, you use a prefix of 'nested'.  To what tag library does this refer,
and is it important to the solution?

Sample Code I am using to test:
-

public class PopulateCollectionAction extends Action {
public ActionForward perform(ActionMapping actionMapping, ActionForm
actionForm, HttpServletRequest httpServletRequest, HttpServletResponse
httpServletResponse) throws IOException, ServletException {
Collection c = new ArrayList();
c.add(new ElementBean(A));
c.add(new ElementBean(B));
c.add(new ElementBean(C));
CollectionBean bean = new CollectionBean();
bean.setElements(c);

httpServletRequest.getSession().setAttribute(theCollectionBean, bean);
return(actionMapping.findForward(displayCollection));
//displayCollection.jsp
}
}

-

public class UpdateCollectionAction extends Action {
public ActionForward perform(ActionMapping actionMapping, ActionForm
actionForm, HttpServletRequest httpServletRequest, HttpServletResponse
httpServletResponse) throws IOException, ServletException {
CollectionForm f = (CollectionForm) actionForm;
Collection c = f.getCollectionBean().getElements();
//NullPointerException
for (Iterator i = c.iterator(); i.hasNext();)
//NullPointerException
{
ElementBean e = (ElementBean) i.next();
System.out.println(e.getValue());  //This should
print D E F.
}
return(actionMapping.findForward(start));  //index.jsp
}

-

public class CollectionForm extends ActionForm {
CollectionBean collectionBean;

public CollectionForm() {
this.collectionBean = new CollectionBean();
}

public CollectionBean getCollectionBean() {
return collectionBean;
}

public void setCollectionBean(CollectionBean collectionBean) {
this.collectionBean = collectionBean;
}
}

-
//index.jsp

html:html
body
html:form action=start.do method=post
centerinput type=submit value=Submit //center
/html:form

/body
/html:html

-
//displayCollection.jsp

html:html
body
html:form action=update.do method=post focus=value
logic:iterate name=theCollectionBean id=element
property=elements

RE: problem streaming file to browser

2002-12-30 Thread pqin
Did you return null? Since u write as pdf, you can only return null as
forward.

Regards,
 
 
Phillip Qin
 
This Guy Thinks He Knows Everything


-Original Message-
From: Srinivas Sampige [mailto:[EMAIL PROTECTED]] 
Sent: December 27, 2002 7:34 PM
To: Struts Users Mailing List
Subject: RE: problem streaming file to browser

Hi
 Thanks for your reply.The code you have supplied is on the lines of what I
am 
doing. Here is what happens. First time the action is run the PDF comes out 
fine to the nrowser but with this message on the server side -

2002-12-27 15:39:46 - Ctx( /etrac ): IllegalStateException in: R( /etrac + 
/reportAction.do + null) Cannot forward as OutputStream or Writer has
already 
been obtained

   Then I cannot generate the PDF again until I execute another action by
say 
... doing back to the main menu of my web app(through another action) OR say

by logging out. I get the same IllegalStateException error in another
simple 
test Action that I put together. Can somebody help me? The same thing works 
fine in as servlet. So, I am not able to understand what is special about a 
Struts Action! Should I be doing something else?. Here are snippets of my 
code-

public abstract class EtracAction extends EtacAction
{
   public ActionForward perform(ActionMapping mapping,ActionForm form 
,HttpServletRequest request, HttpServletResponse response) throws
IOException,
  ServletException
{
   
   
   return performAction(mapping, form, request, response,userSessionInfo);
 
}

public abstract ActionForward performAction(ActionMapping mapping,
ActionForm 
form, HttpServletRequest request, HttpServletResponse response, 
UserSessionInfo userSessionInfo) throws IOException, ServletException;

}//end of EtracAction



---
ReportAction extends EtracAction 
{
  public org.apache.struts.action.ActionForward performAction   
(org.apache.struts.action.ActionMapping mapping, 
org.apache.struts.action.ActionForm form, 
javax.servlet.http.HttpServletRequest request, 
javax.servlet.http.HttpServletResponse response, UserSessionInfo 
userSessionInfo)
throws javax.servlet.ServletException, java.io.IOException
 {

 byte[] reportBuffer = reportManager.generateReport(userSessionInfo);
 String fileName = ;
 //write the pdf to the response
 if (reportBuffer != null)
 {
 response.setContentType(application/pdf);
 response.setHeader(Window-target,report_window);
 fileName = etracPdfReport.pdf;
 ServletOutputStream sout = response.getOutputStream(); //THIS IS THE
CODE 
THAT FAILS THE SECOND TIME AROUND,HAVE TO EXECUTE ANOTHER ACTION BEFORE 
ANOTHER PDF CAN BE STREAMED BACK TO BROWSER.
 sout.write(reportBuffer);

 //sout.flush();  //tried these two lines to avoid above error
 //sout.close();  //but no improvement.

 }
 return mapping.findForward(Forwards.REPORT_PAGE);
 }//end of performaction
}//end of ReportAction



thanks in advance

Srinivas





= Original Message From Struts Users Mailing List 
[EMAIL PROTECTED] =
stmt is an Oracle BFILE

InputStream in = null ;
BufferedInputStream bis = null ;
ServletOutputStream writer = null ;

try
{
stmt.openFile() ;
in = stmt.getBinaryStream() ;
bis = new BufferedInputStream(in) ;
int length ;
byte[] buf = new byte[512] ;
writer = response.getOutputStream() ;
response.setContentType(application/pdf) ;
while ((length=bis.read(buf))!= -1)
{
writer.write(buf) ;
}
}
finally
{
if (writer != null)
writer.close() ;
if (in != null)
in.close() ;
if (bis != null)
bis.close() ;
if (stmt != null)
stmt.closeFile() ;
}

Regards,


Phillip Qin

This Guy Thinks He Knows Everything


-Original Message-
From: Srinivas Sampige [mailto:[EMAIL PROTECTED]]
Sent: December 27, 2002 2:39 PM
To: [EMAIL PROTECTED]
Subject: problem streaming file to browser

Hi
 I havene an action in which I am streaming a PDF file to the browser. I am
doing that by doing a response.getOutputStream() in the action and writing
to
the resulting ServletOutputStream. The first time it works fine, the PDF
appears on the browser but with an illegal state exception on the console
on

the server side. The next time the user chooses to download a file and the
same action is run again I get an error saying that the the servlet output
stream has already been obtained and the PDF does not appear. The user has
to
log out of the web application and then log back on for the PDF download to
work. Could anybody give me an idea what is going wrong? What is the best
way
to code this functionality? Could somebody provide OR point me to some
source
code?

thanks
Srinivas


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

RE: Problem Using Log4J and Commons Logging with Struts

2002-12-30 Thread pqin
If I only use log4j, jar has to be placed in my app's WEB-INF/lib. Don't
know why it is in a different directory if commons-logging and log4j work
together.

Regards,
 
 
Phillip Qin
 
This Guy Thinks He Knows Everything


-Original Message-
From: Paul Hodgetts [mailto:[EMAIL PROTECTED]] 
Sent: December 28, 2002 12:11 PM
To: [EMAIL PROTECTED]
Subject: Re: Problem Using Log4J and Commons Logging with Struts

Eddie Bush wrote:

  Add two files to your WEB-INF/classes directory:
[...]
  That should fix things, I believe.  The commons-logging package
  is going to expect that you want to use Log4J if you have the
  Log4J JAR in the classpath (ie your WEB-INF/lib directory).
  It's not going to work correctly until you configure it
  properly though (at least, it never has for me).

Thanks for the reply.  I tracked down what was happening.

The error was a NoClassDefFoundError on org/apache/log4j/Layout,
despite the fact that I have log4j-1.2.7.jar and log4j.properties
in the WEB-INF/lib directory.  So it looks like the server is
looking for Log4J as the web app is actually being loaded and
prior to the web app's jars being put in its classpath.

I put the jar and the properties file into the lib directory for
the server, in this case JRun puts them in jrun/servers/xxx/lib
(for a server named xxx).  Now it loads the web app properly
without the error.

I don't like this, because it means my web app can't be self-
contained and distributed just as the war.  I'd have to look at
the specs to see if JRun is behaving correctly by not putting the
web app's jars in the classpath prior to initializing the web app,
but even if it is behaving incorrectly, that's the way it works,
so I guess I have to deal with it.

I hope maybe this helps someone else...

Thanks to everyone who replied,
Paul
-
Paul Hodgetts -- President, Principal Consultant
Agile Logic -- www.agilelogic.com
Consulting, Coaching, Training -- On-Site  Out-Sourced Development
Java, J2EE, C++, OOA/D -- Agile Methods/XP/Scrum, Use Cases, UI/IA


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



RE: logon servlet through html forms resource not available

2002-12-30 Thread pqin
In your html, action=/logon.do; in your struts config xml, define action
path=logon 

Regards,
 
 
Phillip Qin
 
This Guy Thinks He Knows Everything


-Original Message-
From: Loren Hall [mailto:[EMAIL PROTECTED]] 
Sent: December 28, 2001 6:07 PM
To: Struts Users Mailing List
Subject: logon servlet through html forms resource not available

New to this and can't access /logon action through a standard html form

I'm integrating some struts functionality with a pre-existing, html based
site.  At index.html I'd like a login form, but don't want to force a change
to index.jsp.  However, i've tried action=logon,
action=/summershow/logon and it says The requested resource (/logon) is
not available. I figure it's a path issue vs. an access issue, but for all I
know an html form just won't work.


First, any thoughts why the following html form tag won't work, and second,
what is the standard solution for this situation, .jsp or .html?


form action=/summershow/logon method=post name=logon
input name=username type=text
input name=password type=password
input name=submit type=submit
/form

responds with

type: Status report
message: /logon
description: The requested resource (/logon) is not available.


The servlet is under catalina/webapps/summershow/WEB-INF/ . . .  The working
code looks like this.


html:form action=/logon focus=username
  User Name:   html:text property=username size=16
maxlength=16/
Password:html:password property=password size=16
maxlength=16 redisplay=false/
  html:submit property=submit value=Submit/
  html:reset/
/html:form





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



RE: redirect attribute (newbie)

2002-12-30 Thread pqin
Why don't you do it in your struts config xml? If authenticated, return a
forward for action/getaccountinformation; if failed, return mapping.getInput
(u need to define input as login page)?

Regards,
 
 
Phillip Qin
 
This Guy Thinks He Knows Everything


-Original Message-
From: Suresh Addagalla [mailto:[EMAIL PROTECTED]] 
Sent: December 30, 2002 8:02 AM
To: [EMAIL PROTECTED]
Subject: redirect attribute (newbie)

Hi,

I have a loginAction. If login is successfu, I want to perform another
action as follows.

forward name=Success path=/action/getaccountinformation
redirect=true/

I am not sure whether to use true or false for redirect. What is the
difference and which one should I use in this case?

Thanks,
Suresh




RE: Global Exception Handlers

2002-12-30 Thread pqin
What kind of detail you are looking at?

Regards,
 
 
Phillip Qin
 
This Guy Thinks He Knows Everything


-Original Message-
From: Michael Marrotte [mailto:[EMAIL PROTECTED]] 
Sent: December 30, 2002 1:00 PM
To: Struts Users Mailing List
Subject: Global Exception Handlers

Do you know of any good reading that elaborates on writing a global
exception handlers for Struts?

I've already read
http://jakarta.apache.org/struts/userGuide/building_controller.html#exceptio
n_handler ,

but am looking for more detail or a tutorial.

Thanks,

--Mike


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



RE: Problem Using Log4J and Commons Logging with Struts

2002-12-30 Thread pqin
Sorry, I am talking about Tomcat. Maybe it is bug for JRun.

Regards,
 
 
PQ
 
This Guy Thinks He Knows Everything
This Guy Thinks He Knows What He Is Doing

-Original Message-
From: Paul Hodgetts [mailto:[EMAIL PROTECTED]] 
Sent: December 30, 2002 5:14 PM
To: [EMAIL PROTECTED]
Subject: Re: Problem Using Log4J and Commons Logging with Struts

Phillip Qin wrote:

  If I only use log4j, jar has to be placed in my app's WEB-INF/lib. Don't
  know why it is in a different directory if commons-logging and log4j work
  together.

Just because two libraries use each other's classes doesn't mean
their classes (or jars) need to be in the same directory.  They
just need to locate each other's classes in the classpath.

A web container places WEB-INF/classes and all the jars found in
WEB-INF/lib into the classpath for the web application.  I don't
know for sure (I haven't researched the specs), but apparently
these are supposed to be placed in the classpath prior to
initializing the web application.

JRun apparently has a bug where it does not put these in the
classpath early enough, so when some components of Struts (or
something else that depends on Log4J) initialize, they can't
find the Log4J jar file, and hence the NoClassDefFoundError.

It probably works for you to just put the Log4J jar into
WEB-INF/lib under a different container, and I'd really like it
to work this way for JRun as well, but it doesn't, so I need to
put the Log4J jar and properties file into the shared server lib
directory (jrun/servers/lib) for it to work.

That is why it is in a different directory.

Regards,
Paul
-
Paul Hodgetts -- President, Principal Consultant
Agile Logic -- www.agilelogic.com
Consulting, Coaching, Training -- On-Site  Out-Sourced Development
Java, J2EE, C++, OOA/D -- Agile Methods/XP/Scrum, Use Cases, UI/IA


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



disable enter key

2002-12-27 Thread pqin
Dumb question. Is it able to disable Enter key without using JavaScript on
any struts-powered page?
 
Regards,
 
 
 
Phillip Qin
 
This Guy Thinks He Knows Everything
 



  1   2   >