RE: redirect=true and Tiles; does it work?

2004-03-24 Thread David Friedman
Atta,

A redirect in a tile cannot possibly work (and I've tried  researched it
months ago).  To use a redirect in a forward, you must have a file system
object to reach such as an html file, a jsp, or an application mapping (i.e.
struts *.do).  Since a tile is only internal to Struts, and not an external
item, your tile cannot work as the server and file system would not have a
.mytileDefinition mapped to anything concrete.

That said, you can make a JSP pull in and show a tile so your redirect can
be to showtile.jsp with contents such as the below 2 lines:
%@ taglib uri=http://jakarta.apache.org/struts/tags-tiles; prefix=tiles
%
tiles:insert beanName=someDefinition flush=true /

I might be off with one or two parameters of the tiles:insert because I
haven't needed to do that in a long time.

I just read your note about velocity tiles but since I haven't used them, I
can't answer that.  I suppose if you had a servlet mapping for *.vm files
you could redirect to your someDefinition.vm and it would work as that is an
application mapping, as I mentioned above (2nd sentence).

Regards,
David

-Original Message-
From: atta-ur rehman [mailto:[EMAIL PROTECTED]
Sent: Wednesday, March 24, 2004 5:12 PM
To: Struts Users Mailing List
Subject: Re: redirect=true and Tiles; does it work?


Any takers?

ATTA

- Original Message -
From: atta-ur rehman [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]
Sent: Wednesday, March 24, 2004 10:17 AM
Subject: redirect=true and Tiles; does it work?


 Dear all,

 I've been struggling with this problem for about two days now; I hope
 somebody here would be able to help me. In one of my actions I've
 implemented Struts token functionality to keep user from using browser
 Refresh button. Every thing works as promised except for when invalid
token
 message is shown and you press the Refresh button, browser pops up a
message
 saying that there is POSTDATA in the request do you want to sumbit;
clicking
 yes again calls the source action and user again ends up the invalid token
 message.

 now my question is how can I get rid of this post data and browser's
 confirmation message? I thought setting rediect=true to forward should
to
 the trick; but it doesn't! Last night while going thru the archives, I
 figured that this does work when you forward to /someAction.do or
 /somePage.jsp but doesn't work for Tiles definitions!!!

 Any help would be greatly appreciated.

 here are my global forward and action mappings in the struts config file:

 global-forwards
 forward name=invalidToken path=showInvalidTokenMessage.do
 redirect=true /
 /global-forwards

 action path=test class=test.TokenedAction name=testForm
 forward name=success path=greetingsTile redirect=true /
 /action

 Its from within the test.TokenAction that I forward to global forward
 invalidToken.

 Again, thanks in anticipation for any help.

 ATTA



 -
 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: SSLEXT

2004-03-17 Thread David Friedman
Did you properly set the PlugIn and RequestProcessor in your
struts-config.xml file?  I point this out because I remember a similar
message when I first started using Struts  Tiles which was caused by not
specifying the TilesRequestProcessor (in my case).

From the Front page of sslext.sourceforge.net:
 SecureTilesPlugin
 (org.apache.struts.tiles.SecureTilesPlugIn)
 and the SecureTilesRequestProcessor
 (org.apache.struts.action.SecureTilesRequestProcessor).

Regards,
David

-Original Message-
From: Robert Taylor [mailto:[EMAIL PROTECTED]
Sent: Wednesday, March 17, 2004 12:09 PM
To: Struts Users Mailing List
Subject: RE: SSLEXT


Hmmm. Okay, then try using your original action mapping def:

action path=/initial
type=org.apache.struts.actions.ForwardAction
parameter=tiles.initial
set-property property=secure value=false/
 /action

robert

 -Original Message-
 From: Joao Batistella [mailto:[EMAIL PROTECTED]
 Sent: Wednesday, March 17, 2004 11:51 AM
 To: 'Struts Users Mailing List'
 Subject: RE: SSLEXT


 Thanks again.

 But now I have this error message:
 java.lang.IllegalArgumentException: Path tiles.initial does not start with
a
 / character
 This is because the following action:
 action path=/initial forward=tiles.initial
   set-property property=secure value=false/
 /action

 Any idea?

 Thanks!

 -Original Message-
 From: Robert Taylor [mailto:[EMAIL PROTECTED]
 Sent: quarta-feira, 17 de março de 2004 16:35
 To: Struts Users Mailing List
 Subject: RE: SSLEXT


 The following should work without changing any code in your LoginAction:

 action path=/login
 type=mypackage.LoginAction
 name=formLogin
 scope=request
 input=/login.jsp
 set-property property=secure value=true/
  /action

  My forward:
  global-forwards
   forward name=initial  path=/prefix/initial/
  /global-forwards

  My LoginAction after a sucessful login:
  return mapping.findForward(initial);

  Now I have this action to forward to the tiles definition:
  action path=/initial forward=tiles.initial
   set-property property=secure value=false/
  /action

 Note that prefix is what ever prefix you are using to invoke the
 Struts ActionServlet.

 robert

  -Original Message-
  From: Joao Batistella [mailto:[EMAIL PROTECTED]
  Sent: Wednesday, March 17, 2004 11:19 AM
  To: 'Struts Users Mailing List'
  Subject: RE: SSLEXT
 
 
  Thanks for your help.
  Let me just check.
  You mean, in LoginAction intead of forwarding to my tiles definition,
  forward to another action? Or call another action?
 
  My struts-config.xml is this:
 
  Login action:
  action path=/login
type=mypackage.LoginAction
name=formLogin
scope=request
input=/login.jsp
set-property property=secure value=true/
  /action
 
  My forward:
  global-forwards
  forward name=initial  path=tiles.initial/
  /global-forwards
 
  My LoginAction after a sucessful login:
  return mapping.findForward(initial);
 
  Now I have this action to forward to the tiles definition:
  action path=/initial
  type=org.apache.struts.actions.ForwardAction
  parameter=tiles.inicial
  set-property property=secure value=false/
  /action
 
  What should I put in LoginAction in order to go to a non secure main
page?
  Can I call another action?
 
  -Original Message-
  From: Robert Taylor [mailto:[EMAIL PROTECTED]
  Sent: quarta-feira, 17 de março de 2004 15:52
  To: Struts Users Mailing List
  Subject: RE: SSLEXT
 
 
  Yes. Instead of forwarding directly to the Tile, define an action which
  simply forwards (or redirects) to that main page (tile) and
  in that action mapping configuration define it to be secure using the
  set-property element.
 
  robert
 
   -Original Message-
   From: Joao Batistella [mailto:[EMAIL PROTECTED]
   Sent: Wednesday, March 17, 2004 10:39 AM
   To: 'Struts Users Mailing List'
   Subject: RE: SSLEXT
  
  
   Ok, but the main page is still in HTTPS.
  
   Let me try to explain the flow:
  
   1. User enter with username and password
   2. User submit the form to an HTTPS address
   3. A LoginAction try to authenticate the user with the data
transmitted
   (username and password) with HTTPS protocol
   4. LoginAction forward the user to the main page. -- Here I want the
 user
   being forward to an HTTP address. There is no action defined after
   LoginAtion. LoginAction must be secure so the username and password
are
   trasmitted in a secure way. But after that, no more HTTPS is
necessary.
  
   Is there way in step 4 to forward the user to a non secure page?
  
   Thanks,
   JP
  
   -Original Message-
   From: Robert Taylor [mailto:[EMAIL PROTECTED]
   Sent: quarta-feira, 17 de março de 2004 15:29
   To: Struts Users Mailing List
   Subject: RE: SSLEXT
  
  
   Okay. Then you should be able to place the following in your
 struts-config
   action mapping for the main page.
  
   

RE: security framework!!!

2004-03-17 Thread David Friedman
Andy,

My personal project will have 5 distinct levels (a business of my own,
someday).  The lowest level has individual powers, nothing shared.  It makes
that particular level analogous to a shopping cart user: his/her 'stuff'
only.  The groups/levels are in order from highest ability to lowest (the
individual user).  They can only become or manipulate the level below them
directly, unless they assume the identity of an account they manage to
review/fix/look into something.  The descriptions of the levels follow:

Senior Group level administrators.  For all intent and purposes, that is
me and my team.  We can add/edit/remove/become/lock-down any reseller
account (only upon request, of course).

Junior Group level - reseller company.  A reseller company has a group of
accounts (one or more) who can add/edit/remove/become/lock-down any of their
own customer accounts (hopefully only upon request).

Sophomore Group level - customer company.  A customer company is a
business sold to by a reseller.  This group can add
add/edit/remove/become/lock-down any of their own clients (again,
hopefully only upon request).

Freshman Group level - client.  A client is a corporate entity receiving
services from their particular vendor, an above-mentioned customer
company.  This group of accounts can add/edit/remove their own list of
employees (i.e. end users).  They have some features specific to them as
well as being able to enter information similar to their individual
employees.

(Lowest) User level - employee.  An employee is an individual account
under a corporate entity (in a client).  They have individual duties and
can enter data.  Some of their activities may end up going to a manager (at
the client level) for approval, depending on the activity.  Essentially,
all of the work they do can be seen by no one else (though a manager might
need to approve certain types of request).

Regards,
David

-Original Message-
From: Adam Hardy [mailto:[EMAIL PROTECTED]
Sent: Monday, March 15, 2004 10:28 AM
To: Struts Users Mailing List
Subject: Re: security framework!!!


On 03/15/2004 03:00 PM David Friedman wrote:
 I should have explained this a bit better.  Each level is like a company
or
 organization.  It has it's own group of parties to maintain but can be
 managed by one or more managers.  The managers share group responsibility.
 Only the user at the very bottom rung has an interface which only that
user
 can use.

What do you mean by that last sentence? Why can't a manager use that
interface too? Surely it depends on roles?

 Everyone above it is some sort of manager for maintaining there
 shared group (separate from other resellers, or separate from other).

 admin--- reseller1 (admin1, admin2, admin3) -- customer1
   customer2
   customer3
  reseller2 (admin4) - customer4
   customer5
  reseller3 (admin5, admin6) - customer6
  reseller7 (admin7, admin8, admin9) - customer7
   customer8

 In the above tree, the customer(s) have a group of their own admins plus
 individual employees (who have no shared responsibilities).

 I know this sounds like I should use pow2acl but it doesn't seem to have
 anything for replacing the Principal so I could become a user, nor does it
 appear to have anything to let me hook SSLext into it to ensure good
 http/https lock-downs.

 Do you have any hints/suggestions for a better methodology/way?

 Regards,
 David

 -Original Message-
 From: Adam Hardy [mailto:[EMAIL PROTECTED]
 Sent: Monday, March 15, 2004 4:25 AM
 To: Struts Users Mailing List
 Subject: Re: security framework!!!


 Right, I get it. So you not only want the higher level user to take on
 the lower level user's role, you want them to have their complete ID or
 username etc.

 Tricky!

 I think alot depends on what kind of use you have for the user info. Is
 it purely roles that are important here? Or is there ownership too? I
 mean, one user can see his / her stuff, which is not accessible to
 another user of equal level?

 On 03/15/2004 03:39 AM David Friedman wrote:

Jason,

They might need to go into the account underneath them to fix something

 (if

they are asked) and won't know the password (encrypted).  The admin might
need to fix something for a reseller's client made us look into (admin -
reseller - client - manager - employee).  I've had a few projects where
someone 2 levels under asks for help from the level immediately above

 them.

Then it goes up one and up again back to me.  Rather than make interfaces
for everyone for everything, I prefer the idea of su'ing into the

 account

to fix something.  So, I might have to 'become' the reseller (I'm the
admin), then become a client, then become a manager then become an

 employee

to look at or fix something for them.

Regards,
David

-Original Message-
From

RE: security framework!!!

2004-03-17 Thread David Friedman
Adam,

With my structure, I might have to become a particular reseller, then flip
into a customer of his/hers, then become one of their client accounts to
look into a reported problem.  I worry about login identities for the
following reasons:

Using a JAAS login, my principal would be fixed (set in stone) for my
session.  Then, I couldn't be able to use the 'roles' settings inside
Struts, Tiles, and JSPs to control content.

Without using a JAAS login, I also become unable to use 'roles' in Tiles and
JSPs to control content.

Without having any theories on how to successfully (and without much
alteration to the package[s]) use roles for Struts, Tiles, and JSPs, I'm at
a loss how to change my identity/roles

If I made a filter to wrapper the Request with a HTTPServletRequestWrapper
object then added my own push/pop/depth methods, I see how I could use roles
in all of those places.

Knowing all of the above gory details, do you (or anyone) have any
suggestions on how to make things cleaner while using roles in all of those
places with the various levels of control I need to exert (albeit probably
rarely switching roles) ?

Thanks (to all) for any constructive suggestions,
David

-Original Message-
From: Adam Hardy [mailto:[EMAIL PROTECTED]
Sent: Wednesday, March 17, 2004 6:51 PM
To: Struts Users Mailing List
Subject: Re: security framework!!!


I don't see your requirement for replacing the principal when the admin
wants to 'become' someone else. What are you envisaging that such a
technique would bring? How are you planning for the administrator to get
his/her original user back?

I'm pretty confident you can accomplish this through the judicious use
of roles. OK, you'll need quite a few admittedly.

Unless I've missed a point somewhere.

On 03/17/2004 11:54 PM David Friedman wrote:
 Andy,

 My personal project will have 5 distinct levels (a business of my
 own, someday).  The lowest level has individual powers, nothing
 shared.  It makes that particular level analogous to a shopping cart
 user: his/her 'stuff' only.  The groups/levels are in order from
 highest ability to lowest (the individual user).  They can only
 become or manipulate the level below them directly, unless they
 assume the identity of an account they manage to review/fix/look into
  something.  The descriptions of the levels follow:

 Senior Group level administrators.  For all intent and purposes,
 that is me and my team.  We can add/edit/remove/become/lock-down any
 reseller account (only upon request, of course).

 Junior Group level - reseller company.  A reseller company has a
 group of accounts (one or more) who can
 add/edit/remove/become/lock-down any of their own customer accounts
 (hopefully only upon request).

 Sophomore Group level - customer company.  A customer company is a
  business sold to by a reseller.  This group can add
 add/edit/remove/become/lock-down any of their own clients (again,
 hopefully only upon request).

 Freshman Group level - client.  A client is a corporate entity
 receiving services from their particular vendor, an above-mentioned
 customer company.  This group of accounts can add/edit/remove their
  own list of employees (i.e. end users).  They have some features
 specific to them as well as being able to enter information similar
 to their individual employees.

 (Lowest) User level - employee.  An employee is an individual
 account under a corporate entity (in a client).  They have
 individual duties and can enter data.  Some of their activities may
 end up going to a manager (at the client level) for approval,
 depending on the activity.  Essentially, all of the work they do can
 be seen by no one else (though a manager might need to approve
 certain types of request).

 Regards, David

 -Original Message- From: Adam Hardy
 [mailto:[EMAIL PROTECTED] Sent: Monday, March 15,
 2004 10:28 AM To: Struts Users Mailing List Subject: Re: security
 framework!!!


 On 03/15/2004 03:00 PM David Friedman wrote:

 I should have explained this a bit better.  Each level is like a
 company or organization.  It has it's own group of parties to
 maintain but can be managed by one or more managers.  The managers
  share group responsibility. Only the user at the very bottom rung
  has an interface which only that user can use.


 What do you mean by that last sentence? Why can't a manager use that
  interface too? Surely it depends on roles?

 Everyone above it is some sort of manager for maintaining there
 shared group (separate from other resellers, or separate from
 other).

 admin--- reseller1 (admin1, admin2, admin3) -- customer1 customer2
  customer3 reseller2 (admin4) - customer4 customer5 reseller3
 (admin5, admin6) - customer6 reseller7 (admin7, admin8, admin9) -
 customer7 customer8

 In the above tree, the customer(s) have a group of their own admins
  plus individual employees (who have no shared responsibilities).

 I know this sounds like I should use pow2acl but it doesn't seem

RE: Using tiles

2004-03-16 Thread David Friedman
Dear Laurie,

You forgot to set a page in your tile definition with the path attribute.
The definition needs to be more like so:

definition name=tiles.view path=/tiles-test/template.jsp
   put name=title value=PAGE TITLE/
   put name=content value=/tiles-test/index.jsp/
/definition

Where /tiles-test/template.jsp could look like:

%@ taglib uri=/tags/struts-tiles prefix=tiles %
html
head
title
!-- insert the title attribute from your definition as a string --
tiles:getAsString name=title /
/title
/head
body
!-- insert the content attribute from your definition as a parsed JSP
page --
tiles:insert attribute=content
/body
/html

Regards,
David

-Original Message-
From: news [mailto:[EMAIL PROTECTED] Behalf Of Laurie Harper
Sent: Monday, March 15, 2004 7:31 PM
To: [EMAIL PROTECTED]
Subject: Using tiles


This is a newbie question on using the Tiles with Struts (never tried it
before). I followed the instructions in the first half of Tiles 101/201,
linked from the Tiles documentation but am having no luck on the
Struts/Tiles integration front. I suspect I've simply missed a step
somewhere.

Here's what I've done:

* Ensured Tiles is enabled in struts-conf.xml (it was by default):
   plug-in className=org.apache.struts.tiles.TilesPlugin 
 set-property property=definitions-config
  value=/WEB-INF/conf/tiles-defs.xml /
 set-property property=moduleAware value=true /
 set-property property=definitions-parser-validate value=true /
   /plug-in

* added a tile definition to teils-defs.xml:
 definition name=tiles.view
 put name=title value=PAGE TITLE/
 put name=content value=/tiles-test/index.jsp/
 /definition
* added an action mapping to struts-conf.xml pointing to the tile:
 action path=/tiles
 type=DummyTilesAction
 forward name=view path=tiles.view/
 /action

* created /tiles-test/index.jsp with some static text content

What I expected was that when I hit /tiles.do I'd get back the static
content from /tiles-test/index.jsp. What I actually get back is the
string 'htmlbody/body/html', which I haven't defined anywhere.

I also tried implementing execute() in DummyTilesAction to do a 'return
mappings.findForward(view);' but no luck. Changing the name of the
view in struts-conf.xml or tiles-defs.xml makes no difference, and
generates no error messages when they don't match, which makes me
suspicious...

The tiles defs do seem to be read in on startup:

L4J 2004-03-15 19:22:47,801 DEBUG
org.apache.struts.tiles.xmlDefinition.I18nFactorySet default
factory:{tiles.layout.basic={name=tiles.layout.basic,
path=/tiles.layout.basic.jsp, role=null, controller=null,
controllerType=null, controllerInstance=null, attributes={title=DEFAULT
TITLE, content=/tiles.content.default.jsp,
menu=/tiles.layout.basic.menu.jsp}}
, tiles.view={name=tiles.view, path=null, role=null, controller=null,
controllerType=null, controllerInstance=null, attributes={title=PAGE
TITLE, content=/tiles-test/index.jsp}}
}
L4J 2004-03-15 19:22:48,065 DEBUG
org.apache.struts.tiles.xmlDefinition.I18nFactorySet Factory initialized
from file '/WEB-INF/conf/tiles-defs.xml'.
L4J 2004-03-15 19:22:48,065 INFO  org.apache.struts.tiles.TilesPlugin
Tiles definition factory loaded for module ''.

and the action mapping was picked up correctly; when I hit /tiles.do I
get this logged:

L4J 2004-03-15 19:25:49,791 DEBUG
org.apache.struts.action.RequestProcessor  Looking for Action instance
for class DummyTilesAction

But no Tiles related logging, and the page specified in the tile
definition isn't loaded. The taglib documentation at
http://jakarta.apache.org/struts/userGuide/struts-tiles.html says that I
have to call initComponentDefinitions or otherwise arrange to have Tiles
initialized. I thought the configuration in struts-conf.xml would make
that happen, but tried calling the tag in case. That didn't seem to help.

What am I doing wrong? If I've left any information out, please ask and
I'll post it.

Thanks,

L.



-
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: security framework!!!

2004-03-15 Thread David Friedman
Adam,

I should have explained this a bit better.  Each level is like a company or
organization.  It has it's own group of parties to maintain but can be
managed by one or more managers.  The managers share group responsibility.
Only the user at the very bottom rung has an interface which only that user
can use.  Everyone above it is some sort of manager for maintaining there
shared group (separate from other resellers, or separate from other).

admin--- reseller1 (admin1, admin2, admin3) -- customer1
  customer2
  customer3
 reseller2 (admin4) - customer4
  customer5
 reseller3 (admin5, admin6) - customer6
 reseller7 (admin7, admin8, admin9) - customer7
  customer8

In the above tree, the customer(s) have a group of their own admins plus
individual employees (who have no shared responsibilities).

I know this sounds like I should use pow2acl but it doesn't seem to have
anything for replacing the Principal so I could become a user, nor does it
appear to have anything to let me hook SSLext into it to ensure good
http/https lock-downs.

Do you have any hints/suggestions for a better methodology/way?

Regards,
David

-Original Message-
From: Adam Hardy [mailto:[EMAIL PROTECTED]
Sent: Monday, March 15, 2004 4:25 AM
To: Struts Users Mailing List
Subject: Re: security framework!!!


Right, I get it. So you not only want the higher level user to take on
the lower level user's role, you want them to have their complete ID or
username etc.

Tricky!

I think alot depends on what kind of use you have for the user info. Is
it purely roles that are important here? Or is there ownership too? I
mean, one user can see his / her stuff, which is not accessible to
another user of equal level?

On 03/15/2004 03:39 AM David Friedman wrote:
 Jason,

 They might need to go into the account underneath them to fix something
(if
 they are asked) and won't know the password (encrypted).  The admin might
 need to fix something for a reseller's client made us look into (admin -
 reseller - client - manager - employee).  I've had a few projects where
 someone 2 levels under asks for help from the level immediately above
them.
 Then it goes up one and up again back to me.  Rather than make interfaces
 for everyone for everything, I prefer the idea of su'ing into the
account
 to fix something.  So, I might have to 'become' the reseller (I'm the
 admin), then become a client, then become a manager then become an
employee
 to look at or fix something for them.

 Regards,
 David

 -Original Message-
 From: Jason Lea [mailto:[EMAIL PROTECTED]
 Sent: Sunday, March 14, 2004 6:49 PM
 To: Struts Users Mailing List
 Subject: Re: security framework!!!


 David Friedman wrote:


I've also been looking into security frameworks and the only solutions
I've
really found are:

1. Standard (container) JAAS
2. SecurityFilter http://securityfilter.sourceforge.net
3. Pow2ACL http://pow2acl.sourceforge.net/

I was hoping, at some point, to use an SSL switching feature such as

 SSLext.

From my research, Pow2ACL and SecurityFilter won't work that way.
SecurityFilter has a note that certain 'elements' could be used for it but
the current code makes no use of them in that manner.  As for Pow2ACL, I
didn't find anything suggesting how to use it in that way either.

My bigger problem is my scenario, which no one supports.  I'd like to
allow
manager accounts to become one of if it's sub-accounts.  My system would
support at least 5 levels where 4 could 'drill down' and back up again:
admin, reseller, client, manager, employee (bottom feeder, no managerial
tools and no popping into their accounts).  Since there is no easily way
to



 Trying to figure out what you are asking here can you give an example?

 If you have the following:
 1. User Manfred is a manager
 2. User Emily is an Employee
 3. Emily is an employee under Manfred

 Are you saying that Manfred can become Emily and perform certain
 tasks/actions?  Then Manfred would return to be Manfred the manager?


push/pop or even set (then I could use my own internal stack) a
UserPrincipal object, I'm thinking of using something a bit like
SecurityFilter: wrap the request object with a subclass of
HttpServeletRequestWrapper and add my own push/pop/set/get/count
UserPrincipal object(s).  Then, I could hook the login procedure with
container methods (JAAS, i.e. a web browser login/password pop-up) and

 still

be able to (when I'm ready) use SSLext or something like it for the
HTTP/HTTPS switching.

Regards,
David

-Original Message-
From: Mailing List [mailto:[EMAIL PROTECTED]
Sent: Saturday, March 13, 2004 6:19 AM
To: [EMAIL PROTECTED]
Subject: security framework!!!


I'm developing a web application with struts.I had a problem for support
security at jsp pages level for different roles.I send an email

RE: security framework!!!

2004-03-14 Thread David Friedman
Adam,

I want to integrate everything with roles (for using actions and jsp tags)
so I'm stuck, after container authentication, having a non-changeable
Principal object within Tomcat: their Coyote HttpServletRequest wrapping
class prevents the use of setUserPrincipal.  All of my research on Tomcat (4
or 5) suggests a filter-based wrapper for the HttpServletRequest object is
the only way to go to be able to set the UserPrincipal from within my action
so I could replace the Principal (as the admin becomes the reseller becomes
the customer becomes the manager becomes the user account, etc. and possibly
backs out each level one by one).

Can you suggest any other avenues or theories for me to investigate since my
research has resulted in only that one workable solution?  Hints
appreciated. :)

Regards,
David

-Original Message-
From: Adam Hardy [mailto:[EMAIL PROTECTED]
Sent: Sunday, March 14, 2004 5:21 AM
To: Struts Users Mailing List
Subject: Re: security framework!!!


On 03/13/2004 05:48 PM David Friedman wrote:
 My bigger problem is my scenario, which no one supports.  I'd like to
allow
 manager accounts to become one of if it's sub-accounts.  My system would
 support at least 5 levels where 4 could 'drill down' and back up again:
 admin, reseller, client, manager, employee (bottom feeder, no managerial
 tools and no popping into their accounts).  Since there is no easily way
to
 push/pop or even set (then I could use my own internal stack) a
 UserPrincipal object, I'm thinking of using something a bit like
 SecurityFilter:

I'm not sure why the standard container-managed security roles don't
meet your requirements.

You want a manager to be able to set himself to another role? Sounds
like a design issue. Obviously the manager is also going to need to set
himself back to his normal role again?

I would use extra roles to allow changing roles. The manager can assign
himself whatever standard role he likes depending on his 'extra' roles.
This would change the info in your realm and he would have to log out
and back in again.

Or have I got the wrong end of the stick?

Adam
--
struts 1.1 + tomcat 5.0.16 + java 1.4.2
Linux 2.4.20 Debian


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


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



RE: security framework!!!

2004-03-14 Thread David Friedman
Adam,

They might need to go into the account underneath them to fix something (if
they are asked) and won't know the password (encrypted).  The admin might
need to fix something for a reseller's client made us look into (admin -
reseller - client - manager - employee).

Regards,
David

-Original Message-
From: Adam Hardy [mailto:[EMAIL PROTECTED]
Sent: Sunday, March 14, 2004 6:28 PM
To: Struts Users Mailing List
Subject: Re: security framework!!!


You mean you don't want to force the user to log out and back in again?
I would have thought that was a reasonable demand since they are
effectively changing their identity.

Your HttpServletRequest wrapper sounds OK as a solution though.

Adam

On 03/14/2004 03:51 PM David Friedman wrote:
 Adam,

 I want to integrate everything with roles (for using actions and jsp tags)
 so I'm stuck, after container authentication, having a non-changeable
 Principal object within Tomcat: their Coyote HttpServletRequest wrapping
 class prevents the use of setUserPrincipal.  All of my research on Tomcat
(4
 or 5) suggests a filter-based wrapper for the HttpServletRequest object is
 the only way to go to be able to set the UserPrincipal from within my
action
 so I could replace the Principal (as the admin becomes the reseller
becomes
 the customer becomes the manager becomes the user account, etc. and
possibly
 backs out each level one by one).

 Can you suggest any other avenues or theories for me to investigate since
my
 research has resulted in only that one workable solution?  Hints
 appreciated. :)

 Regards,
 David

 -Original Message-
 From: Adam Hardy [mailto:[EMAIL PROTECTED]
 Sent: Sunday, March 14, 2004 5:21 AM
 To: Struts Users Mailing List
 Subject: Re: security framework!!!


 On 03/13/2004 05:48 PM David Friedman wrote:

My bigger problem is my scenario, which no one supports.  I'd like to

 allow

manager accounts to become one of if it's sub-accounts.  My system would
support at least 5 levels where 4 could 'drill down' and back up again:
admin, reseller, client, manager, employee (bottom feeder, no managerial
tools and no popping into their accounts).  Since there is no easily way

 to

push/pop or even set (then I could use my own internal stack) a
UserPrincipal object, I'm thinking of using something a bit like
SecurityFilter:


 I'm not sure why the standard container-managed security roles don't
 meet your requirements.

 You want a manager to be able to set himself to another role? Sounds
 like a design issue. Obviously the manager is also going to need to set
 himself back to his normal role again?

 I would use extra roles to allow changing roles. The manager can assign
 himself whatever standard role he likes depending on his 'extra' roles.
 This would change the info in your realm and he would have to log out
 and back in again.

 Or have I got the wrong end of the stick?

 Adam
 --
 struts 1.1 + tomcat 5.0.16 + java 1.4.2
 Linux 2.4.20 Debian


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


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




--
struts 1.1 + tomcat 5.0.16 + java 1.4.2
Linux 2.4.20 Debian


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


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



RE: security framework!!!

2004-03-14 Thread David Friedman
Jason,

They might need to go into the account underneath them to fix something (if
they are asked) and won't know the password (encrypted).  The admin might
need to fix something for a reseller's client made us look into (admin -
reseller - client - manager - employee).  I've had a few projects where
someone 2 levels under asks for help from the level immediately above them.
Then it goes up one and up again back to me.  Rather than make interfaces
for everyone for everything, I prefer the idea of su'ing into the account
to fix something.  So, I might have to 'become' the reseller (I'm the
admin), then become a client, then become a manager then become an employee
to look at or fix something for them.

Regards,
David

-Original Message-
From: Jason Lea [mailto:[EMAIL PROTECTED]
Sent: Sunday, March 14, 2004 6:49 PM
To: Struts Users Mailing List
Subject: Re: security framework!!!


David Friedman wrote:

I've also been looking into security frameworks and the only solutions I've
really found are:

1. Standard (container) JAAS
2. SecurityFilter http://securityfilter.sourceforge.net
3. Pow2ACL http://pow2acl.sourceforge.net/

I was hoping, at some point, to use an SSL switching feature such as
SSLext.
From my research, Pow2ACL and SecurityFilter won't work that way.
SecurityFilter has a note that certain 'elements' could be used for it but
the current code makes no use of them in that manner.  As for Pow2ACL, I
didn't find anything suggesting how to use it in that way either.

My bigger problem is my scenario, which no one supports.  I'd like to allow
manager accounts to become one of if it's sub-accounts.  My system would
support at least 5 levels where 4 could 'drill down' and back up again:
admin, reseller, client, manager, employee (bottom feeder, no managerial
tools and no popping into their accounts).  Since there is no easily way to


Trying to figure out what you are asking here can you give an example?

If you have the following:
1. User Manfred is a manager
2. User Emily is an Employee
3. Emily is an employee under Manfred

Are you saying that Manfred can become Emily and perform certain
tasks/actions?  Then Manfred would return to be Manfred the manager?

push/pop or even set (then I could use my own internal stack) a
UserPrincipal object, I'm thinking of using something a bit like
SecurityFilter: wrap the request object with a subclass of
HttpServeletRequestWrapper and add my own push/pop/set/get/count
UserPrincipal object(s).  Then, I could hook the login procedure with
container methods (JAAS, i.e. a web browser login/password pop-up) and
still
be able to (when I'm ready) use SSLext or something like it for the
HTTP/HTTPS switching.

Regards,
David

-Original Message-
From: Mailing List [mailto:[EMAIL PROTECTED]
Sent: Saturday, March 13, 2004 6:19 AM
To: [EMAIL PROTECTED]
Subject: security framework!!!


I'm developing a web application with struts.I had a problem for support
security at jsp pages level for different roles.I send an email and recived
2 response to solve my problem:
1. with HTML tags.
2. 2.with define role in tiles definition
but I'm searching for a good framework that be compatibled with struts
framework and support the security for different roles at page levels.
I mean for example if I have a jsp page with tow textfields and a submit
deponds on user's role at the system,one user just can see one of the
textfield and submit buttom and another user can see both of the textfield
and submit buttom.
Can you suggest a good framework for me.
regards


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






--
Jason Lea



-
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: security framework!!!

2004-03-13 Thread David Friedman
I've also been looking into security frameworks and the only solutions I've
really found are:

1. Standard (container) JAAS
2. SecurityFilter http://securityfilter.sourceforge.net
3. Pow2ACL http://pow2acl.sourceforge.net/

I was hoping, at some point, to use an SSL switching feature such as SSLext.
From my research, Pow2ACL and SecurityFilter won't work that way.
SecurityFilter has a note that certain 'elements' could be used for it but
the current code makes no use of them in that manner.  As for Pow2ACL, I
didn't find anything suggesting how to use it in that way either.

My bigger problem is my scenario, which no one supports.  I'd like to allow
manager accounts to become one of if it's sub-accounts.  My system would
support at least 5 levels where 4 could 'drill down' and back up again:
admin, reseller, client, manager, employee (bottom feeder, no managerial
tools and no popping into their accounts).  Since there is no easily way to
push/pop or even set (then I could use my own internal stack) a
UserPrincipal object, I'm thinking of using something a bit like
SecurityFilter: wrap the request object with a subclass of
HttpServeletRequestWrapper and add my own push/pop/set/get/count
UserPrincipal object(s).  Then, I could hook the login procedure with
container methods (JAAS, i.e. a web browser login/password pop-up) and still
be able to (when I'm ready) use SSLext or something like it for the
HTTP/HTTPS switching.

Regards,
David

-Original Message-
From: Mailing List [mailto:[EMAIL PROTECTED]
Sent: Saturday, March 13, 2004 6:19 AM
To: [EMAIL PROTECTED]
Subject: security framework!!!


I'm developing a web application with struts.I had a problem for support
security at jsp pages level for different roles.I send an email and recived
2 response to solve my problem:
1.  with HTML tags.
2.  2.with define role in tiles definition
but I'm searching for a good framework that be compatibled with struts
framework and support the security for different roles at page levels.
I mean for example if I have a jsp page with tow textfields and a submit
deponds on user's role at the system,one user just can see one of the
textfield and submit buttom and another user can see both of the textfield
and submit buttom.
Can you suggest a good framework for me.
regards


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



RE: Calling a tiles attribute from another attribute

2004-03-10 Thread David Friedman
Kunal,

This is becoming a common question.  According to your definition, the
page_title is really only available in the
/WEB-INF/jsp/layouts/default.jsp file.  Check out the topic/thread:

http://www.mail-archive.com/[EMAIL PROTECTED]/msg61368.html

Essentially, you need to do a tiles:insert with a nested tiles:put in your
/WEB-INF/jsp/layouts/default.jsp to pass the page_title to the other JSP
which is a sub-tile (or something like that).  I asked the same question
ages ago, tested the solution to see it work, but never used the solution in
production. Go figure! :(

Regards,
David

-Original Message-
From: Kunal H. Parikh [mailto:[EMAIL PROTECTED]
Sent: Wednesday, March 10, 2004 7:20 PM
To: 'Struts Users Mailing List'
Subject: Calling a tiles attribute from another attribute


Hi All!

I am attempting to call a tiles:getAsString from a JSP page which is an
attribute in the tiles definition.

Example:
===
definition name=au.com.carsales.csApp.layouts.default
path=/WEB-INF/jsp/layouts/default.jsp
put name=page_title value=My Page Title /
put name=html_head value=/WEB-INF/jsp/html_head.jsp /
put name=header value=/WEB-INF/jsp/header.jsp /
put name=left_content value=/WEB-INF/jsp/left_content.jsp /
put name=main_content value= /
put name=footer value=/WEB-INF/jsp/footer.jsp /
/definition

And, in /WEB-INF/jsp/html_head.jsp I have,
title tiles:getAsString name=page_title / /title
===

However, I am getting the following error:
===
[ServletException in:/WEB-INF/jsp/html_head.jsp] Error - tag.getAsString :
attribute 'page_title' not found in context. Check tag syntax'
javax.servlet.jsp.JspException: Error - tag.getAsString : attribute
'page_title' not found in context. Check tag syntax at
org.apache.struts.taglib.tiles.GetAttributeTag.doEndTag(GetAttributeTag.java
:204)
===

By the looks of it, I believe that I cannot do this?

Is there an alternative available? Or am I doing something incorrectly ?


Cheers and TIA,

Kunal



-
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: help me with using bean

2004-03-10 Thread David Friedman
Mike,

When you use form-property with a form-bean, don't you need to make the main
Bean a DynaActionForm or a class you extended from DynaActionForm?  Where do
you initialize the form-property bean.  For DynaActionForms, they
initialize to null, per If you do not supply an initial attribute, numbers
will be initialized to 0 and objects to null from the document:
http://jakarta.apache.org/struts/userGuide/building_controller.html#dyna_act
ion_form_classes

Regards,
David

-Original Message-
From: Mu Mike [mailto:[EMAIL PROTECTED]
Sent: Wednesday, March 10, 2004 8:31 PM
To: [EMAIL PROTECTED]
Subject: help me with using bean


I have files like the below,I m  trying to submit a bean object to my
action class, yet when I pressed the submit on the jsp file,it threw an
exception:java.lang.IllegalArgumentException: No bean specified

what is the correct way?
ThanksRegards


myjsp.jsp

html:form action=/selectFont.do 
tr
td
  html:text property=bean.size value=10/
/td
td
  html:text property=bean.fontName value=aria/
/td
/tr
input type=submit/
/html:form

=
part of struts-config.xml

form-beans
form-bean name=SelectFontForm
type=com.viador.rv.form.SelectFontForm
form-property name=bean
   type=com.viador.rv.bean.FontBean/
/form-bean
 /form-beans

action-mappings
action path=/selectFont
type=com.viador.rv.action.ApplyFormatAction
name=SelectFontForm
scope=session
/action
   /action-mappings

===
SelectFontForm.java

import org.apache.struts.action.ActionForm;
import com.viador.rv.bean.FontBean;

public class SelectFontForm extends ActionForm{
public FontBean getBean() {
return bean;
}

public void setBean(FontBean bean) {
this.bean = bean;
}

private FontBean bean;
}

==
FontBean.java

public class FontBean  {
public int getSize() {
return size;
}

public void setSize(int size) {
this.size = size;
}

public String getFontName() {
return fontName;
}

public void setFontName(String fontName) {
this.fontName = fontName;
}

private int size;
private String fontName;

}

_
 MSN Hotmail  http://www.hotmail.com


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


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



RE: help me with using bean

2004-03-10 Thread David Friedman
Mike,

Why not change your:

public class SelectFontForm extends ActionForm{
 public FontBean getBean() {
 return bean;
 }

to:

public class SelectFontForm extends ActionForm{
 public FontBean getBean() {
   // create a bean to give them IF the 'bean' is ever NULL!
   if ( bean == null )
bean = new FontBean();
 return bean;
 }

Regards,
David

-Original Message-
From: Mu Mike [mailto:[EMAIL PROTECTED]
Sent: Wednesday, March 10, 2004 9:16 PM
To: [EMAIL PROTECTED]
Subject: RE: help me with using bean


David,
Thank you, I m a newbie to struts, in  fact ,I dont know exactly what kind
of form should be there when I want to submit a bean, can you give me a
more detailed description about how to submit a bean object? I think an
example can better help me, since I really need to know something about
this as soon as possible

ThanksRegards


From: David Friedman [EMAIL PROTECTED]
Reply-To: Struts Users Mailing List [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]
Subject: RE: help me with using bean
Date: Wed, 10 Mar 2004 20:50:18 -0500

Mike,

When you use form-property with a form-bean, don't you need to make the
main
Bean a DynaActionForm or a class you extended from DynaActionForm?  Where
do
you initialize the form-property bean.  For DynaActionForms, they
initialize to null, per If you do not supply an initial attribute,
numbers
will be initialized to 0 and objects to null from the document:
http://jakarta.apache.org/struts/userGuide/building_controller.html#dyna_ac
t

ion_form_classes

Regards,
David

-Original Message-
From: Mu Mike [mailto:[EMAIL PROTECTED]
Sent: Wednesday, March 10, 2004 8:31 PM
To: [EMAIL PROTECTED]
Subject: help me with using bean


I have files like the below,I m  trying to submit a bean object to my
action class, yet when I pressed the submit on the jsp file,it threw an
exception:java.lang.IllegalArgumentException: No bean specified

what is the correct way?
ThanksRegards


myjsp.jsp

html:form action=/selectFont.do 
 tr
 td
   html:text property=bean.size value=10/
 /td
 td
   html:text property=bean.fontName value=aria/
 /td
 /tr
 input type=submit/
/html:form

=
part of struts-config.xml

 form-beans
 form-bean name=SelectFontForm
 type=com.viador.rv.form.SelectFontForm
 form-property name=bean
type=com.viador.rv.bean.FontBean/
 /form-bean
  /form-beans

 action-mappings
 action path=/selectFont
 type=com.viador.rv.action.ApplyFormatAction
 name=SelectFontForm
 scope=session
 /action
/action-mappings

===
SelectFontForm.java

import org.apache.struts.action.ActionForm;
import com.viador.rv.bean.FontBean;

public class SelectFontForm extends ActionForm{
 public FontBean getBean() {
 return bean;
 }

 public void setBean(FontBean bean) {
 this.bean = bean;
 }

 private FontBean bean;
}

==
FontBean.java

public class FontBean  {
 public int getSize() {
 return size;
 }

 public void setSize(int size) {
 this.size = size;
 }

 public String getFontName() {
 return fontName;
 }

 public void setFontName(String fontName) {
 this.fontName = fontName;
 }

 private int size;
 private String fontName;

}

_
 MSN Hotmail  http://www.hotmail.com


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


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


_
 MSN Explorer:   http://explorer.msn.com/lccn/


-
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: help me with using bean

2004-03-10 Thread David Friedman
Mike,

You wrote are new to Struts so have you tried this without nesting a Bean
within a form?  I.E. by making an ActionForm which has size and fontName
properties then copying them if you need to use them somewhere else?  Then
you could access the properties not as bean.size and bean.fontName but
simply as the properties size and fontName?  One thing is bothering me
though, you didn't show any forwards defined so how does your class
com.viador.rv.action.ApplyFormatAction do a return to get you to
/mjsp.jsp?  Are you doing some sort of redirect?

I haven't used DynaActionForms in a while but I think that your use of
Form-Property without extending from the class DynaActionForm is giving
you the trouble.

Regards,
David

-Original Message-
From: Mu Mike [mailto:[EMAIL PROTECTED]
Sent: Wednesday, March 10, 2004 9:36 PM
To: [EMAIL PROTECTED]
Subject: RE: help me with using bean


David:

I did as you told and debugged the running process, the program certainlly
can run into the SelectFontForm class, but after stepping out of that class
,it seems the program ended, the ApplyFormatAction code seems never been
called, what could be the cause of this?

ThanksRegards

From: David Friedman [EMAIL PROTECTED]
Reply-To: Struts Users Mailing List [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]
Subject: RE: help me with using bean
Date: Wed, 10 Mar 2004 21:24:54 -0500

Mike,

Why not change your:

 public class SelectFontForm extends ActionForm{
  public FontBean getBean() {
  return bean;
  }

to:

 public class SelectFontForm extends ActionForm{
  public FontBean getBean() {
  // create a bean to give them IF the 'bean' is ever NULL!
  if ( bean == null )
 bean = new FontBean();
  return bean;
  }

Regards,
David

-Original Message-
From: Mu Mike [mailto:[EMAIL PROTECTED]
Sent: Wednesday, March 10, 2004 9:16 PM
To: [EMAIL PROTECTED]
Subject: RE: help me with using bean


David,
Thank you, I m a newbie to struts, in  fact ,I dont know exactly what kind
of form should be there when I want to submit a bean, can you give me a
more detailed description about how to submit a bean object? I think an
example can better help me, since I really need to know something about
this as soon as possible

ThanksRegards


 From: David Friedman [EMAIL PROTECTED]
 Reply-To: Struts Users Mailing List [EMAIL PROTECTED]
 To: Struts Users Mailing List [EMAIL PROTECTED]
 Subject: RE: help me with using bean
 Date: Wed, 10 Mar 2004 20:50:18 -0500
 
 Mike,
 
 When you use form-property with a form-bean, don't you need to make the
main
 Bean a DynaActionForm or a class you extended from DynaActionForm?
Where
do
 you initialize the form-property bean.  For DynaActionForms, they
 initialize to null, per If you do not supply an initial attribute,
numbers
 will be initialized to 0 and objects to null from the document:

http://jakarta.apache.org/struts/userGuide/building_controller.html#dyna_ac

t

 ion_form_classes
 
 Regards,
 David
 
 -Original Message-
 From: Mu Mike [mailto:[EMAIL PROTECTED]
 Sent: Wednesday, March 10, 2004 8:31 PM
 To: [EMAIL PROTECTED]
 Subject: help me with using bean
 
 
 I have files like the below,I m  trying to submit a bean object to my
 action class, yet when I pressed the submit on the jsp file,it threw
an
 exception:java.lang.IllegalArgumentException: No bean specified
 
 what is the correct way?
 ThanksRegards
 
 
 myjsp.jsp
 
 html:form action=/selectFont.do 
  tr
  td
html:text property=bean.size value=10/
  /td
  td
html:text property=bean.fontName value=aria/
  /td
  /tr
  input type=submit/
 /html:form
 
 =
 part of struts-config.xml
 
  form-beans
  form-bean name=SelectFontForm
  type=com.viador.rv.form.SelectFontForm
  form-property name=bean
 type=com.viador.rv.bean.FontBean/
  /form-bean
   /form-beans
 
  action-mappings
  action path=/selectFont
  type=com.viador.rv.action.ApplyFormatAction
  name=SelectFontForm
  scope=session
  /action
 /action-mappings
 
 ===
 SelectFontForm.java
 
 import org.apache.struts.action.ActionForm;
 import com.viador.rv.bean.FontBean;
 
 public class SelectFontForm extends ActionForm{
  public FontBean getBean() {
  return bean;
  }
 
  public void setBean(FontBean bean) {
  this.bean = bean;
  }
 
  private FontBean bean;
 }
 
 ==
 FontBean.java
 
 public class FontBean  {
  public int getSize() {
  return size;
  }
 
  public void setSize(int size) {
  this.size = size;
  }
 
  public String getFontName() {
  return fontName;
  }
 
  public void setFontName(String fontName) {
  this.fontName = fontName;
  }
 
  private int size;
  private

RE: Cookies And Session Problems

2004-03-08 Thread David Friedman
Did you accidentally set the scope of the FormBean for your Action to
application instead of session or request?

Regards,
David

-Original Message-
From: Ciaran Hanley [mailto:[EMAIL PROTECTED]
Sent: Monday, March 08, 2004 7:48 PM
To: Struts User Mailing List
Subject: Cookies And Session Problems


Hey,



I am writing an app but am having session problems.

The last user to log into the system has their details available to all
other users logged in.

I haven't much of an idea about session control can anybody give some
pointers in the right direction?



From reading I am thinking url rewriting is the way to go about it, but cant
find any good code snippets to get me started.

Also, if caching is disabled does this mean that cookies won't be stored on
the hard drive?



Thanks



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



RE: [OT] JSP or Velocity

2004-02-27 Thread David Friedman
Navjot,

Though I haven't tried Velocity, I like the idea that my stub-pages can be
easily edited in HTML editors.  How do your manage letting your designers
alter the JSP layouts?  Do you have them use some (and if so, what is it)
HTML editor which is (Stuts JSP  EL) aware?

Regards,
David

-Original Message-
From: Navjot Singh [mailto:[EMAIL PROTECTED]
Sent: Friday, February 27, 2004 9:31 AM
To: Struts Users Mailing List
Subject: RE: [OT] JSP or Velocity


Basically, i use velocity only for email templates and sometimes to generate
other kind of templates from one template where the use of XSLT is not
appropriate.
For web templates, that have more complex requirements, i prefer to use
taglibs. besides el makes life as easy as we may talk in velocity. In
velocity, to comprehend taglibs, you may have have to write lots of
velocimacro.

you may ask for another opinion on velocity-user list as well.

-Original Message-
From: Larry Meadors [mailto:[EMAIL PROTECTED]
Sent: Friday, 27 February 2004 21:26
To: [EMAIL PROTECTED]
Subject: Re: [OT] JSP or Velocity


 [EMAIL PROTECTED] 02/27/04 5:44 AM 
 I am starting to develop an application using struts and have been
 looking round the rest of the Jakarta project and came across the
 Velocity project.

 I was interested to see which which people recommended for a relative
 newbie

After looking at velocity, I am certainly of the opinion that it adds no
value over
jsp2/jstl. It offers absolutely nothing that the jsp2/jstl combination
does not.
The only difference is that velocity is a bit more terse (if/else/end
instead of
c:choose/c:when/c:otherwise) and that it uses # instead of the .

It is important to note that I am talking about jsp2 and tomcat 5, not
the jsp1 in
tomcat 4.

A while back I looked in detail at the jsp/velocity comparison on the
velocity site.

There are several issues with the comparison. The person writing the
case study
was cleary biased towards velocity and had never even considered JSTL
(which
in all fairness may not have been available at that time). Looking at
the code
(both the velocity and jstl versions are below) I think that velocity
clearly had
an influence on the jsp2/jstl constructs.

The first thing I noticed was that the two pages do not do the same
thing.
The jsp turns off the session (the vm does not). The jsp stores
variables that
are never used which were factored out in the vm version. The vm version

is missing required code (for example, the repCode and urlEvent
variables
are never defined).

The jsp page is also *very* poorly written using scriptlets. You should
rarely need
to use scriptlets in jsp1/jstl pages, and I suspect with jsp2/jstl, you
will not ever
*need* to.

With struts, you do not need to use jsp:useBean tags either because
the controller
does that for you.

The jsp2/jstl version is a bit more verbose because it is based on xml
so you
cannot have things like if/else/end because they are unbalanced, but
other than
that, there are no significant differences.

After converting the page to use JSTL and eliminating ALL of the % %
stuff, we
get something more like this:

===
The JSP version:
===
table width=600 border=0 cellspacing=0 cellpadding=4
   bgcolor=white
   tr
   td
   ibTopic: ${meeting.topic}/b/i

   c:forEach list=${meeting.storedEventsIterator}
var=event
   c:set var=yapper
value=${meeting.participation[event.fromId]} /
   c:choose
   c:when test=${event.class.name eq
'fqcn.URLPushedEvent'}
   c:choose
   c:when test=${yapper.role eq 'R'}
   c:set var=repId
value=${yapper.participantId} /
   font
color=#00b${yapper.name}:/b/font
   /c:when
   c:otherwise
   font
color=#f0b${yapper.name}:/b/font
   /c:otherwise
   /c:choose
   a
href=${event.storedData}${event.storedData}/a br
   /c:when
   c:when test=${event.class.name eq
'fqcn.ChatEvent'}
   c:choose
   c:when test=${yapper.role eq 'R'}
   font
color=#00b${yapper.name}:/b/font
   c:set var=repId
value=${yapper.participantId} /
   /c:when
   c:otherwise
   font
color=#f0b${yapper.name}:/b/font
   /c:otherwise
   /c:choose
   a
href=${event.storedData}${event.storedData}/a br
   /c:when
   /c:choose
   /c:forEach
   hr
   br${meeting.meetingId}:${repId}br
   /td
   /tr
/table
===
The velocity version:
===
table width=600 border=0 cellspacing=0 cellpadding=4
   bgcolor=white
   tr
   td
   

A stack of roles?

2004-02-19 Thread David Friedman
I am about to start an application with 5 user levels: admin, reseller,
merchant, company, and employee.  I need the administrators for each level
to be able to become the lower level, do something for that lower level
(or go a level lower) and then pop back out.  I would like to use roles for
this but I haven't found any way (perhaps I'm searching in the wrong
places), to be able to replace my JAAS Principal within an action.  If I
could do that, I could keep the stack of higher Principals/ids on my own.

Does anyone have any suggestions for how to let an action replace a
Principal without forcing a JAAS login?

Thanks for pointing me in any helpful direction.

Regards,
David


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



RE: [SPAM] - Display TagLib Struts - Found word(s) list error e-mail in the Text body.

2004-02-17 Thread David Friedman
Actually, it's www.displaytag.org, not displaytaglib. :)

Regards,
David

-Original Message-
From: Gagné Jean-Christian [mailto:[EMAIL PROTECTED]
Sent: Tuesday, February 17, 2004 8:09 AM
To: 'Struts Users Mailing List'
Subject: RE: [SPAM] - Display TagLib  Struts - Found word(s) list error
e-mail in the Text body.


Sorry to ask this, but where do you get the Display Taglib ?  The url
mentionned [www.displaytaglib.org] is not found.

JC

 -Message d'origine-
 De : Unmesh Nadkarni [mailto:[EMAIL PROTECTED]
 Envoyé : mardi 17 février 2004 09:13
 À : 'Struts Users Mailing List'
 Objet : [SPAM] - Display TagLib  Struts - Found word(s) list error
 e-mail in the Text body.


 I have started working successfully on the Display TagLib in Struts.
 There are no issues except that the export to .xls, .csv format gives
 following errors in Tomcat.

 Exception:
 javax.servlet.ServletException:org.apache.commons.collections.
 IteratorUt
 ils.arrayIterator

 Root cause:
 java.lang.NoSuchMethodError:org.apache.commons.collections.Ite
 ratorUtils
 .arrayIterator

 Any leads to the same would be useful.

 Thanks and Regards

 Unmesh N

 -Original Message-
 From: Oliver Thiel [mailto:[EMAIL PROTECTED]
 Sent: Sunday, February 15, 2004 6:00 PM
 To: Struts Users Mailing List
 Subject: Re: [OT] Display TagLib  Struts

 I allready got it working! But anyway thanks for your replay.
 The only thing that does not for for me are the export types
 - I can (automatically) create the links (XML Excel CVS)
 But i always get a linke to a *.jsp instead of e.g. an *.xls file.

 Have you/someone also experience something like that? If so
 how do you solved it?


 Thanks
 Oliver


  I'm using Display TagLib, now for testing purposes only but ...
 
  All you have to do is to prepare list of beans with getter
 and setter
  method, and then defining columns by property names.
 
  Documentation is good, so I don't know what you expecting now.
 
  Only one bug i saw till now, if cell value has  character in it.
 But i
  will work with that
 
  So, what kind of error you have, what you want to do ??
  - Original Message -
  From: Oliver Thiel [EMAIL PROTECTED]
  To: [EMAIL PROTECTED]
  Sent: Saturday, February 14, 2004 11:38 AM
  Subject: [OT] Display TagLib  Struts
 
 
   Hi,
  
  
   did anyone use the Display TagLib [www.displaytaglib.org]?
   And can guide my - BETTER - send me some sample code
   on how to use it with struts! I got the examples running in
   my struts app - using the provided TestList's, but as soon as
   I start creating my one from a resultSet I got some strange
   errors. So it would be nice if someone could send me some
   code how he/she did it!
  
  
   Thanks and have a nice weekend ...
   Oliver
  
   --
   GMX ProMail (250 MB Mailbox, 50 FreeSMS, Virenschutz, 2,99
 EUR/Monat...)
   jetzt 3 Monate GRATIS + 3x DER SPIEGEL +++
 http://www.gmx.net/derspiegel
  +++
  
  
  
 -
   To unsubscribe, e-mail: [EMAIL PROTECTED]
   For additional commands, e-mail:
 [EMAIL PROTECTED]
  
  
  
 --
   Dla tych, co chca sie zaKOCHAC...  http://link.interia.pl/f17c0
  
  
  
 
 
 
 
 -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 

 --
 GMX ProMail (250 MB Mailbox, 50 FreeSMS, Virenschutz, 2,99
 EUR/Monat...)
 jetzt 3 Monate GRATIS + 3x DER SPIEGEL +++
 http://www.gmx.net/derspiegel
 +++


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


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


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


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



RE: Using Tile xml definition as an ActionForward

2004-02-17 Thread David Friedman
Nic,

We had discussions on this some time ago.  I think this link might describe
how to use an attribute in another JSP used by that tiles definition:
http://www.mail-archive.com/[EMAIL PROTECTED]/msg61368.html

I remember thinking it was odd but I recall trying it and making it work
because I posted something similar in a (much) later thread, essentially
restating that message.

Regards,
David

-Original Message-
From: Nic Waight [mailto:[EMAIL PROTECTED]
Sent: Tuesday, February 17, 2004 9:46 PM
To: [EMAIL PROTECTED]
Subject: Re: Using Tile xml definition as an ActionForward


The Reason my page was displaying as black was because of an error in my
header.jsp
when it used the tiles:getAsString tag to ask for the title attribute.

The example I was following seemed to imply that the title attribute in the
definition would be available to all
my tiles.  This was not the case.

Instead I had to do the following in my layout jsp

%@ page language=java contentType=text/html;charset=UTF-8%
%@ taglib uri=/tags/struts-tiles prefix=tiles %

%-- Added this bit --%
tiles:insert attribute=header
%-- this attribute is accessible from header.jsp  --%
tiles:put name=title beanName=title beanScope=tile /
/tiles:insert
%-- tiles:get name=header / --%


tiles:get name=body/
tiles:get name=footer/

I would like to know if this is definitely the way I should be doing this
or does it look like I am working round some other problem?



 [EMAIL PROTECTED] 02/18/04 02:18p.m. 
One cause of the blank page is if the attribute named in yout tiles:insert
(or tiles:get I guess) is/are named incorectly. Tiles seems quite happy
and carries on, just outputting nothing if these aren't found.

Niall


- Original Message -
From: Nic Waight [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, February 18, 2004 1:11 AM
Subject: Re: Using Tile xml definition as an ActionForward


Spot on Niall,

My tiles-defs.xml was looking for /tiles/layout/Base.jsp

but the directory was layouts.

Now I am getting a blank page but I am making progress now.

I know iyt must be something small.

Thanks

for your help

Nic.

 [EMAIL PROTECTED] 02/18/04 01:58p.m. 
Actually your right, wasn't a clever suggestion - I hadn't used the
tiles:get, but looking at the source code - its identical to
tiles:insert and was put there so tiles was compatible with the original
struts template tags.

I didn't realize you were getting a 404 - I thought from your message you
were just getting a blank page in your browser. What is it telling you is
missing in the 404 - is it the layout /tiles/layout/Base.jsp? If so, I
know its obvious - but it is named correctly and deployed to the right
place?

I'm not familar with Struts in Action but there is a
tiles-documentation.war shipped with strust which you can drop into your
webapps folder.

Niall

- Original Message -
From: Nic Waight [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, February 17, 2004 11:29 PM
Subject: Re: Using Tile xml definition as an ActionForward


I gave that a go but with the same result the browser displays a 404 not
found error.

Also I have been following the example in the Struts in Action book which
says to use the tiles:get tags in the layout.

Nic.



 [EMAIL PROTECTED] 02/18/04 12:14p.m. 
Try changing your layout (/tiles/layout/Base.jsp) to

%@ taglib uri=/tags/struts-tiles prefix=tiles %
tiles:getAsString name=title/
tiles:insert attribute=header/
tiles:insert attribute=body/
tiles:insert attribute=footer/

Niall

- Original Message -
From: Nic Waight [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, February 17, 2004 9:57 PM
Subject: Using Tile xml definition as an ActionForward


I am new to using tiles and I am having a problem getting my definition
defined in my
tiles-defs.xml file to be displayed.

I have used the debugger to verify that the definition is being loaded when
I access the action but
the page is not displaying.  I have checked the log and I am not getting any
errors.

I am using Struts 1.1 on Weblogic Server 8.1

my tiles-defs.xml looks like this

?xml version=1.0 encoding=UTF-8?
!DOCTYPE tiles-definitions PUBLIC -//Apache Software Foundation//DTD Tiles
Configuration 1.1//EN
http://jakarta.apache.org/struts/dtds/tiles-config_1_1.dtd;
tiles-definitions
  definition name=.css.main path=/tiles/layout/Base.jsp
put name=title value=Privacy Office /
put name=header value=/tiles/header.jsp /
put name=body value=/tiles/main.jsp /
put name=footer value=/tiles/footer.jsp /
  /definition
/tiles-definitions

my layout jsp is

%@ taglib uri=/tags/struts-tiles prefix=tiles %
tiles:useAttribute name=title/
tiles:get page=header/
tiles:get page=body/
tiles:get page=footer/

my action in my struts-config.xml looks like

action path=/showMain type=nz.govt.justice.css.ShowMainAction
name=userData scope=request unknown=false validate=false
forward name=success path=.css.main redirect=false/
/action

and my plugin config looks like

plug-in 

RE: DataGrid...

2004-02-16 Thread David Friedman
Carl,

There is EL support in the CVS (1.0-b3) version for displaytag.
See: http://displaytag.sourceforge.net/changes-report.html

Regards,
David

-Original Message-
From: Carl [mailto:[EMAIL PROTECTED]
Sent: Monday, February 16, 2004 1:15 PM
To: Struts Users Mailing List
Subject: Re: DataGrid...


Hi,

I'm using displayTag and except the current lack of support for EL
expression, it's very helpfull to me.

Carl


Daniel wrote:

 I am looking for  data grid(paging / navigation, sorting and filtering)
for integrate with myapp (based on struts, without EJB) and tested
HTMLTable - Table framework for Struts
(http://htmltable.yuriy-zubarev.com/jsp/index.jsp) and displaytag(
http://displaytag.sourceforge.net/), someone know whats the better or know
another free (for comercial applications).


 abraços
 Daniel S.


-
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: controller for tiles

2004-02-16 Thread David Friedman
Dominik,

The pdf http://www.lifl.fr/~dumoulin/tiles/tilesAdvancedFeatures.pdf (Tiles
Advanced Features) lists various ways to do this.  I suggest you extend your
Action class as a tiles controller so that, within the action, you can set
the pieces of the tile definition to those of your choosing.

But, since you mentioned having your JSP make those changes, which sounds to
me like the wrong place to modify your template, there might be a way to do
that listed in that (or another) advanced Tiles document.

Regards,
David

-Original Message-
From: Niall Pemberton [mailto:[EMAIL PROTECTED]
Sent: Monday, February 16, 2004 2:42 PM
To: Struts Users Mailing List
Subject: Re: controller for tiles


I don't know...but I believe the shipped tiles sample app/documentation does
this - take a look at that.

Niall

- Original Message -
From: Dominik Stoettner [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]
Sent: Monday, February 16, 2004 7:22 PM
Subject: controller for tiles


 Hi!

 I am still trying to write a webapplication with tiles that allows the
user
 to choose which tiles he wants to see. So each tile should have its own
 controller to receive and handle the user inputs. I know that I can define
a
 controller for a tile in the tiles-defs.xml but how do I access that
controller
 from the jsp-page? And I am still looking for a possibility to create a
 page-flow within a tile! Any ideas how to do that?

 Thanks in advance!

 regards,
 dom

 --
 GMX ProMail (250 MB Mailbox, 50 FreeSMS, Virenschutz, 2,99 EUR/Monat...)
 jetzt 3 Monate GRATIS + 3x DER SPIEGEL +++ http://www.gmx.net/derspiegel
+++


 -
 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: persistent data storage - the right way

2004-02-15 Thread David Friedman
I use hibernate so, yes, I think it is a
good alternative. :)

Regards,
David

-Original Message-
From: lixin chu [mailto:[EMAIL PROTECTED]
Sent: Sunday, February 15, 2004 8:56 PM
To: Struts Users Mailing List
Subject: Re: persistent data storage - the right way


is Hibernate another good alternative ?
--- Oliver Thiel [EMAIL PROTECTED] wrote:
 Hi,
 
 
 you can use iBatis [http://www.ibatis.com/] and 
 take a look at this example/tutorial: 
 http://www.reumann.net/do/struts/ibatisLesson1
 (using: Struts - DAO - iBatis )
 
 
 I think this is what your looking for.
 Oliver
 
 
  hello,
  
  i have been looking (in vain) for a description
 how to implement database
  access in struts correctly. i would like to use
 the DAO (data access
  object)
  pattern in combination with datasources for
 connection pooling. however, i
  am having a hard way figuring out how to implement
 the whole and to
  decouple
  my actions from knowing about the implementation
 of the DB.
  
  the example application bundled with struts uses a
 plugin to set up
  everything in the application context - is this
 the right way to go about
  things? i am planning on using postgresql for the
 moment but would like to
  foresee possible changes in the future.
  
  any examples or pointers in the right direction
 would be very much
  appreciated.
  
  thanks,
  
  Ben.
  
  
 

-
  To unsubscribe, e-mail:
 [EMAIL PROTECTED]
  For additional commands, e-mail:
 [EMAIL PROTECTED]
  
 
 -- 
 GMX ProMail (250 MB Mailbox, 50 FreeSMS,
 Virenschutz, 2,99 EUR/Monat...)
 jetzt 3 Monate GRATIS + 3x DER SPIEGEL +++
 http://www.gmx.net/derspiegel +++
 
 

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


__
Do you Yahoo!?
Yahoo! Finance: Get your refund fast by filing online.
http://taxes.yahoo.com/filing.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: Problem in Multipage Validation with DynaValidatorForm

2004-02-08 Thread David Friedman
Joseph, here are some different questions for you:

1. Is your problem with client- or server-side validation?

I'll assume (for discussion purposes) that client-side multi-page validation
with an Action is your problem:

Does your appropriate JSP page have
html:hidden property=page value=1 / (or 2 or 3)
(For the validation page set you wish to validate)

Does your JSP have hidden variables (or a session-based bean) to hold/retain
the other fields you've passed along?

AND, for client-side validation:
html:javascript formName=/submit2 method=validateSubmit page=1 / (or
2 or 3)

If you are client-side validating based upon an Action, you'll need to
rename the action since validation will try to use the slash starting the
action name in the javascript function name and slashes are invalid function
name characters in Javascript.  So, use html:javascript's
formName=/someAction and method=validateSomeNewName to fix that problem.
Just be sure to change the html:form to use an
onsubmit=validateSomeNewName so everything is consistent enough to run.

Regards,
David

-Original Message-
From: Matthias Wessendorf [mailto:[EMAIL PROTECTED]
Sent: Sunday, February 08, 2004 9:20 AM
To: 'Struts Users Mailing List'
Subject: RE: Problem in Multipage Validation with DynaValidatorForm


could you explain some details ?

cheers!

-Original Message-
From: Joseph Jegan [mailto:[EMAIL PROTECTED]
Sent: Saturday, February 07, 2004 8:08 PM
To: Struts Users Mailing List
Subject: Re: Problem in Multipage Validation with DynaValidatorForm


Thanks matthias for your response.

Still, it is not working for me...



- Original Message -
From: Matthias Wessendorf [EMAIL PROTECTED]
To: 'Struts Users Mailing List' [EMAIL PROTECTED]
Sent: Saturday, February 07, 2004 4:19 PM
Subject: RE: Problem in Multipage Validation with DynaValidatorForm


 hi joseph

 you should use DynaValidatorActionForm in form-bean-declaration

 in your validator.xml you enter instead of the name (myNiceFormBean)
 the path (/submit1 or /submit2) und on field you deal as well, which
 is required in page1 or page2

 greeting,

 matthias

 -Original Message-
 From: Joseph Jegan [mailto:[EMAIL PROTECTED]
 Sent: Saturday, February 07, 2004 7:19 AM
 To: Struts Users Mailing List
 Subject: Problem in Multipage Validation with DynaValidatorForm


 Hello,

 My application has two page form (wizard type).  To make the
 programming and maintenance simpler, I have selected Validator along
 with DynaValidatorForm.

 The problem which i am facing is that, my first page validation works
 correctly. But, second page doesnt seems to work. It doesnt go in to
 the validation method itself. For the fields in the first page, i have

 give page attribute for the Field element to be 0 and for the second

 page fields i have given 1. I am suspecting the problem could be
 with the page parameter in the DynaValidatorForm. How does the page
 parameter in the form gets incremented.. Does it happen automatically?

 Can someone tell me the exact steps to implement a multipage
 validation with DynaValidatorForm?

 Thanks in Advance
 Joseph




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





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


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


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



RE: Validation Multiple Pages forward-Failure

2004-01-28 Thread David Friedman
I hate action chaining but this solution might work:

For the display of the multi-page form, use another action.  Then, your
validation failure can use the multi-form display action as the input=
parameter and call it from the regular action by a forward, if it ever needs
to call the display to continue.

How could you easily set the individual input pages in the struts-config.xml
file?  Probably by using a few set-property name= value= / tags within
the action... . (here) ... /action declaration.  They go there like
a local forward but they have a different usage and purpose.  Then you could
set a page name for step 1 to use to display, step 2, step 3, etc.

Regards,
David

-Original Message-
From: Robert Lehner [mailto:[EMAIL PROTECTED]
Sent: Tuesday, January 27, 2004 3:40 PM
To: Struts Users Mailing List
Subject: Re: Validation Multiple Pages forward-Failure


Hello


Matthias Wessendorf wrote:
 hi

 enter
 input=/myFormular.jsp

 so validate goes back to formular

 there you can display
 action-messages (or even errors if you use)

Yes this would work if I hade one JSP-Page, but I have (now) one
Form(getter and setter methods), one ActionForm and seven JSP-Pages wich
are would be filled one after the other (and validated, without
validation it works for now). At the end I would show all the values to
the user and when submitting the entries the actionFrom should call a
bussnessdelegate and store the vaules pesistent (via JDO) in a DBMS.

CU

Robert


 cheers,
 matthias

 -Original Message-
 From: Robert Lehner [mailto:[EMAIL PROTECTED]
 Sent: Tuesday, January 27, 2004 7:13 PM
 To: Struts Users Mailing List
 Subject: Re: Validation Multiple Pages forward-Failure


 Hallo

 I'm using *.do mapping in my web.xml so I must use input=/newUser ?
 This does not work!

 Ben Anderson wrote:

You want to put validate=true for the action you are submitting to.
That's also where you specify the input.  The input is an application
relative path beginning with a /, so if you're using /do/* mapping

 in

your web.xml you'd want something like this

action name=newUserFrom
  path=/nextPathInProcess
  validate=true
  input=/do/newUser
   

however, I think it's generally best to just forward back to the jsp:
input=/pages/newUser.jsp


 I could not user input=/newuser/newUser.jsp because there is no file
 like newUser.jsp .
 I have the files index.jsp, address.jsp, services.jsp, status.jsp where
 I distribute the objects (name, fist name, street, city etc) from my
 NewUserFrom.
 When I mistype anything i.E. in index.jsp it should redisplay the
 index.jsp with the errormsg otherwise it should display the next page
 (address.jsp) and so on. Like in my NewUserAktion snippt down. (Also
 shown in the struts-validation example of the struts-distribution but
 without JavaScript!!)
 If you would see the full NewUserAction mail me and i would send it to
 you via pm.

 thx

 Robert Lehner




From: Robert Lehner [EMAIL PROTECTED]
Reply-To: Struts Users Mailing List
[EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]
Subject: Re: Validation Multiple Pages forward-Failure
Date: Tue, 27 Jan 2004 18:19:18 +0100

Hello

I saw this in the dtd, but I don't knowe what I should enter as value
of input. I tried newUser, newUser.do, newUserFrom nothing worked es
expected.

I would to get back the form where the validation find the failure,
so
the User could corret his failure an procced the applikation.
 BTW: I used the struts-validation exmaple as pattern.
I changed in the pattern struts-config.xml at the action
multiRegistration the validation to true and the applikation dosen't
work any more. Why?

Thx

Robert Lehner

Ben Anderson wrote:


struts validation uses the input attribute of the action tag to send
you back to where you came from if validation fails.  Here's the
excerpt from the dtd:

input   Module-relative path of the action or other
resource to
which control should be returned if a validation
error is
encountered. Valid only when name is

 specified.

Required
if name is specified and the input bean

 returns

validation errors. Optional if name is
specified and the
input bean does not return validation errors

you must specify this attribute if you want to use struts
validation. -Ben


From: Robert Lehner [EMAIL PROTECTED]
Reply-To: Struts Users Mailing List
[EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]
Subject: Validation Multiple Pages forward-Failure
Date: Tue, 27 Jan 2004 14:01:16 +0100

Hello,

I have a MultiPageFrom with 7 seperate JSP-Pages.
I want to validate all these pages.

When I run the application and whould test if the validation works
well, I get the following error when I hit Submit.
---
type Status report

message No input attribute for mapping path /newUser

description The server encountered an 

RE: How to Implement Roles

2004-01-22 Thread David Friedman
I have a similar problem and, at the moment, no real solution.  I'd prefer
to be able to change the 'role' so I could push/pop id's as a management
account drills down to a user account (to fix user problems), but I have no
clue how to do this as Tomcat seems to have only read-only roles.

My levels (most powerful to most restricted) would be:
5. Super user
4. Reseller
3. Client
2. Client's customer (a company)
1. User under client's customer (employee for a company)

Thanks for any help on this slightly different issue,
David

-Original Message-
From: Parag Marathe [mailto:[EMAIL PROTECTED]
Sent: Thursday, January 22, 2004 12:36 AM
To: [EMAIL PROTECTED]
Subject: How to Implement Roles


Experts,

I have a typical problem implementing roles.

I have roles like Super User, Accounts User , General user. With Super User
having access to all, Accounts and General User are restricted.

Same JSP will be displayed to all users. But each will see different set of
functions on it.

e.g.
on homepage.jsp
Accounts user will see Update , View options
General User will See View Accounts options.
SuperUser will See All of above and Create options

What will be the best way to implement this in JSP, and how to map actions?

All your commnets are highly appreciated.

Regards,
Parag

*
Disclaimer

This message (including any attachments) contains
confidential information intended for a specific
individual and purpose, and is protected by law.
If you are not the intended recipient, you should
delete this message and are hereby notified that
any disclosure, copying, or distribution of this
message, or the taking of any action based on it,
is strictly prohibited.

*
Visit us at http://www.mahindrabt.com




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


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



RE: Tomcat error with compiling JSPs

2004-01-15 Thread David Friedman
I have mine installed and working fine with a CATALINA_HOME of D:\Program
Files\Apache Group\Tomcat 4.1.  I had trouble with the J2SDK and JASPER
until I changed those environmental variables/paths to be the short names of
the paths (i.e. without spaces).  Those can be seen using the command dir
/x from a command prompt window in Windows NT/ME/XP/etc. :)

So, while my long path is:
D:\Program Files\Apache Group\Tomcat 4.1

My short path for CATALONA_HOME is:
d:\progra~1\apache~1\tomcat~1.1\

Regards,
David

-Original Message-
From: Martin Gainty [mailto:[EMAIL PROTECTED]
Sent: Thursday, January 15, 2004 10:47 AM
To: Struts Users Mailing List
Subject: Re: Tomcat error with compiling JSPs


I expect politicians to lie not engineers!
*Glad that solved your problem*
Martin
- Original Message -
From: Claire Wall [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]
Sent: Thursday, January 15, 2004 8:56 AM
Subject: Re: Tomcat error with compiling JSPs


 sorry, i lied before - the JAVA_HOME variable is pointing to the bin
folder
 of the JDK.

 we have just reinstalled Tomcat (4.1.2) again to a path that has no spaces
 and it now works. However, this doesnt solve the problem because as stated
 before, we cannot dictate what path our client has their tomcat installed
 in.


 - Original Message -
 From: Martin Gainty [EMAIL PROTECTED]
 To: Struts Users Mailing List [EMAIL PROTECTED]
 Sent: Thursday, January 15, 2004 1:43 PM
 Subject: Re: Tomcat error with compiling JSPs


  I ran into this exact error when I installed IBM JDK with Websphere and
 all
  of a sudden my JSP
  wouldnt compile on Tomcat
  What is your JAVA_HOME pointing to?
  Regards,
  -Martin
  - Original Message -
  From: Claire Wall [EMAIL PROTECTED]
  To: Struts Users Mailing List [EMAIL PROTECTED]
  Sent: Thursday, January 15, 2004 8:44 AM
  Subject: Re: Tomcat error with compiling JSPs
 
 
   the classpath of the server only points to the bin folder of the JDK.
  
   It still doesn't explain why this application isnt working and all of
 the
   rest are, since all our applications are installed via a WAR file and
I
 do
   not change or set a class path for each application - I only change
the
   paths that need to be changed in web.xml and struts-config.xml for the
   application. We have been developing this application on Tomcat on
 another
   server and it works fine.
  
   What reasons are there for the java compiler to not be able to compile
 JSP
   files for a particular application as this appears to be the problem.
  
  
   - Original Message -
   From: Max Cooper [EMAIL PROTECTED]
   To: Struts Users Mailing List [EMAIL PROTECTED]
   Sent: Thursday, January 15, 2004 1:31 PM
   Subject: Re: Tomcat error with compiling JSPs
  
  
This seems telling:
   
[javac] javac: invalid flag: C:\Program
   
It seems like some kind of path with a space in it is being passed
to
  the
compiler, but it is not being quoted properly.
   
javac -classpath C:\Program Files\somelib\lib.jar ...
   
(should be: javac -classpath C:\Program Files\somelib\lib.jar ...)
   
However, I would kind of expect the error to be invalid flag:
Files\somelib\lib.jar in that case, since the C:\Program part is
 before
   the
space. Could you have some kind of funky classpath like
 C:\dir\lib.jar;
C:\Program Files\poop\stuff.jar (note the space after the ';'). Are
 you
setting the classpath for the server process yourself, perhaps by
  starting
Tomcat using your own script (rather than startup.bat)? Or do you
have
   some
strange classpath in your environment before you start Tomcat?
   
-Max
   
- Original Message -
From: Claire Wall [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]
Sent: Thursday, January 15, 2004 4:06 AM
Subject: Tomcat error with compiling JSPs
   
   
hi,
   
I am trying to install my application on another server (Tomcat
4.1).
 I
   have
built a WAR file from an ANT build file but when I install it on
 Tomcat
   and
try to access it I get the following error:
   
   
HTTP Status 500 -
   
  
 

 --
   --

   
type Exception report
   
message
   
description The server encountered an internal error () that
prevented
  it
from fulfilling this request.
   
exception
   
org.apache.jasper.JasperException: Unable to compile class for JSP
   
An error occurred at line: -1 in the jsp file: null
   
Generated servlet error:
[javac] Since fork is true, ignoring compiler setting.
[javac] Compiling 1 source file
[javac] Since fork is true, ignoring compiler setting.
[javac] javac: invalid flag: C:\Program
[javac] Usage: javac
[javac] where possible options include:
[javac]   -gGenerate all debugging info
  

RE: Config Tiles with Struts

2004-01-04 Thread David Friedman
Li,

I'm guessing that your tile named loginDef is overriding your forward
loginDef.  That's why I start my tiles with a period in the name
.loginDef.  If that doesn't work, try changing your index.jsp to this:
(and old post of mine)

%@ taglib uri=/WEB-INF/tiles.tld prefix=tiles %
tiles:insert definition=loginDef/

Or something like that.  The exact syntax is in section 4.1.2 of the Tiles
Advanced Features by Cedric Dumoulin at
http://www.lifl.fr/~dumoulin/tiles/tilesAdvancedFeatures.pdf but that seems
to list tiles:insert beanName=loginDef ... / (beanName instead of
definition).

Regards,
David

-Original Message-
From: lixin chu [mailto:[EMAIL PROTECTED]
Sent: Sunday, January 04, 2004 8:10 AM
To: [EMAIL PROTECTED]
Subject: Config Tiles with Struts


hi all,
i am new to Struts. A question about configuring Tiles
and Struts. Hear are my files:

struts-config.xml
-
..
plug-in
className=org.apache.struts.tiles.TilesPlugin
set-property
property=pathnames
value=WEB-INF/tiles-defs.xml/
/plug-in
..
global-forwards
forward
name=loginDef
path=/loginDef.do/
/global-forwards
..
action
path=loginDef
type=org.apache.struts.actions.ForwardAction
parameter=loginDef/

tiles-defs.xml
--
..
definition name=baseDef path=/layouts/layout.jsp
put name=header value=/pages/header.jsp
put name=screen value=
put name=footer value=/pages/footer.jsp
/definition

definition name=loginDef extends=baseDef
put name=screen value=/pages/login.jsp
/definition

index.jsp
-
%@ taglib uri=/tags/struts-logic prefix=logic %
logic:redirect forward=loginDef/

layout.jsp
--
%@ taglib uri=/WEB-INF/tiles.tld prefix=tiles %
html
body

table cellspacing=0 cellpadding=0
tr
td
%-- include header --%
tiles:insert attribute=header/
/td
/tr
%-- disable this first
tr
td
%-- include body --%
tiles:insert attribute=screen/
/td
/tr
--%
tr
td
%-- include footer --%
tiles:insert attribute=footer/
/td
/tr

/table

/html
/body

header.jsp
--
%@ taglib uri=/tags/struts-bean prefix=bean %
%@ taglib uri=/tags/struts-html prefix=html %
%@ taglib uri=/tags/struts-logic prefix=logic %

table cellspacing=0 cellpadding=0 width=100%
tr
td width=25% align=left
html:img page=/images/canal-logo.bmp/
/td

td width=60% align=center
Canal
/td

td width=15%
/td
/tr
/table


folder structure

webapps/myapp
   |_layouts/layout.jsp
   |_pages/header.jsp, footer.jsp, login.jsp
   |_WEB_INF/struts-config.xml, tiles-def.xml,
etc.


error msg in browser
-
HTTP Status 400 - Invalid path /loginDef was requested
-
type Status report

message Invalid path /loginDef was requested

description The request sent by the client was
syntactically incorrect (Invalid path /loginDef was
requested).

what's wrong with my configuration ?

thanks in advance,
li xin

__
Do you Yahoo!?
Find out what made the Top Yahoo! Searches of 2003
http://search.yahoo.com/top2003

-
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: Paging for table...

2004-01-03 Thread David Friedman
I use displaytag, www.displaytag.org, for that.

Regards,
David

-Original Message-
From: vasudevrao gupta [mailto:[EMAIL PROTECTED]
Sent: Saturday, January 03, 2004 7:40 AM
To: 'Struts Users Mailing List'
Subject: Paging for table...

Hi,

I have a requirement where in user executes a query and gets some x number
of records.  I have to show the user 1-y records per page and when user
clicks next button, he should be be able to see next y number of
records.(Similar to yahoo site ).

Can any one pls tell me if struts frame work provides any inbuilt framework
to do this kind of paging

Regards
VasudevRaoGupta

Confidentiality Notice

The information contained in this electronic message and any attachments to
this message are intended
for the exclusive use of the addressee(s) and may contain confidential or
privileged information. If
you are not the intended recipient, please notify the sender at Wipro or
[EMAIL PROTECTED] immediately
and destroy all copies of this message and any attachments.

-
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: Paging for table...

2004-01-03 Thread David Friedman
The site I gave you, www.displaytag.org (with source and binaries available
from SourceForge.net), lists plenty of examples and code.  Basically, you
have a collection of objects (usually in request or session scope, but you
can do it in page scope) and set your tag with the columns.  From their
basic columns example, if you have a List stored as test, for each item
you can display the fields id, name, email, status, description using the
below code:

display:table name=test
  display:column property=id /
  display:column property=name /
  display:column property=email /
  display:column property=status /
  display:column property=description /
/display:table

Just keep in mind the binary updates a few jars to newer versions.  Off the
top of my head, I think it updates (don't pay attention, I just code *grin*)
commons-lang, commons-beanutils, commons-logging, and commons-collections.
But don't worry, they are in the binary distribution's example .war
application and work fine with Struts v1.1 (probably with v1.0 as well).

Also, fancier things are available, such as sorting, grouping, and
downloading the fields as excel, csv, and xml.

Regards,
David

-Original Message-
From: vasudevrao gupta [mailto:[EMAIL PROTECTED]
Sent: Saturday, January 03, 2004 10:27 AM
To: 'David Friedman'; 'Struts Users Mailing List'
Subject: RE: Paging for table...



.Can you please send across the sample code that you have developed???

-Original Message-
From: David Friedman [mailto:[EMAIL PROTECTED]
Sent: 03 January 2004 20:57
To: Struts Users Mailing List; [EMAIL PROTECTED]
Subject: RE: Paging for table...


I use displaytag, www.displaytag.org, for that.

Regards,
David

-Original Message-
From: vasudevrao gupta [mailto:[EMAIL PROTECTED]
Sent: Saturday, January 03, 2004 7:40 AM
To: 'Struts Users Mailing List'
Subject: Paging for table...

Hi,

I have a requirement where in user executes a query and gets some x
number
of records.  I have to show the user 1-y records per page and when user
clicks next button, he should be be able to see next y number of
records.(Similar to yahoo site ).

Can any one pls tell me if struts frame work provides any inbuilt
framework
to do this kind of paging

Regards
VasudevRaoGupta

Confidentiality Notice

The information contained in this electronic message and any attachments
to
this message are intended
for the exclusive use of the addressee(s) and may contain confidential
or
privileged information. If
you are not the intended recipient, please notify the sender at Wipro or
[EMAIL PROTECTED] immediately
and destroy all copies of this message and any attachments.

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


Confidentiality Notice

The information contained in this electronic message and any attachments to
this message are intended
for the exclusive use of the addressee(s) and may contain confidential or
privileged information. If
you are not the intended recipient, please notify the sender at Wipro or
[EMAIL PROTECTED] immediately
and destroy all copies of this message and any attachments.

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


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



RE: html:button

2004-01-03 Thread David Friedman
Otávio,

When you set your property to, say, 'property=something', it gets invoked
as 'form.getSomething();'.

Regards,
David

-Original Message-
From: Otávio Augusto [mailto:[EMAIL PROTECTED]
Sent: Saturday, January 03, 2004 3:33 PM
To: Struts Users Mailing List
Subject: Re: html:button


That means I have to add, in my FormAction, a field corresponding to the
button in the jsp?

On Sat, 3 Jan 2004 13:24:55 -0700
Mike Deegan [EMAIL PROTECTED] wrote:

 property = the name assigned to the generated input field

 - Original Message -
 From: Otávio Augusto [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Saturday, January 03, 2004 12:49 PM
 Subject: html:button


 Small question: what is (or what means) the property attribute i have to
 add when using the html:button tag?

 Thanks
 Otávio Augusto

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


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


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


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



RE: html:button

2004-01-03 Thread David Friedman
Otávio,

Perhaps the documentation would be of better use at this point.  You can
find details of the html taglib and descriptions of the available attributes
at: http://jakarta.apache.org/struts/userGuide/struts-html.html

According to that page, though it might relate specifically to the nightly
build, the html:button tag does have a property attribute.

Regards,
David

-Original Message-
From: Otávio Augusto [mailto:[EMAIL PROTECTED]
Sent: Saturday, January 03, 2004 3:46 PM
To: Struts Users Mailing List
Subject: Re: html:button


hmm,now I got it. By the time I had this doubt, I was using input button the
html way. The html:form action=someAction defines the Action class I want
to execute to process the fields. If using the simple html button, what
corresponds to the property attribute? I'm used to apply the property
attribute to many other struts tags, but don't see any use for the
html:button tag (sorry for my ignorance :D).

Thanks for the help.

Otávio Augusto

On Sat, 3 Jan 2004 15:43:17 -0500
David Friedman [EMAIL PROTECTED] wrote:

 Otávio,

 When you set your property to, say, 'property=something', it gets
invoked
 as 'form.getSomething();'.

 Regards,
 David

 -Original Message-
 From: Otávio Augusto [mailto:[EMAIL PROTECTED]
 Sent: Saturday, January 03, 2004 3:33 PM
 To: Struts Users Mailing List
 Subject: Re: html:button


 That means I have to add, in my FormAction, a field corresponding to the
 button in the jsp?

 On Sat, 3 Jan 2004 13:24:55 -0700
 Mike Deegan [EMAIL PROTECTED] wrote:

  property = the name assigned to the generated input field
 
  - Original Message -
  From: Otávio Augusto [EMAIL PROTECTED]
  To: [EMAIL PROTECTED]
  Sent: Saturday, January 03, 2004 12:49 PM
  Subject: html:button
 
 
  Small question: what is (or what means) the property attribute i have
to
  add when using the html:button tag?
 
  Thanks
  Otávio Augusto
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 

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


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


-
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: Please Help - ClassCastException

2004-01-03 Thread David Friedman
Here is what I see (opinions vary)...

I see you are defining your form bean in your struts-config.xml as type
'org.apache.struts.validator.DynaValidatorForm'. So, why are you trying to
cast it as this 'org.apache.artimus.message.PostForm' class.  Does that
class extend DynaValidatorForm?  If it doesn't, you'll get a
ClassCastException like you're getting now.   Personally, I expected you to
cast it as:

DynaValidatorForm postForm = (DynaValidatorForm) form;

Or us it as-initially defined (not casting like above) and use BeanUtils
such as:
String receiver = (String) PropertyUtils.getSimpleProperty(form,
receiver);

Regards,
David

-Original Message-
From: Caroline Jen [mailto:[EMAIL PROTECTED]
Sent: Saturday, January 03, 2004 11:04 PM
To: Struts Users Mailing List
Subject: Re: Please Help - ClassCastException


Thank you for trying to help.  I have added
import org.apache.artimus.message.PostForm;
to my action class.  I do not fully follow what I
should check in the struts-config.xml file.  And
should I use name=postForm with lowercase 'p' or
uppercase 'P'?

In my struts-config.xml file, I have:

 form-bean
name=postForm

type=org.apache.struts.validator.DynaValidatorForm
  form-property
name=receiver
type=java.lang.String/
  form-property
name=sender
type=java.lang.String/
  form-property
name=title
type=java.lang.String/
  form-property
name=postTopic
type=java.lang.String/
  form-property
name=postBody
type=java.lang.String/
/form-bean

and

action
roles=administrator,editor,contributor
path=/message/NewTopic
type=org.apache.artimus.message.StoreMessage
name=postForm
scope=request
validate=true
input=.message.Form
   forward
name=success
path=.article.View/
/action

Do you see any problems?
--- Pedro Salgado [EMAIL PROTECTED] wrote:

   On your struts config file check if the form bean
 for StoreMessage action
 is of type pkg.pkg.PostForm and if the action name
 is pointing to the
 correct form bean... It also seems to be missing the
 import of the PostForm
 on your action class.

 Pedro Salgado

 On 04/01/2004 03:22, Caroline Jen
 [EMAIL PROTECTED] wrote:

  The statement shown below encountered a
  ClassCastException:
 
  PostForm postForm = ( PostForm )form;
 
  I cannot figure out the reason.  Please help.
 
  Allow me to show more code of the class where the
  exception occurred:
 
  ...
 
  import org.apache.struts.action.Action;
  import org.apache.struts.action.ActionForward;
  import org.apache.struts.action.ActionMapping;
  import org.apache.struts.action.ActionForm;
  import org.apache.commons.beanutils.BeanUtils;
  import javax.servlet.http.HttpServletRequest;
  import javax.servlet.http.HttpServletResponse;
 
  import org.apache.artimus.message.PostBean;
  import org.apache.artimus.message.ThreadBean;
  import
 org.apache.artimus.message.utility.DateUtil;
 
  public final class StoreMessage extends Action
  {
   public ActionForward execute(ActionMapping
 mapping,
ActionForm form,
HttpServletRequest
  request,
HttpServletResponse
  response)
throws Exception
   {
 
  int parentPostID;
  int threadID;
  int postID;
  String postCreationIP;
  String memberName = request.getRemoteUser();
  Timestamp now =
  DateUtil.getCurrentGMTTimestamp();
 
  parentPostID = Integer.parseInt(
  request.getParameter( parent ) );
 
  PostForm postForm = ( PostForm )form;
  
  
 
   }
  }
 
  __
  Do you Yahoo!?
  Find out what made the Top Yahoo! Searches of 2003
  http://search.yahoo.com/top2003
 
 

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



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



__
Do you Yahoo!?
Find out what made the Top Yahoo! Searches of 2003
http://search.yahoo.com/top2003

-
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: Paging for table...

2004-01-03 Thread David Friedman
Rahul,

What is this paging taglib?  Do you have a url?

Curious,
David

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Sunday, January 04, 2004 12:15 AM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: RE: Paging for table...


Check for paging taglib available for struts which will meet your
requirements.

Rahul

-Original Message-
From: Vasudevrao Gupta M V S S S (WT01 - UTILITIES) Sent: Saturday, January
03, 2004 8:57 PM
To: 'David Friedman'; 'Struts Users Mailing List'
Subject: RE: Paging for table...



.Can you please send across the sample code that you have developed???

-Original Message-
From: David Friedman [mailto:[EMAIL PROTECTED] Sent: 03 January 2004
20:57
To: Struts Users Mailing List; [EMAIL PROTECTED]
Subject: RE: Paging for table...


I use displaytag, www.displaytag.org, for that.

Regards,
David

-Original Message-
From: vasudevrao gupta [mailto:[EMAIL PROTECTED]
Sent: Saturday, January 03, 2004 7:40 AM
To: 'Struts Users Mailing List'
Subject: Paging for table...

Hi,

I have a requirement where in user executes a query and gets some x
number
of records.  I have to show the user 1-y records per page and when user
clicks next button, he should be be able to see next y number of
records.(Similar to yahoo site ).

Can any one pls tell me if struts frame work provides any inbuilt
framework
to do this kind of paging

Regards
VasudevRaoGupta

Confidentiality Notice

The information contained in this electronic message and any attachments
to
this message are intended
for the exclusive use of the addressee(s) and may contain confidential
or
privileged information. If
you are not the intended recipient, please notify the sender at Wipro or
[EMAIL PROTECTED] immediately
and destroy all copies of this message and any attachments.

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


Confidentiality Notice
The information contained in this electronic message and any attachments to
this message are intended
for the exclusive use of the addressee(s) and may contain confidential or
privileged information. If
you are not the intended recipient, please notify the sender at Wipro or
[EMAIL PROTECTED] immediately
and destroy all copies of this message and any attachments.

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


Confidentiality Notice
The information contained in this electronic message and any attachments to
this message are intended
for the exclusive use of the addressee(s) and may contain confidential or
privileged information. If
you are not the intended recipient, please notify the sender at Wipro or
[EMAIL PROTECTED] immediately
and destroy all copies of this message and any attachments.

-
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: File Upload

2003-12-25 Thread David Friedman
Jacob,

Did anyone ever get back to you on this? Where are you trying to get your
MultiPartRequestWrapper?

In an ActionForm subclass, you can use the method:
getMultipartRequestHandler()

In an Action subclass, you can do pull it from above using:
MultipartRequestWrapper multiWrapper = (MultipartRequestWrapper)
form.getMultipartRequestHandler();

OR, if there is no ActionForm defined for your Action subclass, create a new
type of MultipartRequestHandler such as:

CommonsMultipartRequestHandler cmrh = new CommonsMultipartRequestHandler();
cmrh.setServlet(servlet);
cmrh.handleRequest(request);
HashTable h = cmrh.getFileElements();

I used CommonsMultipartRequestHandler in my example (from an old post) but
any appropriate MultiPartRequestHandler subclass should work.
http://www.mail-archive.com/[EMAIL PROTECTED]/msg87269.html

Just remember 2 things:
a) only one file can be uploaded per file input field - someone tried to
list many files in one upload field and kept seeing Exceptions thrown.

b) if you are not using an ActionForm, there doesn't appear to be a
MultiPartRequestHandler initialized, so create a new one like #2 above.

Regards,
David

-Original Message-
From: Jacob Ginu [mailto:[EMAIL PROTECTED]
Sent: Tuesday, December 23, 2003 10:03 PM
To: Struts Users Mailing List
Subject: RE: File Upload


Hi,

This is the sample code I am using in the action.java file.I have the
necessary struts file.But it says Unable to find ServletActionContext in
MultipartRequestWrapper when compiled.

MultipartRequestWrapper multiWrapper =
(MultipartRequestWrapper)
ServletActionContext.getRequest();

Enumeration e = multiWrapper.getFileNames();
while(e.hasMoreElements()) {
   // get the value of thisinput tag
   StringinputValue = (String) e.nextElement();
// get the content type
   StringcontentType = multiWrapper.getContentType(inputValue);
// get the name of the file from the input tag
   StringfileName = multiWrapper.getFilesystemName(inputValue);
// Get a File object forthe uploaded File
   File file = multiWrapper.getFile(inputValue);
// If it's nullthe upload failed
   if(file == null) {
  addActionError(Error uploading: +
multiWrapper.getFilesystemName(inputValue));
   }


David Friedman [EMAIL PROTECTED] wrote:
Why won't you use the struts-upload.war from the Struts distributions?

Regards,
David

-Original Message-
From: Jacob Ginu [mailto:[EMAIL PROTECTED]
Sent: Tuesday, December 23, 2003 9:48 PM
To: [EMAIL PROTECTED]
Subject: reg:File Upload

Hi,

Can anyone send me a sample file Upload program.

Regards,
Ginu

-
Do you Yahoo!?
Yahoo! Photos - Get your photo on the big screen in Times Square


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


-
Do you Yahoo!?
Yahoo! Photos - Get your photo on the big screen in Times Square


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



RE: File Upload

2003-12-25 Thread David Friedman
Jacob,

That post was all from working examples I had while looking into the problem
(I was curious when I read the original post back then).  Let me know if I
can assist you with anything. Feel free to post your ActionForm and Action
subclasses for assistance.

Regards,
David

-Original Message-
From: Jacob Ginu [mailto:[EMAIL PROTECTED]
Sent: Thursday, December 25, 2003 9:30 PM
To: Struts Users Mailing List
Subject: RE: File Upload


David,
No one has got back to me on this except you.There seems to be not much info
regarding this.Iam going throught the link you sent me.
I tried to call MultipartRequestWrapper from an action subclass.I was not
successful in it.

Thanx for your response.

Regards,
Ginu Jacob
David Friedman [EMAIL PROTECTED] wrote:
Jacob,

Did anyone ever get back to you on this? Where are you trying to get your
MultiPartRequestWrapper?

In an ActionForm subclass, you can use the method:
getMultipartRequestHandler()

In an Action subclass, you can do pull it from above using:
MultipartRequestWrapper multiWrapper = (MultipartRequestWrapper)
form.getMultipartRequestHandler();

OR, if there is no ActionForm defined for your Action subclass, create a new
type of MultipartRequestHandler such as:

CommonsMultipartRequestHandler cmrh = new CommonsMultipartRequestHandler();
cmrh.setServlet(servlet);
cmrh.handleRequest(request);
HashTable h = cmrh.getFileElements();

I used CommonsMultipartRequestHandler in my example (from an old post) but
any appropriate MultiPartRequestHandler subclass should work.
http://www.mail-archive.com/[EMAIL PROTECTED]/msg87269.html

Just remember 2 things:
a) only one file can be uploaded per file input field - someone tried to
list many files in one upload field and kept seeing Exceptions thrown.

b) if you are not using an ActionForm, there doesn't appear to be a
MultiPartRequestHandler initialized, so create a new one like #2 above.

Regards,
David

-Original Message-
From: Jacob Ginu [mailto:[EMAIL PROTECTED]
Sent: Tuesday, December 23, 2003 10:03 PM
To: Struts Users Mailing List
Subject: RE: File Upload


Hi,

This is the sample code I am using in the action.java file.I have the
necessary struts file.But it says Unable to find ServletActionContext in
MultipartRequestWrapper when compiled.

MultipartRequestWrapper multiWrapper =
(MultipartRequestWrapper)
ServletActionContext.getRequest();

Enumeration e = multiWrapper.getFileNames();
while(e.hasMoreElements()) {
// get the value of thisinput tag
StringinputValue = (String) e.nextElement();
// get the content type
StringcontentType = multiWrapper.getContentType(inputValue);
// get the name of the file from the input tag
StringfileName = multiWrapper.getFilesystemName(inputValue);
// Get a File object forthe uploaded File
File file = multiWrapper.getFile(inputValue);
// If it's nullthe upload failed
if(file == null) {
addActionError(Error uploading: +
multiWrapper.getFilesystemName(inputValue));
}


David Friedman wrote:
Why won't you use the struts-upload.war from the Struts distributions?

Regards,
David

-Original Message-
From: Jacob Ginu [mailto:[EMAIL PROTECTED]
Sent: Tuesday, December 23, 2003 9:48 PM
To: [EMAIL PROTECTED]
Subject: reg:File Upload

Hi,

Can anyone send me a sample file Upload program.

Regards,
Ginu

-
Do you Yahoo!?
Yahoo! Photos - Get your photo on the big screen in Times Square


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


-
Do you Yahoo!?
Yahoo! Photos - Get your photo on the big screen in Times Square


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


-
Do you Yahoo!?
Yahoo! Photos - Get your photo on the big screen in Times Square


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



RE: doubt

2003-12-24 Thread David Friedman
Otávio,

Hibernate discussions are at http://http://forum.hibernate.org.  A few of
the discussion threads talk about Struts.  Many cover lazy instantiation.

Regards,
David

-Original Message-
From: Otávio Augusto [mailto:[EMAIL PROTECTED]
Sent: Wednesday, December 24, 2003 3:17 PM
To: [EMAIL PROTECTED]
Subject: doubt


hi all

Maybe this is an inapropriate place to ask that, but i'm gonna take the risk
anyway. I imagine there are users who work with Struts and Hibernate, just
like i do (i haven't found any hibernate's discussion list, so i'm posting
this question here). is someone has ever had the lazy instantiation
problem when working whith Struts + Hibernate, please, notice me.


Thanks a lot, and, again, pardon if that was not polite.

Otávio Augusto

-
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: File Upload

2003-12-23 Thread David Friedman
Why won't you use the struts-upload.war from the Struts distributions?

Regards,
David

-Original Message-
From: Jacob Ginu [mailto:[EMAIL PROTECTED]
Sent: Tuesday, December 23, 2003 9:48 PM
To: [EMAIL PROTECTED]
Subject: reg:File Upload

Hi,
 
Can anyone send me a sample file Upload program.
 
Regards,
Ginu

-
Do you Yahoo!?
Yahoo! Photos - Get your photo on the big screen in Times Square


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



RE: Tiles Problem!!!

2003-12-22 Thread David Friedman
Dhiraj,

I think you have an incorrect understanding of tiles.  Using your
information, you should probably setup a main template with your 3 pieces
(header, menubar, and copyright) PLUS the body-content one.  That way, you
can make a tile that extends that template and simply overrides the
body-content portion.  Like this example tiles template layout:

!-- default template/layout --
!-- note: the page you list as body-content doesn't need to be a jsp
   but can be an html file or a text file --
definition name=appln.default path=/ApplnDefaultLayout.jsp
put name=header value=Menu.jsp/
put name=menubar value=Menu.jsp/
put name=copyright value=copyright.jsp/
put name=body-content value=/
/definition

!-- A page for an action uses the appln.default definition/layout/template
It overrides the appln.default field body-content and forces
it to display /index.jsp instead of whatever was specified
in the appln.default definition/layout/template--

definition name=appln.tilesTest extends appln.default
put name=body-content value=/index.jsp/
/definition

!-- Another page layout using the appln.default
template and overriding body-content to show another page--

definition name=appln.tilesSecondTest extends appln.default
put name=body-content value=/somepage.jsp/
/definition


Then, your /ApplnDefaultLayout.jsp might be (simple layout example):

%@ taglib uri=/WEB-INF/struts-tiles.tld prefix=tiles %
!-- add any html and put the tiles:insert statements wherever you choose
   This simply lists them in order --
tiles:insert name=header/
tiles:insert name=menubar/
tiles:insert name=body-content/
tiles:insert name=copyright/


In your action, set the path of your forward to be a tiles definition:
appln.tilesTest, appln.tilesSecondTest or even appln.default (instead
of specifying an html page or a JSP as the forward's path=SOMETHING
parameter.

Now, about your tiles:insert statements.  Tiles is essentially a 4th scope
like the 3 normal ones: request, session, or application.  There is no need
to specify the tiles definition name as it is not a bean and wouldn't work
(and in your example, it doesn't.  The beanName attribute is for inserting a
bean's property (beanName and beanProperty should go together, that and the
fact you didn't create a real bean named appln.tilestTest explains your
jasper error message) in your template.  That way, you can populate the bean
with data of your choosing (random or specific) and it is one way of
displaying dynamic content.

I hope this explanation helped you with your tiles issues.

Regards,
David

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]
Sent: Monday, December 22, 2003 11:58 PM
To: [EMAIL PROTECTED]
Subject: Tiles Problem!!!


I am trying out 'Declaring definition in a configuration file'

I have added below lines in struts-config.xml

  plug-in className=org.apache.struts.tiles.TilesPlugIn
set-property property=definitions-config
value=/WEB-INF/tiles-practice-defs.xml/
set-property property=definitions-debug value=2/
set-property property=definitions-parser-details value=2/
set-property property=definitions-parser-validate value=true/
set-property property=moduleAware value=true /
  /plug-in


Below are the contents of tiles-practice-defs.xml, which I have placed
in WEB-INF folder:

!DOCTYPE tiles-definitions PUBLIC
-//Apache Software Foundation//DTD Tiles Configuration//EN
http://jakarta.apache.org/struts/dtds/tiles-config.dtd;

tiles-definitions
definition name=appln.default path=/ApplnDefaultLayout.jsp
put name=header value=Menu.jsp/
put name=menubar value=Menu.jsp/
put name=copyright value=copyright.jsp/
/definition
/tiles-definitions


Below are the contents of the TilesDefsTest.jsp page:


%@ taglib uri=/WEB-INF/struts-tiles.tld prefix=tiles %

tiles:insert beanName=appln.default beanScope=request
tiles:put name=body-content value=/index.jsp/
/tiles:insert


I get following error:

org.apache.jasper.JasperException: Error - Tag Insert : No value defined
for bean 'appln.default' with property 'null' in scope 'request'.

I am using Tomcat 4.1.27 with Struts 1.1

Regards

Dhiraj



DISCLAIMER:
This message contains privileged and confidential information and is
intended only for the individual named.If you are not the intended recipient
you should not disseminate,distribute,store,print, copy or deliver this
message.Please notify the sender immediately by e-mail if you have received
this e-mail by mistake and delete this e-mail from your system.E-mail
transmission cannot be guaranteed to be secure or error-free as information
could be intercepted,corrupted,lost,destroyed,arrive late or incomplete or
contain viruses.The sender therefore does not accept liability for any
errors or omissions in the contents of this message which arise as a result
of e-mail transmission. If 

RE: Tiles Problem!!!

2003-12-22 Thread David Friedman
One correction, I typed the wrong tiles:insert statement.
I meant:

tiles:insert attribute=header/
or
tiles:getAsString name=header / IF you need it as a simple string and
not a page include.

Regards,
David

-Original Message-
From: David Friedman [mailto:[EMAIL PROTECTED]
Sent: Tuesday, December 23, 2003 12:19 AM
To: Struts Users Mailing List
Subject: RE: Tiles Problem!!!


Dhiraj,

I think you have an incorrect understanding of tiles.  Using your
information, you should probably setup a main template with your 3 pieces
(header, menubar, and copyright) PLUS the body-content one.  That way, you
can make a tile that extends that template and simply overrides the
body-content portion.  Like this example tiles template layout:

!-- default template/layout --
!-- note: the page you list as body-content doesn't need to be a jsp
   but can be an html file or a text file --
definition name=appln.default path=/ApplnDefaultLayout.jsp
put name=header value=Menu.jsp/
put name=menubar value=Menu.jsp/
put name=copyright value=copyright.jsp/
put name=body-content value=/
/definition

!-- A page for an action uses the appln.default definition/layout/template
It overrides the appln.default field body-content and forces
it to display /index.jsp instead of whatever was specified
in the appln.default definition/layout/template--

definition name=appln.tilesTest extends appln.default
put name=body-content value=/index.jsp/
/definition

!-- Another page layout using the appln.default
template and overriding body-content to show another page--

definition name=appln.tilesSecondTest extends appln.default
put name=body-content value=/somepage.jsp/
/definition


Then, your /ApplnDefaultLayout.jsp might be (simple layout example):

%@ taglib uri=/WEB-INF/struts-tiles.tld prefix=tiles %
!-- add any html and put the tiles:insert statements wherever you choose
   This simply lists them in order --
tiles:insert name=header/
tiles:insert name=menubar/
tiles:insert name=body-content/
tiles:insert name=copyright/


In your action, set the path of your forward to be a tiles definition:
appln.tilesTest, appln.tilesSecondTest or even appln.default (instead
of specifying an html page or a JSP as the forward's path=SOMETHING
parameter.

Now, about your tiles:insert statements.  Tiles is essentially a 4th scope
like the 3 normal ones: request, session, or application.  There is no need
to specify the tiles definition name as it is not a bean and wouldn't work
(and in your example, it doesn't.  The beanName attribute is for inserting a
bean's property (beanName and beanProperty should go together, that and the
fact you didn't create a real bean named appln.tilestTest explains your
jasper error message) in your template.  That way, you can populate the bean
with data of your choosing (random or specific) and it is one way of
displaying dynamic content.

I hope this explanation helped you with your tiles issues.

Regards,
David

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]
Sent: Monday, December 22, 2003 11:58 PM
To: [EMAIL PROTECTED]
Subject: Tiles Problem!!!


I am trying out 'Declaring definition in a configuration file'

I have added below lines in struts-config.xml

  plug-in className=org.apache.struts.tiles.TilesPlugIn
set-property property=definitions-config
value=/WEB-INF/tiles-practice-defs.xml/
set-property property=definitions-debug value=2/
set-property property=definitions-parser-details value=2/
set-property property=definitions-parser-validate value=true/
set-property property=moduleAware value=true /
  /plug-in


Below are the contents of tiles-practice-defs.xml, which I have placed
in WEB-INF folder:

!DOCTYPE tiles-definitions PUBLIC
-//Apache Software Foundation//DTD Tiles Configuration//EN
http://jakarta.apache.org/struts/dtds/tiles-config.dtd;

tiles-definitions
definition name=appln.default path=/ApplnDefaultLayout.jsp
put name=header value=Menu.jsp/
put name=menubar value=Menu.jsp/
put name=copyright value=copyright.jsp/
/definition
/tiles-definitions


Below are the contents of the TilesDefsTest.jsp page:


%@ taglib uri=/WEB-INF/struts-tiles.tld prefix=tiles %

tiles:insert beanName=appln.default beanScope=request
tiles:put name=body-content value=/index.jsp/
/tiles:insert


I get following error:

org.apache.jasper.JasperException: Error - Tag Insert : No value defined
for bean 'appln.default' with property 'null' in scope 'request'.

I am using Tomcat 4.1.27 with Struts 1.1

Regards

Dhiraj



DISCLAIMER:
This message contains privileged and confidential information and is
intended only for the individual named.If you are not the intended recipient
you should not disseminate,distribute,store,print, copy or deliver this
message.Please notify the sender immediately by e-mail if you have received
this e-mail

RE: Off-topic : Calendar Struts

2003-12-18 Thread David Friedman
If you want calendars as a grid layout like so:

Su Mo Tu We Th Fr Sa
1  2  3  4  5  6
...etc 

For Javascript try: http://dynarch.com/mishoo/calendar.epl for

For a JSP Taglib try: http://www.servletsuite.com/servlets/caltag.htm
OR

http://www.aoc.nrao.edu/~bwaters/pub/taglib/calendar-taglib.html

Regards,
David

-Original Message-
From: Martin Gainty [mailto:[EMAIL PROTECTED]
Sent: Thursday, December 18, 2003 2:12 PM
To: Struts Users Mailing List
Subject: Re: Off-topic : Calendar Struts


I assume you checked out
http://jakarta.apache.org/taglibs/doc/datetime-doc/intro.html
Saludos,
Martin
- Original Message -
From: Gonzalez Comesaña; Sergio Eduardo [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]
Sent: Thursday, December 18, 2003 8:20 AM
Subject: Off-topic : Calendar Struts



I know that it's off topic,  but I've need find a calendar similar Outlook
make it in Struts and i was looking in a web and I didn't find nothing
similar.
If somebody  know, have, make it someone  pls, send me an email

Thanks

sergio





Aquest missatge electrònic pot  contenir informació confidencial o
privilegiada.
Si vostè no és el destinatari del  missatge, o l'ha rebut per error, si us
plau
notifiqui-ho al remitent i destrueixi el missatge amb tot el seu contingut.
Està completament  prohibida  qualsevol  còpia, ús o distribució no
autoritzada
del contingut d'aquest missatge electrònic.


Este mensaje electrónico puede contener información confidencial o
privilegiada.
Si usted  no es  el destinatario de este mensaje o lo ha recibido por error,
por
favor notifíquelo al remitente y destruya el mensaje con todo su contenido.
Queda  expresamente  prohibida  cualquier  copia, utilización o
distribución no
autorizada del contenido de este mensaje electrónico.


This e-mail may contain confidential and/or privileged information.
If you  are  not the  intended recipient (or have received this e-mail in
error)
please notify the sender immediately and destroy this e-mail.
Any  unauthorized  copying,  disclosure  or distribution of the material in
this
e-mail is strictly forbidden.



-
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: Off-topic : Calendar Struts

2003-12-18 Thread David Friedman
Okay Martin, I'll ask.

I read your recommended jakarta taglib page.
It doesn't have a specific item for a calendar.
I see it does have components of calendars such
as month and weekday lists.  I even checked
the CVS listing for the version 1.1 (show on
the Jakarta navigation bars) and there is only
v 1.0.1, nothing higher that I can find.  So,
where is the calendar portion of this taglib?
What am I missing in your message?

(yes, I'm confused)

Regards,
David

-Original Message-
From: Martin Gainty [mailto:[EMAIL PROTECTED]
Sent: Thursday, December 18, 2003 2:12 PM
To: Struts Users Mailing List
Subject: Re: Off-topic : Calendar Struts


I assume you checked out
http://jakarta.apache.org/taglibs/doc/datetime-doc/intro.html
Saludos,
Martin
- Original Message -
From: Gonzalez Comesaña; Sergio Eduardo [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]
Sent: Thursday, December 18, 2003 8:20 AM
Subject: Off-topic : Calendar Struts



I know that it's off topic,  but I've need find a calendar similar Outlook
make it in Struts and i was looking in a web and I didn't find nothing
similar.
If somebody  know, have, make it someone  pls, send me an email

Thanks

sergio





Aquest missatge electrònic pot  contenir informació confidencial o
privilegiada.
Si vostè no és el destinatari del  missatge, o l'ha rebut per error, si us
plau
notifiqui-ho al remitent i destrueixi el missatge amb tot el seu contingut.
Està completament  prohibida  qualsevol  còpia, ús o distribució no
autoritzada
del contingut d'aquest missatge electrònic.


Este mensaje electrónico puede contener información confidencial o
privilegiada.
Si usted  no es  el destinatario de este mensaje o lo ha recibido por error,
por
favor notifíquelo al remitente y destruya el mensaje con todo su contenido.
Queda  expresamente  prohibida  cualquier  copia, utilización o
distribución no
autorizada del contenido de este mensaje electrónico.


This e-mail may contain confidential and/or privileged information.
If you  are  not the  intended recipient (or have received this e-mail in
error)
please notify the sender immediately and destroy this e-mail.
Any  unauthorized  copying,  disclosure  or distribution of the material in
this
e-mail is strictly forbidden.



-
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: ActionMapping - regexp pattern matching for path

2003-12-17 Thread David Friedman
Can't you use a module and set the action mapping to 'unknown=true' so
that one particular action is used for everything?  If so, you'd need to be
mapping actions as 'do/*' instead of '*.do', theoretically.  I've been
meaning to try this now that I'm using /do/* as my Struts v1.1 mapping but I
haven't got around to using any modules yet.  (I'm sooo slow on ths project,
like I don't want to do it).

Regards,
David

-Original Message-
From: Brice Ruth [mailto:[EMAIL PROTECTED]
Sent: Wednesday, December 17, 2003 3:27 PM
To: Struts Users Mailing List
Subject: Re: ActionMapping - regexp pattern matching for path


No, I don't believe this is possible currently. Wildcards of any kind
(extending to regexps) are not support for ActionMapping paths.

Sergey Proskurnya wrote:

Hello to all,

In Struts-1.1 it is possible to bind Actions to static URL path,
but is it possible to bind Actions to the set of the paths,
described by Java regular expression?
For example:
action-mappings
actionpath=/users/.*
   type=com.mysite.UserPageAction
   scope=session
   validate=false
   /action
/action-mappings

I mean that in this case the requests for /users/John/,
/users/Mary/ and etc. will be handled by com.mysite.UserPageAction.

Thanks for attention,
  Sergey Proskurnya.

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




--
Brice D. Ruth
Sr. IT Analyst
Fiskars Brands, Inc.


-
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: DOTs, wild cards, and action mapping

2003-12-17 Thread David Friedman
Thomas,

(Probably a) Dumb question 

From the ${area.name} it looks like you're using Velocity Templates.  I
thought Velocity couldn't mix with JSP's like that (My impression from ch 17
of 'Struts in Action'.  How are you mixing the two?  (Or is there a Velocity
update which allows it?)

Regards,
David

-Original Message-
From: Thomas E Enebo [mailto:[EMAIL PROTECTED]
Sent: Wednesday, December 17, 2003 7:16 PM
To: [EMAIL PROTECTED]
Subject: DOTs, wild cards, and action mapping


I started using the wild-card support in action mappings (from a CVS
build).  It works, but I noticed something strange (until I realized
what it was doing).  So, I have a action mapping like:

 action
 path=/areas/*
 type=apackage.AreaAction
 forward name=success path=.area/
 /action

Then in some jsp I have:

html:link title=${area.name} action=/areas/${area.address}

Where area.address expands to '10.0.0.1'.  Struts will look for the last
dot in an action and chop it off.  So I keep getting a string like:

  a href=/managearea/do/areas/10.0.0 title=area1area1/a

So I am not using extensions in my struts configuration and I would
intuitively think that I would get '10.0.0.1' back.  Is this an
ambiguity that appeared with the new wildcard support that cannot be
resolved (meaning I should never use '.' in any names) or is there some
way to resolve this?  Perhaps I must always use extensions to combat
this (i.e. action=/areas/${area.address}.bogus_extension - which is
fine by me as a workaround)?

-Tom



-
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 To Output the Value of a String That Is Passed From Another JSP?

2003-12-17 Thread David Friedman
Caroline,

How do you save the form cr in session scope?
Does your action use 'scope=session' or are you
doing a 'request.getSession().setAttribute(cr,cr);'
in the first action?

Regards,
David

-Original Message-
From: Caroline Jen [mailto:[EMAIL PROTECTED]
Sent: Wednesday, December 17, 2003 8:25 PM
To: Struts Users Mailing List
Subject: RE: How To Output the Value of a String That Is Passed From
Another JSP?


Hi, my JSP#1 and JSP#2 use different forms.  However,
property name in JSP#1 is the same as that in JSP#2. 
I tried to pass this Sring and write it out in a text
field in JSP#2 and just could not get it right.  I got
this error
message:

[ServletException in:/article/content/postForm.jsp]
Cannot find bean cr in scope session' 

In my view.jsp, I put a String in a session object:

   html:form action=/list/Message
   c:set var=cr value=${articleForm.creator}
scope=session/
   html:submitView/Send Messages/html:submit
   /html:form

And in postForm.jsp, I tried to retrieve that String
and write it out in a text field this way:

  bean:define id=author name=cr
scope=session type=java.lang.String/
  html:text property=creator
value=%=author% size=82 maxlength=25
tabindex=1/

-Caroline
 
--- Robert Taylor [EMAIL PROTECTED] wrote:
 There are a couple (3) ways to do it.
 
 1. Have both JSP#1 and 2 use the same form then have
 the action that
 processes JSP#1 simply
 forward to JSP#2 and Struts will auto-populate the
 field.
 
 2. Have the action that processes JSP#1 forward or
 redirect to
JSP#2 whose form has the same property name.
 Place the create property
value in the query string and Struts will
 auto-populate the form
in JSP#2.
 
 3. Have the action that processes JSP#1 access and
 populate the form used
in JSP#2 with the property then forward to JSP#2.
 
 robert
 
  -Original Message-
  From: Caroline Jen [mailto:[EMAIL PROTECTED]
  Sent: Tuesday, December 16, 2003 8:33 PM
  To: [EMAIL PROTECTED]
  Subject: How To Output the Value Of a Hidden
 Field?
 
 
  My JSP #2 receives a hidden field passed from JSP
 #1:
  html:hidden property=creator/
 
  In the JSP #2, I have a text field:
  html:text property=creator size=82
 maxlength=25
  tabindex=1/
 
  and I want the value of the hidden field to be the
  text in the text field of the JSP #2.  Please
 advise
  how to do it?
 
  __
  Do you Yahoo!?
  New Yahoo! Photos - easier uploading and sharing.
  http://photos.yahoo.com/
 
 

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

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


__
Do you Yahoo!?
New Yahoo! Photos - easier uploading and sharing.
http://photos.yahoo.com/

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


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



RE: Plea for help w/Struts-Hibernate Plugin that has it working!

2003-12-16 Thread David Friedman
David,

There is an alternative Struts/Hibernate/JNDI combination.  All of it hinges
on one file: hibernate.cfg.xml.  It doesn't require any changes to
server.xml or web.xml and works (at the very least) for me on Struts v1.0 
v1.1 with Hibernate v2.0.3  V2.1beta6 under Tomcat 4.1.24 through 4.1.29.

* Use a hibernate.cfg.xml file like so (passwords changed and pardon my
MySQL slant)

?xml version='1.0' encoding='utf-8'?
!DOCTYPE hibernate-configuration PUBLIC
-//Hibernate/Hibernate Configuration DTD 2.0//EN
http://hibernate.sourceforge.net/hibernate-configuration-2.0.dtd;
hibernate-configuration
session-factory name=dgf:/hibernate/SessionFactory
property
name=dialectnet.sf.hibernate.dialect.MySQLDialect/property
property name=connection.usernameAA/property
property name=connection.passwordBB/property
property
name=connection.urljdbc:mysql://localhost:3306/authors/property
property
name=connection.driver_classcom.mysql.jdbc.Driver/property
property name=show_sqltrue/property
property name=use_outer_jointrue/property
property
name=transaction.factory_classnet.sf.hibernate.transaction.JDBCTransactio
nFactory/property
property name=dbcp.minIdle1/property
!-- Optional, I use this but it requires an opensymphony.org download of
OSCache
property name=cache.use_query_cachetrue/property
property
name=cache.provider_classnet.sf.hibernate.cache.OSCacheProvider/property

--

!-- insert any mapping file so you don't need to hardcode adding
classes or adding files in a Java class --
mapping resource=hibernate/Misc.hbm.xml/
/session-factory
/hibernate-configuration

The JNDI location is set in the session-factory tag using the 'name='
attribute.   Whatever name you choose, DO NOT use anything starting
java:comp/env as that is read-only in Tomcat and will NOT work.  I made up
a context named dgf:/hibernate/SessionFactory and was pleasantly surprised
when hibernate created the context for me and stored the SessionFactory
within it so I could us it in JNDI context lookups after I got the
InitialContext and performed a
' SessionFactory sf = (SessionFactory)
context.lookup(dgf:/hibernate/SessionFactory);'.

I see you want to use DBCP.  As long as you set a minimum of 1 dbcp
property, hibernate will detect you want to use DBCP as your connection
pool.  Feel free to set more than one DBCP property or even to use something
other than dbcp.minIdle as in my working example above.

Hibernate can work with other connection pools.  I recommend avoiding C3P0
as it can't shutdown (eats up memory unless you fully shutdown the JVM [i.e.
TOMCAT] and restart).  A Beta C3P0 allows shutdown of a C3P0 pool, but the
last time I checked, the Hibernate controlling class for C3P0 pooling still
had an empty finalize() and never actually shutdown my C3P0 pool.

Regards,
David

-Original Message-
From: David Erickson [mailto:[EMAIL PROTECTED]
Sent: Tuesday, December 16, 2003 7:20 PM
To: Struts Mailing List
Subject: Plea for help w/Struts-Hibernate Plugin that has it working!


For some reason I just cannot make the Struts-Hibernate plugin work.. I
can't make the Struts-Hibernate Listener work either.  Here is the link to
class I am trying to use:

http://www.hibernate.org/133.html

Here is the error I get without fail every time.. now note that this jndi
connection WORKS fine when I use the HibernateUtil class, or when I use my
own JDNI tests.

Error:
2003-12-16 17:10:31,452 [DEBUG] impl.SessionImpl - opened session
2003-12-16 17:10:31,468 [DEBUG] transaction.JDBCTransaction - begin
2003-12-16 17:10:31,484 [DEBUG] util.JDBCExceptionReporter - SQL Exception
java.sql.SQLException: Cannot load JDBC driver class 'null'
 at
org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.jav
a:529)
 at
org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:3
12)
 at
net.sf.hibernate.connection.DatasourceConnectionProvider.getConnection(Datas
ourceConnectionProvider.java:59)
 at net.sf.hibernate.impl.BatcherImpl.openConnection(BatcherImpl.java:262)
 at net.sf.hibernate.impl.SessionImpl.connect(SessionImpl.java:3155)
 at net.sf.hibernate.impl.SessionImpl.connection(SessionImpl.java:3138)
 at
net.sf.hibernate.transaction.JDBCTransaction.begin(JDBCTransaction.java:40)

My setup:
tomcat_home\common\lib contains:
commons-dbcp.jar
commons-pool.jar
jdbc2_0-stdext.jar
jndi.jar
mysql-connector-java-3.0.8-stable-bin.jar
hibernate2.jar
etc

Server.xml:
DefaultContext 
 Resource name=jdbc/Salesweb auth=Container
type=javax.sql.DataSource/
 ResourceParams name=jdbc/Salesweb
  parameter
   namefactory/name
   valueorg.apache.commons.dbcp.BasicDataSourceFactory/value
  /parameter
  parameter
   namemaxActive/name
   value100/value
  /parameter
  parameter
   namemaxIdle/name
   value30/value
  /parameter
 

RE: Tomcat 4.1.29 Struts

2003-12-13 Thread David Friedman
Mukund,

What was your problem?  Was it specifying your DTD with periods instead of
underscores in the appropriate places as I pointed out?  Or was there
another problem?

Regards,
David

-Original Message-
From: Mukund Ramadoss [mailto:[EMAIL PROTECTED]
Sent: Monday, December 08, 2003 2:29 PM
To: 'Struts Users Mailing List'
Subject: RE: Tomcat 4.1.29  Struts


Hi David,

Thanks for your mail.

Actually I don't still know what is causing the problem.
Now based on your mail, I've tried with both the following DTDs:

http://jakarta.apache.org/struts/dtds/struts-config_1.0.dtd;struts-conf
ig_1_1.dtd
http://jakarta.apache.org/struts/dtds/struts-config_1.0.dtd;struts-conf
ig_1_0.dtd
The result is same:
org.apache.jasper.JasperException: Cannot find message resources under
key org.apache.struts.action.MESSAGE

Actually when I reload the webapp, I get the following error in my log:

2003-12-08 11:26:07 StandardWrapper[/strutsShop:default]: Loading
container servlet default
2003-12-08 11:26:08 StandardWrapper[/strutsShop:action]: Marking servlet
action as unavailable
2003-12-08 11:26:08 StandardContext[/strutsShop]: Servlet /strutsShop
threw load() exception
javax.servlet.UnavailableException: Parsing error processing resource
path
at
org.apache.struts.action.ActionServlet.handleConfigException(ActionServl
et.java:1035)
at
org.apache.struts.action.ActionServlet.parseModuleConfigFile(ActionServl
et.java:1014)
at
org.apache.struts.action.ActionServlet.initModuleConfig(ActionServlet.ja
va:955)
at
org.apache.struts.action.ActionServlet.init(ActionServlet.java:470)
at javax.servlet.GenericServlet.init(GenericServlet.java:256)
at
org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.jav
a:935)
at
org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:823)
at
org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.j
ava:3422)
at
org.apache.catalina.core.StandardContext.start(StandardContext.java:3623
)
at
org.apache.catalina.startup.HostConfig.checkWebXmlLastModified(HostConfi
g.java:614)
at
org.apache.catalina.startup.HostConfig.run(HostConfig.java:854)
at java.lang.Thread.run(Thread.java:536)

I'm attaching web.xml and struts_config.xml below:
---struts-config.xml -
?xml version=1.0 encoding=ISO-8859-1 ?
!DOCTYPE struts-config PUBLIC
  http://jakarta.apache.org/struts/dtds/struts-config_1_0.dtd;
 struts-config
/struts-config
--web.xml
?xml version=1.0 encoding=ISO-8859-1?

!DOCTYPE web-app
SYSTEM
http://java.sun.com/dtd/web-app_2_3.dtd;

web-app

  servlet
servlet-nameaction/servlet-name

servlet-classorg.apache.struts.action.ActionServlet/servlet-class
init-param
  param-nameapplication/param-name
  param-value/param-value
/init-param
init-param
  param-nameconfig/param-name
  param-value/WEB-INF/struts-config.xml/param-value
/init-param
init-param
  param-namedebug/param-name
  param-value2/param-value
/init-param
init-param
  param-namedetail/param-name
  param-value2/param-value
/init-param
init-param
  param-namevalidate/param-name
  param-valuetrue/param-value
/init-param
load-on-startup2/load-on-startup
  /servlet

  !-- Action Servlet Mapping --
  servlet-mapping
servlet-nameaction/servlet-name
url-pattern/do/*/url-pattern
  /servlet-mapping
  servlet-mapping
servlet-nameinvoker/servlet-name
url-pattern/servlet/*/url-pattern
  /servlet-mapping
  !-- The Welcome File List --
  welcome-file-list
welcome-fileindex.jsp/welcome-file
welcome-fileindex.html/welcome-file
  /welcome-file-list

!-- Struts Tag Library Descriptor --
taglib
   taglib-uri
/WEB-INF/struts-bean.tld
   /taglib-uri
   taglib-location
/WEB-INF/struts-bean.tld
   /taglib-location
/taglib
taglib
   taglib-uri
/WEB-INF/struts-html.tld
   /taglib-uri
   taglib-location
/WEB-INF/struts-html.tld
   /taglib-location
/taglib
taglib
   taglib-uri
/WEB-INF/struts-logic.tld
   /taglib-uri
   taglib-location
/WEB-INF/struts-logic.tld
   /taglib-location
/taglib
taglib
   taglib-uri
/WEB-INF/struts-template.tld
   /taglib-uri
   taglib-location
/WEB-INF/struts-template.tld
   /taglib-location
 /taglib

/web-app


Thanks for your help.

Regards
Mukund

-Original Message-
From: David Friedman [mailto:[EMAIL PROTECTED]
Sent: Saturday, December 06, 2003 2:39 PM
To: Struts Users Mailing List
Subject: RE: Tomcat 4.1.29  Struts


Mukund,

What was your Tomcat 4.1.29 problem?  Was the wrong DTD part of the
problem?

Regards,
David

-Original Message-
From: Mukund Ramadoss [mailto:[EMAIL PROTECTED]
Sent: Thursday, December 04, 2003 7:06 PM
To: 'Struts Users Mailing List'
Subject: Tomcat 4.1.29  Struts


Is anyone working with Struts on Tomcat 4.1.29?
If yes

RE: Tomcat 4.1.29 Struts

2003-12-06 Thread David Friedman
Mukund,

What was your Tomcat 4.1.29 problem?  Was the wrong DTD part of the problem?

Regards,
David

-Original Message-
From: Mukund Ramadoss [mailto:[EMAIL PROTECTED]
Sent: Thursday, December 04, 2003 7:06 PM
To: 'Struts Users Mailing List'
Subject: Tomcat 4.1.29  Struts


Is anyone working with Struts on Tomcat 4.1.29?
If yes, can you provide me some inputs on the installation.

I'm getting org.apache.jasper.JasperException: Cannot find message
resources under key org.apache.struts.action.MESSAGE, when executing
bean:message key=index.title/ in the jsp.

Thanks
Mukund


-Original Message-
From: Mukund Ramadoss [mailto:[EMAIL PROTECTED]
Sent: Thursday, December 04, 2003 9:00 AM
To: 'Struts Users Mailing List'
Subject: RE: org.apache.struts.action.MESSAGE


My attachment got denied.
I'm enclosing it here. Thanks - Mukund
- struts-config.xml
?xml version=1.0 encoding=ISO-8859-1 ?
!DOCTYPE struts-config PUBLIC
  http://jakarta.apache.org/struts/dtds/struts-config_1.0.dtd;
 struts-config
 message-resources
 parameter=ApplicationResources
 key=org.apache.struts.action.MESSAGE null=false / /struts-config
- web.xml
?xml version=1.0 encoding=ISO-8859-1?

!DOCTYPE web-app
SYSTEM
http://java.sun.com/dtd/web-app_2_3.dtd;

web-app

  servlet
servlet-nameaction/servlet-name

servlet-classorg.apache.struts.action.ActionServlet/servlet-class
init-param
  param-nameapplication/param-name
  param-value/param-value
/init-param
init-param
  param-nameconfig/param-name
  param-value/WEB-INF/struts-config.xml/param-value
/init-param
init-param
  param-namedebug/param-name
  param-value2/param-value
/init-param
init-param
  param-namedetail/param-name
  param-value2/param-value
/init-param
init-param
  param-namevalidate/param-name
  param-valuetrue/param-value
/init-param
init-param
   param-nameapplication/param-name
   param-value/param-value
/init-param
load-on-startup2/load-on-startup
  /servlet

  !-- Action Servlet Mapping --
  servlet-mapping
servlet-nameaction/servlet-name
url-pattern/do/*/url-pattern
  /servlet-mapping
  servlet-mapping
servlet-nameinvoker/servlet-name
url-pattern/servlet/*/url-pattern
  /servlet-mapping
  !-- The Welcome File List --
  welcome-file-list
welcome-fileindex.jsp/welcome-file
welcome-fileindex.html/welcome-file
  /welcome-file-list

!-- Struts Tag Library Descriptor --
taglib
   taglib-uri
/WEB-INF/struts-bean.tld
   /taglib-uri
   taglib-location
/WEB-INF/struts-bean.tld
   /taglib-location
/taglib
taglib
   taglib-uri
/WEB-INF/struts-html.tld
   /taglib-uri
   taglib-location
/WEB-INF/struts-html.tld
   /taglib-location
/taglib
taglib
   taglib-uri
/WEB-INF/struts-logic.tld
   /taglib-uri
   taglib-location
/WEB-INF/struts-logic.tld
   /taglib-location
/taglib
taglib
   taglib-uri
/WEB-INF/struts-template.tld
   /taglib-uri
   taglib-location
/WEB-INF/struts-template.tld
   /taglib-location
 /taglib

/web-app



-

-Original Message-
From: Mukund Ramadoss [mailto:[EMAIL PROTECTED]
Sent: Thursday, December 04, 2003 8:55 AM
To: 'Struts Users Mailing List'
Subject: org.apache.struts.action.MESSAGE


Hi,

I'm setting up Struts to work with Tomcat 4.1.29.

When I tried to run a jsp (BookView.jsp) from a tutorial, I get the
following exception :
org.apache.jasper.JasperException: Cannot find message resources under
key org.apache.struts.action.MESSAGE
at
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.ja
va:254)
at
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)


I'm attaching struts-config.xml, web.xml, and BookView.jsp for your
reference.

I've tried copying ApplicationResources.properties from classes to
WEB-INF folder. But the result is same.
Any suggestions?

Thanks
Mukund


-
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: from sathish

2003-12-05 Thread David Friedman
Sathish,

So, you're using Struts (version 1.0?) and your method
signature wasn't working.  When you changed it to
the one I pulled off the struts web site's api, did it
work?

Regards,
David

-Original Message-
From: Sathish Babu K R [mailto:[EMAIL PROTECTED]
Sent: Friday, December 05, 2003 3:58 AM
To: Struts Users Mailing List
Subject: from sathish


hi david

i get session using request.getSession()?y whats  in
it?tell me.

sathish

__
Do you Yahoo!?
Free Pop-Up Blocker - Get it now
http://companion.yahoo.com/

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


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



RE: Tomcat 4.1.29 Struts

2003-12-05 Thread David Friedman
Psst.  I think you have the wrong DTD:

http://jakarta.apache.org/struts/dtds/struts-config_1.0.dtd

Won't resolve for me (I use 1.1 anyway) but this does:
http://jakarta.apache.org/struts/dtds/struts-config_1_0.dtd

Regards,
David


-Original Message-
From: Yee, Richard K,,DMDCWEST [mailto:[EMAIL PROTECTED]
Sent: Friday, December 05, 2003 7:47 PM
To: 'Struts Users Mailing List'
Subject: RE: Tomcat 4.1.29  Struts


Mukund,
Are there any messages in the log file? Are you using log4j and did you set
the logging level to debug? It shouldn't be a Classpath issue if the file is
located in your webapp's WEB-INF/classes directory. That is automatically
put in your apps classpath.

-Richard

-Original Message-
From: Mukund Ramadoss [mailto:[EMAIL PROTECTED]
Sent: Friday, December 05, 2003 4:38 PM
To: 'Struts Users Mailing List'
Subject: RE: Tomcat 4.1.29  Struts


Hi Richard,

Thanks for your mail.
Actually I am running on windows and there is not .txt extenstion.

The filename is ApplicationResources.properties. (not
ApplicationProperties.properties).
Could this be a classpath issue? How do I check.

Thanks again.
Mukund

-Original Message-
From: Richard Yee [mailto:[EMAIL PROTECTED]
Sent: Friday, December 05, 2003 4:30 PM
To: Struts Users Mailing List
Subject: RE: Tomcat 4.1.29  Struts


Mukund,
If you are running on Windows, have you ever edited
the ApplicationProperties.properties file with
notepad? Could it possibly have a .txt extension after
the .properties extension? If you are running on Unix,
is the case correct on the file name?

-Richard

--- Mukund Ramadoss [EMAIL PROTECTED] wrote:
 I removed the key in the struts_config. But still
 the result is the
 same.

 My struts-config looks like this:
 --
 ?xml version=1.0 encoding=ISO-8859-1 ?
 !DOCTYPE struts-config PUBLIC


http://jakarta.apache.org/struts/dtds/struts-config_1.0.dtd;
  struts-config
  message-resources
  parameter=ApplicationResources
  null=false /
 /struts-config
 --

 My ApplicationResources.properties is in
 WEB-INF/classes directory. I
 have also
 Copied it to WEB-INF folder. But still it does not
 pick it up.

 I also tried downloaded xerces.jar to WEB-INF/lib,
 for I read elsewhere
 that it could be a xml parser issue. This does not
 help too.

 Any suggestions.

 Thanks
 Mukund




__
Do you Yahoo!?
Free Pop-Up Blocker - Get it now
http://companion.yahoo.com/

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



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

-
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: from sathish

2003-12-04 Thread David Friedman
Sathish,

Did you resolve your problem yesterday?

If not, how do you request a session?
request.getSession() and request.getSession(true)?

Regards,
David

-Original Message-
From: Sathish Babu K R [mailto:[EMAIL PROTECTED]
Sent: Thursday, December 04, 2003 12:30 AM
To: Struts Users Mailing List
Subject: from sathish


hi david

when i used ur signature

i m not able to get session from ur request.thatz
creating probs.tell me any other sugg

regards
sathish

__
Do you Yahoo!?
Free Pop-Up Blocker - Get it now
http://companion.yahoo.com/

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


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



RE: from sathish

2003-12-03 Thread David Friedman
Sathish,

Your method signature seems incorrect.  According to the javadocs (v1.0),
perform (which is deprecated) requires the following argument types:

public ActionForward perform(ActionMapping mapping,
 ActionForm form,
 javax.servlet.ServletRequest request,
 javax.servlet.ServletResponse response)
  throws java.io.IOException,
 javax.servlet.ServletException

-David

-Original Message-
From: Sathish Babu K R [mailto:[EMAIL PROTECTED]
Sent: Thursday, December 04, 2003 12:05 AM
To: [EMAIL PROTECTED]
Subject: from sathish


hi all

while access to the action class,i m getting the error
as

java.lang.NoSuchMethodError at
com.pronto.web.ModifyGWQueuesAction.perform(Unknown
Source) at
org.apache.struts.action.ActionServlet.processActionPerform(ActionServlet.ja
va:1787)
at
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1586)
at
org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:510)
at
javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
at
javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at com.evermind[Oracle9iAS (9.0.4.0.0) Containers for
J2EE].server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:65)
at
oracle.security.jazn.oc4j.JAZNFilter.doFilter(JAZNFilter.java:293)
at com.evermind[Oracle9iAS (9.0.4.0.0) Containers for
J2EE].server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.j
ava:602)
at com.evermind[Oracle9iAS (9.0.4.0.0) Containers for
J2EE].server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDis
patcher.java:308)
at com.evermind[Oracle9iAS (9.0.4.0.0) Containers for
J2EE].server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:
779)
at com.evermind[Oracle9iAS (9.0.4.0.0) Containers for
J2EE].server.http.HttpRequestHandler.run(HttpRequestHandler.java:264)
at com.evermind[Oracle9iAS (9.0.4.0.0) Containers for
J2EE].server.http.HttpRequestHandler.run(HttpRequestHandler.java:107)
at com.evermind[Oracle9iAS (9.0.4.0.0) Containers for
J2EE].util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourceP
ooledExecutor.java:192)
at java.lang.Thread.run(Thread.java:479)

the action class is

package com.pronto.web ;

import java.io.IOException;
import java.util.Collection;
import java.util.ArrayList;
import javax.ejb.Handle;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
import javax.servlet.http.HttpServletResponse;
import org.apache.struts.action.Action;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.action.ActionServlet;
import
com.pronto.gateway.IPGConfigurationManagerRemote;
import com.pronto.gateway.PGQueueVO;
import com.pronto.util.Debug;

public final class ModifyGWQueuesAction extends Action
{

public ActionForward perform(ActionMapping
mapping,
 ActionForm form,
 HttpServletRequest request,
 HttpServletResponse response)
throws IOException, ServletException {

HttpSession session = request.getSession();
ModifyGWQueuesForm theForm =
(ModifyGWQueuesForm)form;

long x=1,y=2,z=3;
String b1=N,b2=N,b3=N;
float abw1=1,abw2=1,abw3=1;
boolean msg=true;

String button=request.getParameter(Management);
Debug.print(ModifyGWQueuesAction : perform() --
Button Clicked:  + button);

if(Save.equals(button))
{
String queuename = theForm.getqueuename();
Debug.print(ModifyGWQueuesAction : perform() --
Queue Name1 :  + queuename);

String queuename1 = theForm.getqueuename1();
Debug.print(ModifyGWQueuesAction : perform() --
Queue Name2 :  + queuename1);

String queuename2 = theForm.getqueuename2();
Debug.print(ModifyGWQueuesAction : perform() --
Queue Name3 :  + queuename2);

String queuebandwidth =
theForm.getqueuebandwidth();
Debug.print(ModifyGWQueuesAction : perform() --
Queue Bandwidth1 :  + queuebandwidth);
abw1=(new Float(queuebandwidth)).floatValue();

String queuebandwidth1 =
theForm.getqueuebandwidth1();
Debug.print(ModifyGWQueuesAction : perform() --
Queue Bandwidth2 :  + queuebandwidth1);
abw2=(new Float(queuebandwidth1)).floatValue();

String queuebandwidth2 =
theForm.getqueuebandwidth2();
Debug.print(ModifyGWQueuesAction : perform() --
Queue Bandwidth3 :  + 

RE: logic iterate

2003-12-01 Thread David Friedman
Are you trying to do this to save space:

value1 value2 value3
value4 value5 value6
value7 value8 value9

Or this to show 3 properties of any one bean at a time:

bean1.value1 bean1.value2 bean1.value3
bean2.value1 bean2.value2 bean2.value3
bean3.value1 bean3.value2 bean3.value3

Regards,
David

-Original Message-
From: Naveen S. Kumar [mailto:[EMAIL PROTECTED]
Sent: Monday, December 01, 2003 2:02 AM
To: Struts Users Mailing List
Subject: RE: logic iterate


No, in the same page i have to display
tr
td value1/tdtd value2 /tdtd value3 /td
tr
for the next 3 values i should display in next row.using logic iterate and
only with struts not with jstl.
thanks
naveen.

-Original Message-
From: David Friedman [mailto:[EMAIL PROTECTED]
Sent: Monday, December 01, 2003 12:24 PM
To: Struts Users Mailing List
Subject: RE: logic iterate


Are you talking about pagination?  Show 3 on a page and then skip to the
next page?  Sounds like you want the displaytag taglib.  This examples does
10 items per page: http://www.displaytag.org/example-paging.jsp

Regards,
David

-Original Message-
From: Naveen S. Kumar [mailto:[EMAIL PROTECTED]
Sent: Monday, December 01, 2003 1:43 AM
To: Struts Users Mailing List
Subject: logic iterate


hi,
how do i break the row according the number of data displayed, i.e i have 3
values in a row after 3 rows i have to go next row for display how can i do
using only struts without scriptlets. any example or link would be great
help for me
thanks
naveen.

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


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


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


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



RE: Error creating form bean

2003-12-01 Thread David Friedman
Just to be explicit, you have a file in tomcat as:
WEB-INF/classes/com/ponyprinting/web/manager/UploadForm.class ?

Regards,
David

-Original Message-
From: Sasha Borodin [mailto:[EMAIL PROTECTED]
Sent: Monday, December 01, 2003 7:22 PM
To: Struts Users Mailing List
Subject: Re: Error creating form bean


Attention Todd Thorner! :-)

It look like you had  very similar problem, but I saw no replies to your
post.  Did you ever get this fixed:

http://www.mail-archive.com/[EMAIL PROTECTED]/msg86103.html

I'm working under an extreme deadline, please help :-(

-
Howdy,

I'm having a bizarre problem with a new ActionForm I've just created: when I
hit a jsp that uses this form, the RequestUtils say there's an error
creating
form bean of my class.

2003-12-01 17:01:33,432 [Thread-2] ERROR org.apache.struts.util.RequestUtils

Error creating form bean of class com.ponyprinting.web.manager.UploadForm
java.lang.ClassNotFoundException: com.ponyprinting.web.manager.UploadForm

The class file is there (I checked the build directory that tomcat's being
pointed to for docBase of my web app).  And it obviously compiled fine.

Sigh. It's the little problems that take up 80% of the time :-(

Please help!  Thank you,

-Sasha Borodin


-
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: FormFile not re-populated

2003-12-01 Thread David Friedman
Since you mentioned FormFiles and failed validations, I'd like to share
something:  It's a pain that you lose the uploaded file if the form
validation fails.  I decided to make my validation screen do a special
message to please upload the files again because form Validation failed IF
any files were uploaded.  My problem was: how do you detect if files were
uploaded?  I chose to examine my ActionForm's FormFile fields and count the
total bytes.  IF it's zero, nothing was uploaded so I won't show the
reminder to re-attach the files.

Does anyone have a better method for dealing with losing files on Validation
failure?

Thanks for any constructive feedback,
David

-Original Message-
From: James Mitchell [mailto:[EMAIL PROTECTED]
Sent: Monday, December 01, 2003 1:30 PM
To: Struts Users Mailing List
Subject: Re: FormFile not re-populated


On Mon, 1 Dec 2003, Sharmila Pandith wrote:

 Hi,

 I am using FormFile and after it is validated it must be displayed on the
 next JSP. However, the field is blank. When I look at the source in IE6, I
 see the file name without the directory. But even that is not displayed.

 Any thoughts?


Yes, basically, you cannot expect to pre-fill an input field of type
file (html file upload box with browse button).  It is not supported in
all browsers and those that do, prompt the user to so they can cancel the
field value or the form all-together.

You would be better off doing something like this:
1. Show page (with file upload button), and ask the user if they want
   to upload additional files (radio button or something)
2. If yes, then after that page is processed, show it again, only this
   time with file listed off to the side (similar to how a summary view
   of a shopping cart might do)
3. If no, then move along with your wizard.

Does that help?




 S P

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



--
James Mitchell
Software Developer / Struts Evangelist
http://www.struts-atlanta.org


-
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: Error creating form bean

2003-12-01 Thread David Friedman
Yep.  That was the first thing I noticed when I read your email after
dinner: 'form' :)

Regards,
David

-Original Message-
From: Sasha Borodin [mailto:[EMAIL PROTECTED]
Sent: Monday, December 01, 2003 7:45 PM
To: Struts Users Mailing List
Subject: Re: Error creating form bean


And I think you just found my problem - it was a small typo:

In struts-config, I had:

type=com.ponyprinting.web.manager.UploadForm /

Instead of:

type=com.ponyprinting.web.manager.forms.UploadForm /

Thanks a lot David!  Sorry to bother the list with such a stupid mistake.
But when you've been looking at something for 15 hours...

-Sasha


On 12/1/03 6:38 PM, Sasha Borodin [EMAIL PROTECTED] wrote:

 Just to be explicit, you have a file in tomcat as:
 WEB-INF/classes/com/ponyprinting/web/manager/UploadForm.class ?

 Yep.

 WEB-INF/classes/com/ponyprinting/web/manager/forms/UploadForm.class

 ...just to be precise.

 Thanks,

 -Sasha

 On 12/1/03 6:27 PM, David Friedman [EMAIL PROTECTED] wrote:

 Just to be explicit, you have a file in tomcat as:
 WEB-INF/classes/com/ponyprinting/web/manager/UploadForm.class ?

 Regards,
 David

 -Original Message-
 From: Sasha Borodin [mailto:[EMAIL PROTECTED]
 Sent: Monday, December 01, 2003 7:22 PM
 To: Struts Users Mailing List
 Subject: Re: Error creating form bean


 Attention Todd Thorner! :-)

 It look like you had  very similar problem, but I saw no replies to your
 post.  Did you ever get this fixed:

 http://www.mail-archive.com/[EMAIL PROTECTED]/msg86103.html

 I'm working under an extreme deadline, please help :-(

 -
 Howdy,

 I'm having a bizarre problem with a new ActionForm I've just created:
when I
 hit a jsp that uses this form, the RequestUtils say there's an error
 creating
 form bean of my class.

 2003-12-01 17:01:33,432 [Thread-2] ERROR
org.apache.struts.util.RequestUtils

 Error creating form bean of class com.ponyprinting.web.manager.UploadForm
 java.lang.ClassNotFoundException: com.ponyprinting.web.manager.UploadForm

 The class file is there (I checked the build directory that tomcat's
being
 pointed to for docBase of my web app).  And it obviously compiled fine.

 Sigh. It's the little problems that take up 80% of the time :-(

 Please help!  Thank you,

 -Sasha Borodin


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


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


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


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


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



RE: Can only redirect when forward path only has directories

2003-12-01 Thread David Friedman
You might want to check your web server configuration to see if the
directory index knows to show the index.jsp as the index page or to do
something else, such as redirect to an error page or a particular page.
What is your web server?

Regards,
David

-Original Message-
From: Bessette [mailto:[EMAIL PROTECTED]
Sent: Monday, December 01, 2003 10:30 PM
To: [EMAIL PROTECTED]
Subject: Can only redirect when forward path only has directories


After days of trying to figure out why my actions wouldn't forward, only
redirect, I finally narrowed down the problem.

If I use a forward path of /dir1/dir2 the action will always redirect, no
matter what the redirect value of the forward is.  However, if I use
/dir1/dir2/index.jsp then the action will redirect or forward correctly
depending on the value.

This seems like a bug to me.  Is there any reason why this should happen?
It doesn't really matter to me, since the action uri is displayed in the
address bar, but it seems very odd.

Thanks,
Eric


-
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: org.apache.struts.legacy.GenericDataSource

2003-11-30 Thread David Friedman
Rajat,

I haven't had any problems with DBCP.  It's just that a different pool came
with Hibernate that I used in production by default.  I'm using DBCP in
testing but I always close my development computer (my desktop) down at
night so I have no comments on how DBCP works in reality.  I'm sure it's
fine in production.

Regards,
David

-Original Message-
From: Rajat Pandit [mailto:[EMAIL PROTECTED]
Sent: Sunday, November 30, 2003 1:13 AM
To: Struts Users Mailing List
Subject: Re: org.apache.struts.legacy.GenericDataSource


hey david,
thanks a lot!, just one last question, what kind of troubles did u have
with DBCP. coz this will be used in production so i want to know what to
expect, however a refactoring is schedule anyway but not anytime sooner.
thanks once again!


David Friedman wrote:
 Rajit,

 I don't use the Struts DataSource because I had to much trouble with it a
 few months ago.  However, the commons DBCP expains all parameters here:
 http://jakarta.apache.org/commons/dbcp/configuration.html

 You should be able to set any of them in your struts-config.xml
data-source
 entry with this syntax:

 set-property
   property=minIdle
   value=XXX /

 I checked my testing and production environments and I forgot I've
switched
 away from DBCP to C3P0 (it comes with Hibernate).  However, I'd recommend
 the options (listed in the above mentioned web page):

 validationQuery set to select 1+1 works in MySQL and returns 1 row
 testWhileIdle set to true
 timeBetweenEvictionRunsMillis set to 180 (1000 miliseconds * 60
 seconds * 30 minutes)
 testOnBorrow set to true
 minIdle set to 2 (or higher)

 Regards,
 David

 -Original Message-
 From: Rajat Pandit [mailto:[EMAIL PROTECTED]
 Sent: Saturday, November 29, 2003 2:14 PM
 To: Struts Users Mailing List
 Subject: Re: org.apache.struts.legacy.GenericDataSource


 hello david,
 thanks for the quick reply, could u pls mail me the extract of the
 data-source which worked fr u. along all with the settings. (u can
 ofcourse remove the l/p :P )
 this would be a great help! and have u have the kind of sucess with DBCP
 in dealing with connection pool and idle connections?
 thanks!

 David Friedman wrote:


Rajat,

I've had that type of disconnect problem using Hibernate (a product

 roughly

like Ibatis).  My problem was one of the DBCP settings: minIdle.  MySQL
wasn't seeing any activity on some pool connections overnight, so it was
disconnecting them.  Lowering the minIdle setting seemed to cause DBCP to
test each pool connection by performing a simple select automatically.

 The

query seems to be a non-table select, along the lines of a 'select 1+1;'.
That allowed MySQL to keep each connection active and not disconnect any
overnight after being idle for hours.

Regards,
David

-Original Message-
From: Rajat Pandit [mailto:[EMAIL PROTECTED]
Sent: Saturday, November 29, 2003 12:44 PM
To: Struts Users Mailing List
Subject: org.apache.struts.legacy.GenericDataSource


hello gurus,
i have an terrible terrible problem with my application, after hosting
this application it stops to work after 8-10hrs of idle state. then the
server has to restart and then its fine again.

i learnt that the mysql driver disconects after 8hrs of an idle
connection so i addred autoreconnect=true to the connection url. however
the problem doesnt seem to get sovled. just extended fro another another
and then the same problem again.
i need to  know how to remove org.apache.struts.legacy.GenericDataSource
and use the connection from DBCP (commons lib ie.) and will i need to
change the settings in the code (struts-config.xml) i also am thinking
of refactoring the entire codebase usng iBatis. will it solve this issue?

pls help! i need this project to be up and running in the next week.
thanks once again
the logs follows.



NFO:Return allocated connection, activeCount=2, useCount=1
Nov 28, 2003 8:00:15 PM com.hedging.HedgeUser validUser
INFO: -- Error: Communication link failure: java.io.IOException--
Nov 28, 2003 8:00:15 PM org.apache.struts.legacy.GenericDataSource
returnConnection
INFO:   releaseConnection(), activeCount=2, useCount=0
Nov 28, 2003 8:00:30 PM org.apache.jk.common.ChannelSocket

 processConnection

INFO: connection timeout reached
Nov 28, 2003 8:00:33 PM org.apache.jk.common.ChannelSocket

 processConnection

INFO: connection timeout reached
Nov 28, 2003 8:00:35 PM org.apache.jk.common.ChannelSocket

 processConnection

INFO: connection timeout reached
Nov 28, 2003 8:00:36 PM org.apache.jk.common.ChannelSocket

 processConnection

INFO: connection timeout reached
Nov 29, 2003 12:33:42 AM org.apache.jk.common.ChannelSocket
processConnection
INFO: connection timeout reached
Nov 29, 2003 12:33:47 AM org.apache.jk.common.ChannelSocket
processConnection
INFO: connection timeout reached
Nov 29, 2003 12:33:58 AM org.apache.struts.legacy.GenericDataSource
getConnection
INFO:   getConnection()
Nov 29, 2003 12:33:58 AM

RE: Representing Existing Objects In Forms

2003-11-30 Thread David Friedman
Toby,

Where is your trouble?  Do you not understand ActionForms?  Are you worried
about how to transfer the data submitted and auto-populated into the
ActionForm into your business logic?  Or is something else confusing you?

Regards,
David

-Original Message-
From: Toby Saville [mailto:[EMAIL PROTECTED]
Sent: Sunday, November 30, 2003 6:30 PM
To: Struts Users Mailing List
Subject: Representing Existing Objects In Forms


hello all,

I am wanting to represent an existing object using a form and was wondering
how to do this.

My situation is displaying a customer's details in a form for the purpose of
allowing them to update them.

I cant think how I can populate the form tho.

Im new to struts and this list so i apolagise if this has already been
answered.

Thanks,

toby

-Original Message-
From: David Friedman [mailto:[EMAIL PROTECTED]
Sent: Monday, 1 December 2003 8:35 AM
To: Struts Users Mailing List
Subject: RE: org.apache.struts.legacy.GenericDataSource


Rajat,

I haven't had any problems with DBCP.  It's just that a different pool came
with Hibernate that I used in production by default.  I'm using DBCP in
testing but I always close my development computer (my desktop) down at
night so I have no comments on how DBCP works in reality.  I'm sure it's
fine in production.

Regards,
David

-Original Message-
From: Rajat Pandit [mailto:[EMAIL PROTECTED]
Sent: Sunday, November 30, 2003 1:13 AM
To: Struts Users Mailing List
Subject: Re: org.apache.struts.legacy.GenericDataSource


hey david,
thanks a lot!, just one last question, what kind of troubles did u have
with DBCP. coz this will be used in production so i want to know what to
expect, however a refactoring is schedule anyway but not anytime sooner.
thanks once again!


David Friedman wrote:
 Rajit,

 I don't use the Struts DataSource because I had to much trouble with it a
 few months ago.  However, the commons DBCP expains all parameters here:
 http://jakarta.apache.org/commons/dbcp/configuration.html

 You should be able to set any of them in your struts-config.xml
data-source
 entry with this syntax:

 set-property
   property=minIdle
   value=XXX /

 I checked my testing and production environments and I forgot I've
switched
 away from DBCP to C3P0 (it comes with Hibernate).  However, I'd recommend
 the options (listed in the above mentioned web page):

 validationQuery set to select 1+1 works in MySQL and returns 1 row
 testWhileIdle set to true
 timeBetweenEvictionRunsMillis set to 180 (1000 miliseconds * 60
 seconds * 30 minutes)
 testOnBorrow set to true
 minIdle set to 2 (or higher)

 Regards,
 David

 -Original Message-
 From: Rajat Pandit [mailto:[EMAIL PROTECTED]
 Sent: Saturday, November 29, 2003 2:14 PM
 To: Struts Users Mailing List
 Subject: Re: org.apache.struts.legacy.GenericDataSource


 hello david,
 thanks for the quick reply, could u pls mail me the extract of the
 data-source which worked fr u. along all with the settings. (u can
 ofcourse remove the l/p :P )
 this would be a great help! and have u have the kind of sucess with DBCP
 in dealing with connection pool and idle connections?
 thanks!

 David Friedman wrote:


Rajat,

I've had that type of disconnect problem using Hibernate (a product

 roughly

like Ibatis).  My problem was one of the DBCP settings: minIdle.  MySQL
wasn't seeing any activity on some pool connections overnight, so it was
disconnecting them.  Lowering the minIdle setting seemed to cause DBCP to
test each pool connection by performing a simple select automatically.

 The

query seems to be a non-table select, along the lines of a 'select 1+1;'.
That allowed MySQL to keep each connection active and not disconnect any
overnight after being idle for hours.

Regards,
David

-Original Message-
From: Rajat Pandit [mailto:[EMAIL PROTECTED]
Sent: Saturday, November 29, 2003 12:44 PM
To: Struts Users Mailing List
Subject: org.apache.struts.legacy.GenericDataSource


hello gurus,
i have an terrible terrible problem with my application, after hosting
this application it stops to work after 8-10hrs of idle state. then the
server has to restart and then its fine again.

i learnt that the mysql driver disconects after 8hrs of an idle
connection so i addred autoreconnect=true to the connection url. however
the problem doesnt seem to get sovled. just extended fro another another
and then the same problem again.
i need to  know how to remove org.apache.struts.legacy.GenericDataSource
and use the connection from DBCP (commons lib ie.) and will i need to
change the settings in the code (struts-config.xml) i also am thinking
of refactoring the entire codebase usng iBatis. will it solve this issue?

pls help! i need this project to be up and running in the next week.
thanks once again
the logs follows.



NFO:Return allocated connection, activeCount=2, useCount=1
Nov 28, 2003 8:00:15 PM com.hedging.HedgeUser validUser
INFO: -- Error: Communication link failure

RE: Representing Existing Objects In Forms

2003-11-30 Thread David Friedman
Toby,

You could:

a) Have a Password field in your ActionForm.  Then, you could lookup the
password, copy it into the ActionForm, and have the ActionForm display it in
your JSP when you show a html:text property=password/ field.

b) Save the password in a bean and print it out with a bean:write ... /
statement so it is only viewable (read-only)

c) use an html:text name=someRequestOrSessionBean property=password /
so you could save your own bean into the request or session scope then
display it as a text box.  If you want it to be submitted to a form, you
probably want to make sure that whatever action it submits to has a field
with the same property name (in this case password).

I think there are other methods but these are the ones I know and use.
Probably because the Struts examples showed me how (hint, hint!). :)

Regards,
David

-Original Message-
From: Toby Saville [mailto:[EMAIL PROTECTED]
Sent: Sunday, November 30, 2003 7:35 PM
To: Struts Users Mailing List
Subject: RE: Representing Existing Objects In Forms


David,

Perhaps I dont understand the full capabilities of ActionForms.

I am fine with creating a new customer from the contents of a form. But
after this is done (and, for eg, the user has used parts of the site) and
they decide to change their email address, how can i display (in the form)
the password they entered when they registered in order to let them modify
it?

thanks,

toby.

-Original Message-
From: David Friedman [mailto:[EMAIL PROTECTED]
Sent: Monday, 1 December 2003 11:25 AM
To: Struts Users Mailing List
Subject: RE: Representing Existing Objects In Forms


Toby,

Where is your trouble?  Do you not understand ActionForms?  Are you worried
about how to transfer the data submitted and auto-populated into the
ActionForm into your business logic?  Or is something else confusing you?

Regards,
David

-Original Message-
From: Toby Saville [mailto:[EMAIL PROTECTED]
Sent: Sunday, November 30, 2003 6:30 PM
To: Struts Users Mailing List
Subject: Representing Existing Objects In Forms


hello all,

I am wanting to represent an existing object using a form and was wondering
how to do this.

My situation is displaying a customer's details in a form for the purpose of
allowing them to update them.

I cant think how I can populate the form tho.

Im new to struts and this list so i apolagise if this has already been
answered.

Thanks,

toby

-Original Message-
From: David Friedman [mailto:[EMAIL PROTECTED]
Sent: Monday, 1 December 2003 8:35 AM
To: Struts Users Mailing List
Subject: RE: org.apache.struts.legacy.GenericDataSource


Rajat,

I haven't had any problems with DBCP.  It's just that a different pool came
with Hibernate that I used in production by default.  I'm using DBCP in
testing but I always close my development computer (my desktop) down at
night so I have no comments on how DBCP works in reality.  I'm sure it's
fine in production.

Regards,
David

-Original Message-
From: Rajat Pandit [mailto:[EMAIL PROTECTED]
Sent: Sunday, November 30, 2003 1:13 AM
To: Struts Users Mailing List
Subject: Re: org.apache.struts.legacy.GenericDataSource


hey david,
thanks a lot!, just one last question, what kind of troubles did u have
with DBCP. coz this will be used in production so i want to know what to
expect, however a refactoring is schedule anyway but not anytime sooner.
thanks once again!


David Friedman wrote:
 Rajit,

 I don't use the Struts DataSource because I had to much trouble with it a
 few months ago.  However, the commons DBCP expains all parameters here:
 http://jakarta.apache.org/commons/dbcp/configuration.html

 You should be able to set any of them in your struts-config.xml
data-source
 entry with this syntax:

 set-property
   property=minIdle
   value=XXX /

 I checked my testing and production environments and I forgot I've
switched
 away from DBCP to C3P0 (it comes with Hibernate).  However, I'd recommend
 the options (listed in the above mentioned web page):

 validationQuery set to select 1+1 works in MySQL and returns 1 row
 testWhileIdle set to true
 timeBetweenEvictionRunsMillis set to 180 (1000 miliseconds * 60
 seconds * 30 minutes)
 testOnBorrow set to true
 minIdle set to 2 (or higher)

 Regards,
 David

 -Original Message-
 From: Rajat Pandit [mailto:[EMAIL PROTECTED]
 Sent: Saturday, November 29, 2003 2:14 PM
 To: Struts Users Mailing List
 Subject: Re: org.apache.struts.legacy.GenericDataSource


 hello david,
 thanks for the quick reply, could u pls mail me the extract of the
 data-source which worked fr u. along all with the settings. (u can
 ofcourse remove the l/p :P )
 this would be a great help! and have u have the kind of sucess with DBCP
 in dealing with connection pool and idle connections?
 thanks!

 David Friedman wrote:


Rajat,

I've had that type of disconnect problem using Hibernate (a product

 roughly

like Ibatis).  My problem was one of the DBCP settings: minIdle.  MySQL
wasn't

RE: Representing Existing Objects In Forms

2003-11-30 Thread David Friedman
Toby,

In your action, you can cast the ActionForm to the right type of form, then
use the set/get methods.

If your ActionForm is of type eg.FirstForm, in your Action's execute (or
perform if you're using an older verions of Struts) you can:

eg.FirstForm myForm = (eg.FirstForm) form;
myForm.setPassword( someFunctionThatReturnsTheUsersPassword() );

That stores the password for display using the html:form ... / tag
html:text property=password/, ASSUMING your eg.FirstForm ActionForm has
a getPassword property.  There should be good examples in the struts example
.wars.

Regards,
David

-Original Message-
From: Toby Saville [mailto:[EMAIL PROTECTED]
Sent: Sunday, November 30, 2003 8:20 PM
To: Struts Users Mailing List
Subject: RE: Representing Existing Objects In Forms


David,

Thanks for your assistance.

I suppose im wondering if there is a way to set the values of my ActionForm
implementation variables(CustomerForm in my case) before the form is
displayed, thus automatically populating the form when it is displayed.

I am able to set the values of my form bean (CustomerForm) in its
constructor. But to do what i want, i need to have access to the request
object in order to get a cookie value.

Perhaps I should just use your first suggestiong in order to achieve this.
-Original Message-
From: David Friedman [mailto:[EMAIL PROTECTED]
Sent: Monday, 1 December 2003 12:03 PM
To: Struts Users Mailing List
Subject: RE: Representing Existing Objects In Forms


Toby,

You could:

a) Have a Password field in your ActionForm.  Then, you could lookup the
password, copy it into the ActionForm, and have the ActionForm display it in
your JSP when you show a html:text property=password/ field.

b) Save the password in a bean and print it out with a bean:write ... /
statement so it is only viewable (read-only)

c) use an html:text name=someRequestOrSessionBean property=password /
so you could save your own bean into the request or session scope then
display it as a text box.  If you want it to be submitted to a form, you
probably want to make sure that whatever action it submits to has a field
with the same property name (in this case password).

I think there are other methods but these are the ones I know and use.
Probably because the Struts examples showed me how (hint, hint!). :)

Regards,
David

-Original Message-
From: Toby Saville [mailto:[EMAIL PROTECTED]
Sent: Sunday, November 30, 2003 7:35 PM
To: Struts Users Mailing List
Subject: RE: Representing Existing Objects In Forms


David,

Perhaps I dont understand the full capabilities of ActionForms.

I am fine with creating a new customer from the contents of a form. But
after this is done (and, for eg, the user has used parts of the site) and
they decide to change their email address, how can i display (in the form)
the password they entered when they registered in order to let them modify
it?

thanks,

toby.

-Original Message-
From: David Friedman [mailto:[EMAIL PROTECTED]
Sent: Monday, 1 December 2003 11:25 AM
To: Struts Users Mailing List
Subject: RE: Representing Existing Objects In Forms


Toby,

Where is your trouble?  Do you not understand ActionForms?  Are you worried
about how to transfer the data submitted and auto-populated into the
ActionForm into your business logic?  Or is something else confusing you?

Regards,
David

-Original Message-
From: Toby Saville [mailto:[EMAIL PROTECTED]
Sent: Sunday, November 30, 2003 6:30 PM
To: Struts Users Mailing List
Subject: Representing Existing Objects In Forms


hello all,

I am wanting to represent an existing object using a form and was wondering
how to do this.

My situation is displaying a customer's details in a form for the purpose of
allowing them to update them.

I cant think how I can populate the form tho.

Im new to struts and this list so i apolagise if this has already been
answered.

Thanks,

toby

-Original Message-
From: David Friedman [mailto:[EMAIL PROTECTED]
Sent: Monday, 1 December 2003 8:35 AM
To: Struts Users Mailing List
Subject: RE: org.apache.struts.legacy.GenericDataSource


Rajat,

I haven't had any problems with DBCP.  It's just that a different pool came
with Hibernate that I used in production by default.  I'm using DBCP in
testing but I always close my development computer (my desktop) down at
night so I have no comments on how DBCP works in reality.  I'm sure it's
fine in production.

Regards,
David

-Original Message-
From: Rajat Pandit [mailto:[EMAIL PROTECTED]
Sent: Sunday, November 30, 2003 1:13 AM
To: Struts Users Mailing List
Subject: Re: org.apache.struts.legacy.GenericDataSource


hey david,
thanks a lot!, just one last question, what kind of troubles did u have
with DBCP. coz this will be used in production so i want to know what to
expect, however a refactoring is schedule anyway but not anytime sooner.
thanks once again!


David Friedman wrote:
 Rajit,

 I don't use the Struts DataSource because I had to much

RE: logic iterate

2003-11-30 Thread David Friedman
Are you talking about pagination?  Show 3 on a page and then skip to the
next page?  Sounds like you want the displaytag taglib.  This examples does
10 items per page: http://www.displaytag.org/example-paging.jsp

Regards,
David

-Original Message-
From: Naveen S. Kumar [mailto:[EMAIL PROTECTED]
Sent: Monday, December 01, 2003 1:43 AM
To: Struts Users Mailing List
Subject: logic iterate


hi,
how do i break the row according the number of data displayed, i.e i have 3
values in a row after 3 rows i have to go next row for display how can i do
using only struts without scriptlets. any example or link would be great
help for me
thanks
naveen.

-
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: org.apache.struts.legacy.GenericDataSource

2003-11-29 Thread David Friedman
Rajat,

I've had that type of disconnect problem using Hibernate (a product roughly
like Ibatis).  My problem was one of the DBCP settings: minIdle.  MySQL
wasn't seeing any activity on some pool connections overnight, so it was
disconnecting them.  Lowering the minIdle setting seemed to cause DBCP to
test each pool connection by performing a simple select automatically.  The
query seems to be a non-table select, along the lines of a 'select 1+1;'.
That allowed MySQL to keep each connection active and not disconnect any
overnight after being idle for hours.

Regards,
David

-Original Message-
From: Rajat Pandit [mailto:[EMAIL PROTECTED]
Sent: Saturday, November 29, 2003 12:44 PM
To: Struts Users Mailing List
Subject: org.apache.struts.legacy.GenericDataSource


hello gurus,
i have an terrible terrible problem with my application, after hosting
this application it stops to work after 8-10hrs of idle state. then the
server has to restart and then its fine again.

i learnt that the mysql driver disconects after 8hrs of an idle
connection so i addred autoreconnect=true to the connection url. however
the problem doesnt seem to get sovled. just extended fro another another
and then the same problem again.
i need to  know how to remove org.apache.struts.legacy.GenericDataSource
and use the connection from DBCP (commons lib ie.) and will i need to
change the settings in the code (struts-config.xml) i also am thinking
of refactoring the entire codebase usng iBatis. will it solve this issue?

pls help! i need this project to be up and running in the next week.
thanks once again
the logs follows.



NFO:Return allocated connection, activeCount=2, useCount=1
Nov 28, 2003 8:00:15 PM com.hedging.HedgeUser validUser
INFO: -- Error: Communication link failure: java.io.IOException--
Nov 28, 2003 8:00:15 PM org.apache.struts.legacy.GenericDataSource
returnConnection
INFO:   releaseConnection(), activeCount=2, useCount=0
Nov 28, 2003 8:00:30 PM org.apache.jk.common.ChannelSocket processConnection
INFO: connection timeout reached
Nov 28, 2003 8:00:33 PM org.apache.jk.common.ChannelSocket processConnection
INFO: connection timeout reached
Nov 28, 2003 8:00:35 PM org.apache.jk.common.ChannelSocket processConnection
INFO: connection timeout reached
Nov 28, 2003 8:00:36 PM org.apache.jk.common.ChannelSocket processConnection
INFO: connection timeout reached
Nov 29, 2003 12:33:42 AM org.apache.jk.common.ChannelSocket
processConnection
INFO: connection timeout reached
Nov 29, 2003 12:33:47 AM org.apache.jk.common.ChannelSocket
processConnection
INFO: connection timeout reached
Nov 29, 2003 12:33:58 AM org.apache.struts.legacy.GenericDataSource
getConnection
INFO:   getConnection()
Nov 29, 2003 12:33:58 AM org.apache.struts.legacy.GenericDataSource
getConnection
INFO:Check for timeout, activeCount=2, useCount=0
Nov 29, 2003 12:33:58 AM org.apache.struts.legacy.GenericDataSource
getConnection
INFO:Found available connection
Nov 29, 2003 12:33:58 AM org.apache.struts.legacy.GenericDataSource
getConnection
INFO:Return allocated connection, activeCount=2, useCount=1
Nov 29, 2003 12:33:58 AM com.hedging.HedgeUser validUser
INFO: -- Error: No operations allowed after connection closed--
Nov 29, 2003 12:33:58 AM org.apache.struts.legacy.GenericDataSource
returnConnection
INFO:   releaseConnection(), activeCount=2, useCount=0
Nov 29, 2003 12:34:18 AM org.apache.jk.common.ChannelSocket
processConnection
--


Rajat Pandit | [EMAIL PROTECTED]
+91 612 3117606
[ Developer and Part Time Human Being]



-
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: org.apache.struts.legacy.GenericDataSource

2003-11-29 Thread David Friedman
Rajit,

I don't use the Struts DataSource because I had to much trouble with it a
few months ago.  However, the commons DBCP expains all parameters here:
http://jakarta.apache.org/commons/dbcp/configuration.html

You should be able to set any of them in your struts-config.xml data-source
entry with this syntax:

set-property
  property=minIdle
  value=XXX /

I checked my testing and production environments and I forgot I've switched
away from DBCP to C3P0 (it comes with Hibernate).  However, I'd recommend
the options (listed in the above mentioned web page):

validationQuery set to select 1+1 works in MySQL and returns 1 row
testWhileIdle set to true
timeBetweenEvictionRunsMillis set to 180 (1000 miliseconds * 60
seconds * 30 minutes)
testOnBorrow set to true
minIdle set to 2 (or higher)

Regards,
David

-Original Message-
From: Rajat Pandit [mailto:[EMAIL PROTECTED]
Sent: Saturday, November 29, 2003 2:14 PM
To: Struts Users Mailing List
Subject: Re: org.apache.struts.legacy.GenericDataSource


hello david,
thanks for the quick reply, could u pls mail me the extract of the
data-source which worked fr u. along all with the settings. (u can
ofcourse remove the l/p :P )
this would be a great help! and have u have the kind of sucess with DBCP
in dealing with connection pool and idle connections?
thanks!

David Friedman wrote:

 Rajat,

 I've had that type of disconnect problem using Hibernate (a product
roughly
 like Ibatis).  My problem was one of the DBCP settings: minIdle.  MySQL
 wasn't seeing any activity on some pool connections overnight, so it was
 disconnecting them.  Lowering the minIdle setting seemed to cause DBCP to
 test each pool connection by performing a simple select automatically.
The
 query seems to be a non-table select, along the lines of a 'select 1+1;'.
 That allowed MySQL to keep each connection active and not disconnect any
 overnight after being idle for hours.

 Regards,
 David

 -Original Message-
 From: Rajat Pandit [mailto:[EMAIL PROTECTED]
 Sent: Saturday, November 29, 2003 12:44 PM
 To: Struts Users Mailing List
 Subject: org.apache.struts.legacy.GenericDataSource


 hello gurus,
 i have an terrible terrible problem with my application, after hosting
 this application it stops to work after 8-10hrs of idle state. then the
 server has to restart and then its fine again.

 i learnt that the mysql driver disconects after 8hrs of an idle
 connection so i addred autoreconnect=true to the connection url. however
 the problem doesnt seem to get sovled. just extended fro another another
 and then the same problem again.
 i need to  know how to remove org.apache.struts.legacy.GenericDataSource
 and use the connection from DBCP (commons lib ie.) and will i need to
 change the settings in the code (struts-config.xml) i also am thinking
 of refactoring the entire codebase usng iBatis. will it solve this issue?

 pls help! i need this project to be up and running in the next week.
 thanks once again
 the logs follows.



 NFO:Return allocated connection, activeCount=2, useCount=1
 Nov 28, 2003 8:00:15 PM com.hedging.HedgeUser validUser
 INFO: -- Error: Communication link failure: java.io.IOException--
 Nov 28, 2003 8:00:15 PM org.apache.struts.legacy.GenericDataSource
 returnConnection
 INFO:   releaseConnection(), activeCount=2, useCount=0
 Nov 28, 2003 8:00:30 PM org.apache.jk.common.ChannelSocket
processConnection
 INFO: connection timeout reached
 Nov 28, 2003 8:00:33 PM org.apache.jk.common.ChannelSocket
processConnection
 INFO: connection timeout reached
 Nov 28, 2003 8:00:35 PM org.apache.jk.common.ChannelSocket
processConnection
 INFO: connection timeout reached
 Nov 28, 2003 8:00:36 PM org.apache.jk.common.ChannelSocket
processConnection
 INFO: connection timeout reached
 Nov 29, 2003 12:33:42 AM org.apache.jk.common.ChannelSocket
 processConnection
 INFO: connection timeout reached
 Nov 29, 2003 12:33:47 AM org.apache.jk.common.ChannelSocket
 processConnection
 INFO: connection timeout reached
 Nov 29, 2003 12:33:58 AM org.apache.struts.legacy.GenericDataSource
 getConnection
 INFO:   getConnection()
 Nov 29, 2003 12:33:58 AM org.apache.struts.legacy.GenericDataSource
 getConnection
 INFO:Check for timeout, activeCount=2, useCount=0
 Nov 29, 2003 12:33:58 AM org.apache.struts.legacy.GenericDataSource
 getConnection
 INFO:Found available connection
 Nov 29, 2003 12:33:58 AM org.apache.struts.legacy.GenericDataSource
 getConnection
 INFO:Return allocated connection, activeCount=2, useCount=1
 Nov 29, 2003 12:33:58 AM com.hedging.HedgeUser validUser
 INFO: -- Error: No operations allowed after connection closed--
 Nov 29, 2003 12:33:58 AM org.apache.struts.legacy.GenericDataSource
 returnConnection
 INFO:   releaseConnection(), activeCount=2, useCount=0
 Nov 29, 2003 12:34:18 AM org.apache.jk.common.ChannelSocket
 processConnection
 --


 Rajat Pandit | [EMAIL PROTECTED]
 +91 612 3117606
 [ Developer and Part Time Human Being

RE: problems with tiles:getAsString in nested tiles?

2003-11-28 Thread David Friedman
Noah,

We talked about this king of problem Monday.  Basically, this old post
describes a solution for you, which I got working Monday, btw:

http://www.mail-archive.com/[EMAIL PROTECTED]/msg61368.html

Regards,
David

-Original Message-
From: Green, Noah [mailto:[EMAIL PROTECTED]
Sent: Friday, November 28, 2003 8:11 PM
To: '[EMAIL PROTECTED]'
Subject: problems with tiles:getAsString in nested tiles?



Hi,
Sorry to bother you all, I've looked thru the archives and seen some similar
threads, but without any clear conclusions.
I'm using a tiles:getAsString . . .  element in a nested tile, and I'm
getting the following error:

ServletException in:/jsp/layout/mainLayout.jsp] Error - tag.getAsString :
attribute 'title' not found in context. Check tag syntax'

However, this same element works in a tile that is nested at the top
level.


Here is my tiles-defs.xml:
   definition name=.testpage   path=/jsp/testpage.jsp
  put name=title  value=/
  put name=body   value=/
   /definition

   definition name=.testpage.main extends=.testpage
  put name=title value=This is my title /
  put name=body  value=/jsp/layout/mainLayout.jsp /
   /definition


Here is my testpage.jsp, where the tiles:getAsString  does work:
  html-el:html
 head
titletiles:getAsString name=title //title
 /head

 body bgColor=white
tiles:get name=body /
 /body
  /html-el:html

Here is my mainLayout.jsp, where the tiles:getAsString ... is failing:
  h2tiles:getAsString name=title //h2


The end result is that when I use a ForwardAction to go to .testpage.main,

the title element in the page header is populated correctly, but the call
to
populated the h2 area fails with the exception.

Any help on why this is happening is much appreciated :-)

Thanks!
Noah



Noah Green
LEHMAN BROTHERS, Inc.
Fixed Income Analytics
email: [EMAIL PROTECTED]
pager: [EMAIL PROTECTED]
work: 212.526.1689
cellular: 917.406.4930
fax: 646.758.2306




--
This message is intended only for the personal and confidential use of the
designated recipient(s) named above.  If you are not the intended recipient
of
this message you are hereby notified that any review, dissemination,
distribution or copying of this message is strictly prohibited.  This
communication is for information purposes only and should not be regarded as
an offer to sell or as a solicitation of an offer to buy any financial
product, an official confirmation of any transaction, or as an official
statement of Lehman Brothers.  Email transmission cannot be guaranteed to be
secure or error-free.  Therefore, we do not represent that this information
is
complete or accurate and it should not be relied upon as such.  All
information is subject to change without notice.


-
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: Urgent Help Struts on Linux

2003-11-27 Thread David Friedman
I've developed on a Windows platform and ported to Linux for
Struts/Tiles/Tomcat before and not had this problem.  I've used Tomcat
4.1.24 and higher, not 4.0.6.  Is your deployment bringing over all .jars
and putting them in WEB-INF/lib as well as bringing over your
WEB-INF/struts-config.xml (and any modular ocnfigurations if you use them?)
?

Regards,
David

-Original Message-
From: Gurpreet Dhanoa [mailto:[EMAIL PROTECTED]
Sent: Thursday, November 27, 2003 11:51 AM
To: Struts Users Mailing List
Subject: Urgent Help Struts on Linux


Hi

We are facing a problem of running an application in Struts using Tiles on
the Tomcat running on linux . WE have ran the application on Windows and it
is working absolutely fine but when we are trying it to run on Linux we are
not able to call Action Servlet and got the error. Then we debuged the
application and found if we dont use the Tiles then it works fine, but as
soon as we are trying to run the application with tiles it just hang on.

Following are the some of the major contents of log file which has been
generated when we used tiles

2003-11-27 17:57:05 ApplicationDispatcher[/efit]: Servlet action is
currently unavailable
2003-11-27 17:59:49 StandardHost[localhost]: Removing web application at
context path /webdav
2003-11-27 17:59:51 StandardHost[localhost]: Removing web application at
context path /examples
2003-11-27 17:59:52 StandardHost[localhost]: Removing web application at
context path /efit
2003-11-27 17:59:53 StandardHost[localhost]: Removing web application at
context path /jamesj2ee
2003-11-27 17:59:53 StandardHost[localhost]: Removing web application at
context path /efitAdmin_20Nov
2003-11-27 17:59:55 StandardHost[localhost]: Removing web application at
context path /manager
2003-11-27 17:59:55 StandardHost[localhost]: Removing web application at
context path /efitAdmin_old
2003-11-27 17:59:57 action: Error - TilesRequestProcessor : Definition
Factory not found for subapp ''. Do you have declared appropriate plugin in
struts-config.xml ?
2003-11-27 17:59:58 StandardHost[localhost]: Removing web application at
context path /efitAdmin_old20Nov
2003-11-27 17:59:59 StandardHost[localhost]: Removing web application at
context path /efitAdmin_29_10_2003
2003-11-27 18:00:00 action: Error - TilesRequestProcessor : Definition
Factory not found for subapp ''. Do you have declared appropriate plugin in
struts-config.xml ?
2003-11-27 18:00:00 StandardHost[localhost]: Removing web application at
context path /tomcat-docs
2003-11-27 18:00:00 StandardHost[localhost]: Removing web application at
context path /efitAdmin_Nov24,2003
2003-11-27 18:00:01 StandardHost[localhost]: Removing web application at
context path /efitAdmin
2003-11-27 18:00:04 StandardHost[localhost]: Removing web application at
context path
2003-11-27 18:13:33 WebappLoader[/manager]: Deploying class repositories to
work directory
/home/ashish/tomcat/jakarta-tomcat-4.0.6/work/Standalone/localhost/manager
2003-11-27 18:13:33 StandardManager[/manager]: Seeding random number
generator class java.security.SecureRandom
2003-11-27 18:13:33 StandardManager[/manager]: Seeding of random number
generator has been completed



ARe we missing something on Linux server which is required to make Tiles run
.


Any help will be of great use.

Regards
Gary


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



RE: Urgent Help Struts on Linux

2003-11-27 Thread David Friedman
If you're going to upgrade Tomcat's, it's probably best to use the latest
stable version that type.  It is 4.1.29 now, which I upgrade to about two
weeks ago after using both 4.1.24 and 4.1.27 with Struts v1.1.  Feel free to
email me offline if you need it.

Regards,
David

-Original Message-
From: Gurpreet Dhanoa [mailto:[EMAIL PROTECTED]
Sent: Thursday, November 27, 2003 12:10 PM
To: Struts Users Mailing List
Subject: Re: Urgent Help Struts on Linux


HI David,

Thanks and i realy appreciate your Help. We have found we are using
Tomcat4.0 and now we are going to install Tomcat 4.1 same as you used. Yes,
we are getting all of the jar files and strut-config as well. I think trying
on Tomcat4.1 may solve the issue. Well now i am innstalling Tomcayt4.1 and
will be needing your assistance further ifnothing work work

Once again Thanks for your support.

Regards
Gary

- Original Message -
From: David Friedman [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]
Sent: Thursday, November 27, 2003 10:30 PM
Subject: RE: Urgent Help Struts on Linux


 I've developed on a Windows platform and ported to Linux for
 Struts/Tiles/Tomcat before and not had this problem.  I've used Tomcat
 4.1.24 and higher, not 4.0.6.  Is your deployment bringing over all .jars
 and putting them in WEB-INF/lib as well as bringing over your
 WEB-INF/struts-config.xml (and any modular ocnfigurations if you use
them?)
 ?

 Regards,
 David

 -Original Message-
 From: Gurpreet Dhanoa [mailto:[EMAIL PROTECTED]
 Sent: Thursday, November 27, 2003 11:51 AM
 To: Struts Users Mailing List
 Subject: Urgent Help Struts on Linux


 Hi

 We are facing a problem of running an application in Struts using Tiles on
 the Tomcat running on linux . WE have ran the application on Windows and
it
 is working absolutely fine but when we are trying it to run on Linux we
are
 not able to call Action Servlet and got the error. Then we debuged the
 application and found if we dont use the Tiles then it works fine, but as
 soon as we are trying to run the application with tiles it just hang on.

 Following are the some of the major contents of log file which has been
 generated when we used tiles

 2003-11-27 17:57:05 ApplicationDispatcher[/efit]: Servlet action is
 currently unavailable
 2003-11-27 17:59:49 StandardHost[localhost]: Removing web application at
 context path /webdav
 2003-11-27 17:59:51 StandardHost[localhost]: Removing web application at
 context path /examples
 2003-11-27 17:59:52 StandardHost[localhost]: Removing web application at
 context path /efit
 2003-11-27 17:59:53 StandardHost[localhost]: Removing web application at
 context path /jamesj2ee
 2003-11-27 17:59:53 StandardHost[localhost]: Removing web application at
 context path /efitAdmin_20Nov
 2003-11-27 17:59:55 StandardHost[localhost]: Removing web application at
 context path /manager
 2003-11-27 17:59:55 StandardHost[localhost]: Removing web application at
 context path /efitAdmin_old
 2003-11-27 17:59:57 action: Error - TilesRequestProcessor : Definition
 Factory not found for subapp ''. Do you have declared appropriate plugin
in
 struts-config.xml ?
 2003-11-27 17:59:58 StandardHost[localhost]: Removing web application at
 context path /efitAdmin_old20Nov
 2003-11-27 17:59:59 StandardHost[localhost]: Removing web application at
 context path /efitAdmin_29_10_2003
 2003-11-27 18:00:00 action: Error - TilesRequestProcessor : Definition
 Factory not found for subapp ''. Do you have declared appropriate plugin
in
 struts-config.xml ?
 2003-11-27 18:00:00 StandardHost[localhost]: Removing web application at
 context path /tomcat-docs
 2003-11-27 18:00:00 StandardHost[localhost]: Removing web application at
 context path /efitAdmin_Nov24,2003
 2003-11-27 18:00:01 StandardHost[localhost]: Removing web application at
 context path /efitAdmin
 2003-11-27 18:00:04 StandardHost[localhost]: Removing web application at
 context path
 2003-11-27 18:13:33 WebappLoader[/manager]: Deploying class repositories
to
 work directory
 /home/ashish/tomcat/jakarta-tomcat-4.0.6/work/Standalone/localhost/manager
 2003-11-27 18:13:33 StandardManager[/manager]: Seeding random number
 generator class java.security.SecureRandom
 2003-11-27 18:13:33 StandardManager[/manager]: Seeding of random number
 generator has been completed



 ARe we missing something on Linux server which is required to make Tiles
run
 .


 Any help will be of great use.

 Regards
 Gary


 -
 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: Integration of two Different Applications In Tomcat

2003-11-25 Thread David Friedman
I haven't noticed any replies so I'll ask:

If you're using Struts v1.1, for a front-end and back-end, why don't modules
fit your scenario?  Then the images can go in the exact same folders with
both sets being (if you choose) able to update the images?  Since modules
can use different Controllers, you could do the same thing for each section
of your site if they require different login levels or have other distinct
differences, such as different maximum upload sizes.

Regards,
David

-Original Message-
From: Gurpreet Dhanoa [mailto:[EMAIL PROTECTED]
Sent: Tuesday, November 25, 2003 1:53 AM
To: Struts Users Mailing List
Subject: Integration of two Different Applications In Tomcat


hi ,

 I have been implementing an application using Struts1.1. We have basic two
parts of the application as front end and Admin end.
Administrator of the application can access Admin end and front end users
can access front section of the site. Currently, we are delpoying both of
the applications as diffrent entities as differnt applications under webapps
directory of Tomcat. Now, the problem which couured is , Administrator can
upload some images to the site which will be get reflected to the front end
users of the site.When administrator uploads a file we are stroring the file
in a folder named as uploadedImages on the root of Admin appliaction under
webapp.

Our concern is how to get the images which are lying in different
appliaction into the front end appliaction.


OR

Is there any way we can integrate the application like under front end
application we can keep the admin application and can access the application
something like

http://www.frontend.com/Admin

I tried but I am confused

ANy suggestions or help on this will be higly apprectiable,

Thanks in Advance

Gary



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



RE: Hibernate plugin

2003-11-25 Thread David Friedman
I have a Hibernate JNDI tidbit to impart.

Accoring to the Hibernate forums, there are 2 scopes for JNDI in Tomcat.
One seems to be making a context internally visible to apps within that
Tomcat instance only.  The other, or so it was described to me, allows
external lookups.  So much for self-learning (er.. hacking around with)
JNDI.

I was told that if you want JNDI on that second type, you'll need to set the
properties:

(in a hibernate.properties file)
hibernate.jndi.url=SOMETHING
hibernate.jndi.class=SOMETHING_ELSE

(Or if used in a hibernate.cfg.xml file:
property name=hibernate.jndi.urlSOMETHING/property
property name=hibernate.jndi.classSOMETHING_ELSE/property

Regards,
David

P.S. Anyone have a good, simple explantion of the supposed 2 JNDI scopes for
me?

-Original Message-
From: Mark Lowe [mailto:[EMAIL PROTECTED]
Sent: Tuesday, November 25, 2003 11:21 AM
To: Struts Users Mailing List
Subject: Re: Hibernate plugin


Opps!! an inconsistency.


SessionFactory sf = (SessionFactory)
ctx.lookup(foo:/hibernate/SessionFactory);

On 25 Nov 2003, at 16:07, Mark Lowe wrote:

 Hi Gopal

 David cleared this one up for me off the list (Big thanks), I assume
 you've the same problem with folks trying to create publishing niches
 by making stuff confusing. If you get time before be then someone
 should post this on the hibernate site below the where the class is to
 stop folks getting all messed up over this.

 The plugin on the hibernate site works just fine, the important thing
 is to forget the messing with server and web.xml.

 ?xml version='1.0' encoding='utf-8'?
 !DOCTYPE hibernate-configuration PUBLIC
 -//Hibernate/Hibernate Configuration DTD 2.0//EN
   http://hibernate.sourceforge.net/hibernate-configuration-2.0.dtd;

 hibernate-configuration

 !-- a SessionFactory instance listed as /jndi/name --
session-factory name=foo:/hibernate/SessionFactory
 !-- properties --
 property
 name=dialectnet.sf.hibernate.dialect.MySQLDialect/property
 property name=connection.usernamebrian/property
 property name=connection.passwordarses/property
 property
 name=connection.urljdbc:mysql://localhost:3306/mydata/property
 property
 name=connection.driver_classcom.mysql.jdbc.Driver/property
 property name=show_sqltrue/property
 property name=use_outer_jointrue/property
 property
 name=transaction.factory_classnet.sf.hibernate.transaction.JDBCTrans
 actionFactory/property
 property name=dbcp.minIdle1/property
 property name=cache.use_query_cachetrue/property

 !-- mapping files --
 mapping resource=com/sparrow/om/Arse.hbm.xml/

 /session-factory

 /hibernate-configuration

 and in struts config..

   plug-in className=edu.arbor.util.plugin.HibernatePlugIn
   set-property property=storedInServletContext value=true/
   /plug-in

 ..

 Context ctx = new InitialContext();
 SessionFactory sf = (SessionFactory)
 ctx.lookup(mnye:/hibernate/SessionFactory);
 hibSession = sf.openSession();

 Query query = hibSession.createQuery(from com.sparrow.om.Arse);
 Iterator it = query.iterate();

 while(it.hasNext()) {
   Arse arse = (Arse) it.next();
   arseList.add(arse);
 }

 request.setAttribute(arses, arseList.toArray());

 ..


 Cheers Mark


 On 24 Nov 2003, at 15:11, Gopal Venkata Achi wrote:

 Hi David,
 We are in the process of choosing the Hibernate for one of my
 applications.  Can you let me know, how does it help us, and under
 what circumstances, we use this tool.  I have gone thru the Hibernate
 docs, but have not got the clear idea.
 Please help me in this regard.
 Regards,
 gopal

  -Original Message-
  From: David Friedman [mailto:[EMAIL PROTECTED]
  Sent: Mon 11/24/2003 12:02 AM
  To: Struts Users Mailing List
  Cc:
  Subject: RE: Hibernate plugin



  Mark,

  I have a simpler approach for Hibernate (v2.0.3 or v2.1 under Struts
 v1.0 or
  v1.1)

  1. Start with the Hibernate example Struts PlugIn code and
 struts-config.xml
  configuration text at:
  http://www.hibernate.org/105.html

  2. Do NOT put any context entries in server.xml or web.xml!

  3. Choose any name OTHER than the example
 java:comp/env/jdbc/mn-test.  Any
  name under java:/comp in Tomcat is read-only and cannot be used.  I
  selected one using my initial and some related hibernate words
  dgf:/hibernate/SessionFactory.  Put that in your hibernate.cfg.xml
 file as
  the 'name=...' parameter of the session-factory tag, along the
 lines of
  this example:

  session-factory name=dgf:/hibernate/SessionFactory
  !-- properties --
  !-- mapping files --
  mapping resource=hibernate/Misc.hbm.xml/
  /session-factory

  If you use a hibernate.properties file, what you need is described
 here:
  http://www.hibernate.org/hib_docs/api/net/sf

RE: Validator Backend Issues

2003-11-24 Thread David Friedman
Joe,

Nope.  I was writing to you about that but you found your solution faster
than I could type (my poor aching fingers at 2AM!).

When you said your 'formName=UserLoginForm', that suggests you're keying
off the action's ActionForm name 'name='UserLoginForm' for your validation.
That's why you would use DynaValidatorForm.

Using DynaValidatorActionForm is just like a DynaValidatorForm with one
exception: it validates of the name of the action.  So if your action is
called /edit.do, it would need a form name of '/edit' such as:
form name=/edit
field ...
...
/field
/form

I also got stuck on this when I first started using the Struts Validator.  I
hope this explanation helps.

Regards,
David

-Original Message-
From: Joe Hertz [mailto:[EMAIL PROTECTED]
Sent: Monday, November 24, 2003 2:07 AM
To: 'Struts Users Mailing List'
Subject: RE: Validator Backend Issues


Curious. Changing the ActionForm from a DynaValidatorActionForm to a
DynaValidatorForm gets me backend validation.

Have I just stumbled onto a bug?

 -Original Message-
 From: Joe Hertz [mailto:[EMAIL PROTECTED]
 Sent: Monday, November 24, 2003 1:46 AM
 To: 'Struts Users Mailing List'
 Subject: Validator Backend Issues


 I'm probably misunderstanding this woefully. Hope someone can
 set me straight.

 For my login, I'm using a UserLoginForm class that extends
 DynaValidatorActionForm. The Action  class is an extension of
 DispatchAction (it handles all User related actions).

 If in my Login.jsp, I remove the html:javascript
 formName=UserLoginForm/ tag,I get no javascript
 validations happening, which I would expect, but I also find
 that I *never* get any back end validation checks happening.
 Nothing shows up where the html:errors / tag was.

 Is there something I have to do to get the validator to do
 it's magic outside of the client?

 -Joe



 -
 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: Struts Validator question

2003-11-24 Thread David Friedman
Two questions immediately come to mind from what you documented:

1. Does com.hp.ipg.ne.pgpm.forms.orgForm extend
org.apache.struts.validator.ValidatorForm
or
org.apache.struts.validator.ValidatorActionForm

2. The 'input=org_edit.jsp is context sensitive.  Can you
reach org_edit.jsp from the same level as your /org_insert.do
action?

*** This sounds like the problem since you wrote you're seeing a
blank html page, as if it cannot find the JSP page.

Regards,
David

-Original Message-
From: LACKEY,DAVID (HP-PaloAlto,ex1) [mailto:[EMAIL PROTECTED]
Sent: Monday, November 24, 2003 1:58 AM
To: Struts Users Mailing List
Subject: Struts  Validator question


All,

I posted this a few hours ago on the jakarta-commons list and have not come
up with a solution yet.  I decided to commit the sin of x-posting it here
since this may very well be a struts issue.

I hope this is not a newbie question.  I have RTFM several times.  I suspect
I must be missing something simple.  I have installed Tomcat 4.1.29 and
Struts 1.1 with the Validator included.  I have configured my installation
as follows

struts-config.xml:
form-bean  name=orgForm
type=com.hp.ipg.ne.pgpm.forms.orgForm/
.
.
.
!-- Insert a new Org into the database --
action path=/org_insert
name=orgForm
type=com.hp.ipg.ne.pgpm.actions.orgInsertAction
scope=request
validate=true
input=org_edit.jsp 
forward name=show_list path=/org_list.do /
forward name=error path=/GeneralError.do /
/action
.
.
.
message-resources parameter=com.hp.ipg.ne.pgpm.application/
.
.
.
  plug-in className=org.apache.struts.validator.ValidatorPlugIn
set-property property=pathnames value=/WEB-INF/validator-rules.xml,
  /WEB-INF/validation.xml/
  /plug-in

Validation.xml:

form-validation
formset
form name=orgForm
  field property=orgCode
depends=required
arg0 key=orgForm.OrgCode/
/field
/form
/formset
/form-validation

Application:properties:
errors.required={0} is required.

In the org_edit.jsp file contains the following code snippet:
logic:messagesPresent
   bean:message key=errors.header/
   ul
   html:messages id=error
  libean:write name=error//li
   /html:messages
   /ulhr
/logic:messagesPresent


I have stepped through the execution several times and see the validator
being activated.  I even see the failed validation (empty field).  However,
after the failed validation, it seems validator is unable to construct a
proper forward to send me back to the JSP page where the error was entered
(or not entered in this case).  I am simply forwarded to a nearly blank page
with minimal html and body tags.

I have tried changing the input parameter to point at a global  local
forward as well as an Action forward.  None of them succeed.  However, when
pointed at a forward the browser does display a message indicating that the
server was unable to look up a mapping for an action named /misc.  The
characters misc do not appear anywhere in my struts-config.xml file.  I am
guessing this must be some kind of default behavior.

Any thoughts would be appreciated.


David Lackey
[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: Validator Backend Issues

2003-11-24 Thread David Friedman
Joe,

When using a Struts Validator based on the Action name, you usually need to
add the 'method=validateSomeName' because the Struts Validator wants to
use the exact name in your validation xml file.  In your case, that is
/Login which matches your action.  So, change your html:javascript and
html:form along these lines:

html:form action=/Login.do focus=emailAddress onsubmit=return
validateLogin(this)

html:javascript formName=/Login method=validateLogin

For more details see html:javascript and html:form in the Struts docs:
http://jakarta.apache.org/struts/userGuide/struts-html.html#javascript

Regards,
David

-Original Message-
From: Joe Hertz [mailto:[EMAIL PROTECTED]
Sent: Monday, November 24, 2003 2:37 AM
To: 'David Friedman'
Subject: RE: Validator Backend Issues


Don't laugh. Now I remember the problem I first encountered.

I'm getting a generated javascript function of validate/Login(form)

Do I have to escape the slash in the generated js function name or
something to call it?

html:form action=/Login.do focus=emailAddress onsubmit=return
validate/Login(this)

 -Original Message-
 From: David Friedman [mailto:[EMAIL PROTECTED]
 Sent: Monday, November 24, 2003 2:03 AM
 To: Struts Users Mailing List; [EMAIL PROTECTED]
 Subject: RE: Validator Backend Issues


 Joe,

 Nope.  I was writing to you about that but you found your
 solution faster than I could type (my poor aching fingers at 2AM!).

 When you said your 'formName=UserLoginForm', that suggests
 you're keying off the action's ActionForm name
 'name='UserLoginForm' for your validation. That's why you
 would use DynaValidatorForm.

 Using DynaValidatorActionForm is just like a
 DynaValidatorForm with one
 exception: it validates of the name of the action.  So if
 your action is called /edit.do, it would need a form name of
 '/edit' such as: form name=/edit
   field ...
   ...
   /field
 /form

 I also got stuck on this when I first started using the
 Struts Validator.  I hope this explanation helps.

 Regards,
 David

 -Original Message-
 From: Joe Hertz [mailto:[EMAIL PROTECTED]
 Sent: Monday, November 24, 2003 2:07 AM
 To: 'Struts Users Mailing List'
 Subject: RE: Validator Backend Issues


 Curious. Changing the ActionForm from a
 DynaValidatorActionForm to a DynaValidatorForm gets me
 backend validation.

 Have I just stumbled onto a bug?

  -Original Message-
  From: Joe Hertz [mailto:[EMAIL PROTECTED]
  Sent: Monday, November 24, 2003 1:46 AM
  To: 'Struts Users Mailing List'
  Subject: Validator Backend Issues
 
 
  I'm probably misunderstanding this woefully. Hope someone
 can set me
  straight.
 
  For my login, I'm using a UserLoginForm class that extends
  DynaValidatorActionForm. The Action  class is an extension of
  DispatchAction (it handles all User related actions).
 
  If in my Login.jsp, I remove the html:javascript
  formName=UserLoginForm/ tag,I get no javascript validations
  happening, which I would expect, but I also find that I *never* get
  any back end validation checks happening. Nothing shows up
 where the
  html:errors / tag was.
 
  Is there something I have to do to get the validator to do
 it's magic
  outside of the client?
 
  -Joe
 
 
 
 
 -
  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: Inheritance in tile definitions II

2003-11-24 Thread David Friedman
Ed,

The list archives describe this problem. I didn't understand it until I
tested it.

Inside the main definition, /layouts/formLayout.jsp, you'd normally have a
segment like this:

tiles:get name=header/

Instead, they say to pass any tile-defined attribute, you must use an insert
and put in the place where you include that included page such as:

tiles:insert attribute=header
tiles:put name=title beanName=title beanScope=tile /
/tiles:insert

This is odd but did indeed work for me a second ago to show my title in my
header.jsp using tile:getAsString name=title /

It came from here:
http://www.mail-archive.com/[EMAIL PROTECTED]/msg61368.html

Regards,
David

-Original Message-
From: Ed Dowgiallo [mailto:[EMAIL PROTECTED]
Sent: Sunday, November 23, 2003 12:32 PM
To: Struts Users Mailing List
Subject: Re: Inheritance in tile definitions II


When I simply place a getAsString in the header.jsp, I get an error message
which says that title can not be found in the context.  I get the same for
useAttribute.

Ed
- Original Message -
From: David Friedman [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]
Sent: Sunday, November 23, 2003 12:22 PM
Subject: RE: Inheritance in tile definitions II


 Ed,

 The tile definition is initialized before the pages/jsp's/actions are
 called.  You can therefore access any name in any component as long as
that
 component is tiles aware.  In the case of your JSP's, juse use the tiles
 taglib and do what you did in header.jsp to obtain the title (a
getAsString,
 if I recall correctly).  In the case of an action, you'd need to subclass
 the TilesAction to manipulate it directly (i.e. to set the title from
within
 the Action directly, or perhaps set a content section if the page is
 dynamic).

 Regards,
 David
   -Original Message-
   From: Ed Dowgiallo [mailto:[EMAIL PROTECTED]
   Sent: Sunday, November 23, 2003 9:19 AM
   To: Struts Users Mailing List
   Subject: Inheritance in tile definitions II


   My thanks to all those who offered suggestions for my first problem.

   Let's say that I have the following in a definitions file:

 !--
 = --

 --
 !-- Form
--

 --
 !--
 = --
 definition name=form.layout page=/layouts/formLayout.jsp
   put name=system-short-name value=TDL/
   put name=user-name value=Guest/
   put name=title   value=Form Page Layout/
   put name=header  value=/common/header.jsp/
   put name=content value=${content}/
   put name=footer  value=/common/footer.jsp/
   put name=debug   value=/debug.jsp/
 /definition
 definition name=login.form extends=form.layout
   put name=title   value=Login Form/
   put name=content value=/security/login.jsp/
 /definition

   When I access title using GetAsString from formLayout.jsp, I get the
 expected value of Login Form.

   How do I access the value of title from header.jsp?

   Thank you,
   Ed



-
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: Struts upload functionalities

2003-11-24 Thread David Friedman
The struts distributions should all have a sample .war application with code
and jsp's called struts-upload.war. It's often in the webapps folder. :)

-David

-Original Message-
From: Viral_Thakkar [mailto:[EMAIL PROTECTED]
Sent: Monday, November 24, 2003 4:12 AM
To: Struts Users Mailing List
Subject: Struts upload functionalities


Hi all,

Is there reference documentation or code available which explains the
upload (uploading of documents) functionality?

Thanks in advance.

Regards,
Viral

-
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: [OT] Stress Test

2003-11-24 Thread David Friedman
So after 6 hours, what do your log files (web server and java application
server) show?  Do they show struts actions being performed? Does it show out
of memory errors?  Anything like that?

Regards,
David

-Original Message-
From: Jerry Jalenak [mailto:[EMAIL PROTECTED]
Sent: Monday, November 24, 2003 10:05 AM
To: '[EMAIL PROTECTED]'
Subject: [OT] Stress Test


Hi All,

I've got a problem with my current web app where it stops responding after
about 6 hours.  I need to set up a test environment and simulate multiple
logon's so I can trap my way through the code and figure out where it is
failing.  I think there is a tool available that can be used to do this -
HTTPerf (I think), but I'm not sure if this will do what I want.  Does
anyone have any experience with this?

Thanks.

Jerry Jalenak
Development Manager, Web Publishing
LabOne, Inc.
10101 Renner Blvd.
Lenexa, KS  66219
(913) 577-1496

[EMAIL PROTECTED]


This transmission (and any information attached to it) may be confidential
and
is intended solely for the use of the individual or entity to which it is
addressed. If you are not the intended recipient or the person responsible
for
delivering the transmission to the intended recipient, be advised that you
have received this transmission in error and that any use, dissemination,
forwarding, printing, or copying of this information is strictly prohibited.
If you have received this transmission in error, please immediately notify
LabOne at the following email address: [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: Disable binary files in upload

2003-11-24 Thread David Friedman
Ludo,

You might want to use a FormFile in your ActionForm bean to make the file
easier to deal with.   Then, you can do things like this:

1. FormFile.getContentType() and see if it is a MIME type you allow.

2. FormFile.getInputStream() and save it in an ascii, not binary mode.  So,
binary data would probably be saved corrupted and they'd know it was bad the
next time they asked for it not to upload binary data.

3. FormFile.getFileName() and see if it is one of a handful of file
extensions you might allow (.html, .txt, etc.)

Regards,
David

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]
Sent: Monday, November 24, 2003 9:35 AM
To: [EMAIL PROTECTED]
Subject: Disable binary files in upload




Hi all,

I would like to prevent the user from upload binary files from an upload
form, but to allow him to download any kind of ascii files. What is the
better way to do that?
Is it something i can do with the configuration.? Or should I add a test on
the content-type value received ?

Thanks,
Ludo.







This message and any attachments (the message) is intended solely for the
addressees and is confidential.
If you receive this message in error, please delete it and immediately
notify the sender. Any use not in accord with
its purpose, any dissemination or disclosure, either whole or partial, is
prohibited except formal approval.
The internet can not guarantee the integrity of this message. BNP PARIBAS
(and its subsidiaries) shall (will) not
therefore be liable for the message if modified.

-

Ce message et toutes les pieces jointes (ci-apres le message) sont etablis
a l'intention exclusive de ses
destinataires et sont confidentiels. Si vous recevez ce message par erreur,
merci de le detruire et d'en avertir
immediatement l'expediteur. Toute utilisation de ce message non conforme a
sa destination, toute diffusion
ou toute publication, totale ou partielle, est interdite, sauf autorisation
expresse. L'internet ne permettant pas
d'assurer l'integrite de ce message, BNP PARIBAS (et ses filiales)
decline(nt) toute responsabilite au titre de ce
message, dans l'hypothese ou il aurait ete modifie.


-
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: Inheritence and tile definitions III

2003-11-24 Thread David Friedman
Ed,

From the previous tiles problem, it seems as though the base definition is
key and must list everything that needs to be 'global'.  So, it might fix
your problem if you make sure all elements are in it.  I.e. in
base.layout, try including your content, which is defined everywhere
EXTENDING the base.layout but not IN the base.layout:

put name=content value=${content}/

Regards,
David
  -Original Message-
  From: Ed Dowgiallo [mailto:[EMAIL PROTECTED]
  Sent: Monday, November 24, 2003 9:08 AM
  To: Struts Users Mailing List
  Subject: Inheritence and tile definitions III


  My previous problems with title have been solved, but now I have an
analogous problem with content.  The idea of the definitions below is that
I want to have a base.layout that determines the header and footer for all
pages.  Base layout contains a body which can be replaced by different
format JSPs, as in the form.layout and page.layout definitions.  login.form
extends form.layout and passes it a title and content.  Title is working
fine, but I am getting an error saying that content can not be found in
context.

  I have added the following lines to baseLayout.jsp to attempt to resolve
the issue.

  tiles:insert attribute=body
logic:present name=contenttiles:put name=content
beanName=content beanScope=tile//logic:present
logic:present name=menutiles:put name=menu beanName=menu
beanScope=tile//logic:present
  /tiles:insert

  The above did not work.  Any suggestions would be welcome.
  Ed Dowgiallo

!--
= --

--
!-- Base
   --

--
!--
= --
definition name=base.layout page=/layouts/baseLayout.jsp
  put name=system-short-name value=TDL/
  put name=title value=Base Page Layout/
  put name=user-name value=Guest/
  put name=header  value=/common/header.jsp/
  put name=bodyvalue=${body}/
  put name=footer  value=/common/footer.jsp/
/definition
!--
= --

--
!-- Form
   --

--
!--
= --
definition name=form.layout extends=base.layout
  put name=title   value=Form Page Layout/
  put name=content value=${content}/
  put name=bodyvalue=/layouts/formLayout.jsp/
/definition
!--
= --

--
!-- Page
   --

--
!--
= --
definition name=page.layout extends=base.layout
  put name=title   value=Page Layout/
  put name=menuvalue=${menu}/
  put name=content value=${content}/
  put name=bodyvalue=/layouts/menuContentLayout.jsp/
/definition
!--
= --

--
!-- Security Module
  --

--
!--
= --
definition name=login.form extends=form.layout
  put name=title   value=Login Form/
  put name=content value=/security/login.jsp/
/definition


RE: Tiles problem with / in action forward since struts 1.1

2003-11-24 Thread David Friedman
Lukas,

How are you trying to 'forward' to your tile?  Certain logic:tags don't
foward to tiles - it's in their documentation.  Please provide examples of
your forward tags, relevant action .../ tags, and how you are trying to
'forward' to it.

Regards,
David

-Original Message-
From: Lukas sterreicher [mailto:[EMAIL PROTECTED]
Sent: Monday, November 24, 2003 8:33 AM
To: [EMAIL PROTECTED]
Subject: Tiles problem with / in action forward since struts 1.1


Hello

In latest revisions of struts it seemes to be required to have an action
forward
start with  a /. This is ok under normal situations, however, it seemes to
cause
troubles with tiles, at least for me.

When forwarding to a tile defind in the xml configureation file for tiles
it seemes to be required to forward to a location not starting with / or
it won't find the tile.

Are you aware of this and can confirm it?

Some people to deem to try to bypass this by setting the
referrer url in another parameter rather then the action forward,
but I think this not a good solution, especially if you need many
forward locations.

Do you know a solution for this?

Lukas



/index.jsp gets translated (as needed) to account for the context path
automatically. The paths that start with / are evaluated relative to
your web app. You can use the /index.jsp style paths and deploy your app
with any context path without having to change anything.

-Max

On Thu, 2003-02-27 at 22:01, Affan Qureshi wrote:
 I have been using Struts 1.1b2 and tiles in my application and have
defined
 forwards like:

 forward name=Success path=index.jsp?selected=1 redirect=false/

 where forward paths were JSP pages,  whithout the starting / for paths
and
 it worked ok. But this does not work when I installed Strut 1.1rc1 coz it
 gave the exception:

 java.lang.IllegalArgumentException: Path index.jsp?selected=1 does not
start
 with a / character

 Have I been doing it wrong until now? Is this a TilesRequestProcessor
issue?
 I had done so, so that I can deploy my app under any context/module etc.
and
 have no dependency on root path.




-
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: Hibernate plugin

2003-11-24 Thread David Friedman
Gopal,

I like hibernate for a few simple things:

1. Auto-population of objects.  I hate copying SQL columns or adding a second step by 
calling beanutils.copyproperties.

2. Describe your object and hibernate can:

A) Auto-generate my java object code (hbm2java)
B) Auto-update my database tables if my fields change type or new ones are added 
(SchemaUpdate)
C( Describe on auto-code-generation what interfaces or 'extends' to use for that 
class. (*.hbm.xml 'meta' attributes).
D) Auto-load any subsets or sub-tables it refers to.  Got an author who has one or 
more 'works'?  You could have it load that data automatically.  Got a login/pw/id in 
one table but want it to load the customer data in another table automatically?  Link 
them with a type of component so when you ask for the user with login 'fred', it 
populates the object from both tables.

3. Time-savers:

a) Plug-ins for caches (EhCache, OSCache, JCS, etc.)
b) It's own query language can auto-translate to various database brands/types so you 
can have multiple database products and your query will be automatically translated 
and use the right userid/password/database/table for what you're looking for (DB2, 
Firebird, FrontBase, HSQLD, Informix, Ingres, Interbase, Mckoi, MySQL, Oracle, 
Pointbase, PostgreSQL, Postgress, SAPDB, Sybase, etc.), which it calls Dialects.
c) Auto-logins to each database (no need for DataSource configurations or anything 
like that)
d) Can automatically install each data souce as a JNDI name (I use this in 
Tomcat+Struts+Hibernate) so I can use it without passing the session back and forth 
(good for hiding your database access object.

4. The mapping file(s) describes objects and relationships so it can auto-log any 
one-to-one, one-to-many, many-to-one, many-to-many, bidirectional, and even 
tridirectional relationships in the object.  I can make it auto-load that information 
if I want as well.

This are my favorite reasons, thought I've never used 3.b (yet). :) I'm sure there are 
more reasons so check out http://www.hibernate.org and it's forum 
http://forum.hibernate.org, which answers a load of questions.

Did I mention that I think Hibernate was just taken over by JBoss so they have at 
least one dedicated programmer (full-time, 9-5 daily).  That might comfort you knowing 
there is one person who's probably on their message boards 9-5 every day. :)

Feel free to off-list me if you have more questions.  I'm probably driving everyone 
CRAZY with my incessant posting the last day or two.

Regards,
David

-Original Message-
From: Gopal Venkata Achi [mailto:[EMAIL PROTECTED]
Sent: Monday, November 24, 2003 10:12 AM
To: Struts Users Mailing List
Subject: RE: Hibernate plugin


Hi David,
We are in the process of choosing the Hibernate for one of my applications.  Can you 
let me know, how does it help us, and under what circumstances, we use this tool.  I 
have gone thru the Hibernate docs, but have not got the clear idea.
Please help me in this regard.
Regards,
gopal

-Original Message- 
From: David Friedman [mailto:[EMAIL PROTECTED] 
Sent: Mon 11/24/2003 12:02 AM 
To: Struts Users Mailing List 
Cc: 
Subject: RE: Hibernate plugin



Mark,

I have a simpler approach for Hibernate (v2.0.3 or v2.1 under Struts v1.0 or
v1.1)

1. Start with the Hibernate example Struts PlugIn code and struts-config.xml
configuration text at:
http://www.hibernate.org/105.html

2. Do NOT put any context entries in server.xml or web.xml!

3. Choose any name OTHER than the example java:comp/env/jdbc/mn-test.  Any
name under java:/comp in Tomcat is read-only and cannot be used.  I
selected one using my initial and some related hibernate words
dgf:/hibernate/SessionFactory.  Put that in your hibernate.cfg.xml file as
the 'name=...' parameter of the session-factory tag, along the lines of
this example:

session-factory name=dgf:/hibernate/SessionFactory
!-- properties --
!-- mapping files --
mapping resource=hibernate/Misc.hbm.xml/
/session-factory

If you use a hibernate.properties file, what you need is described here:
http://www.hibernate.org/hib_docs/api/net/sf/hibernate/cfg/Environment.html

Since I use hibernate.cfg.xml instead of hibernate.properties, I'm guessing
you'll need something like this in your hibernate.properties file:
hibernate.jndi.url dgf:/hibernate
hibernate.jndi.class javax.naming.Context
hibernate.session_factory_name SessionFactory

4. Hibernate creates the non-existent JNDI context for me on webapp start
and puts the session-factory in it.  My facade class opens the session this
way:

Content ctx = new InitialContext

RE: getParameter() returns null on multipart requests

2003-11-24 Thread David Friedman
Martin,

I don't know if Terry got it working, but I don't see why he (or anyone)
couldn't keep it simple by using a CommonsMultiPartRequestWrapper's
getTextElements() or getAllElements() methods, liks so:

// Assuming wrapper is the initialized CommonsMultiPartRequestWrapper
Hashtable textElements = wrapper.getTextElements();
String paramOne[] = (String)textElements.get(One);

// OR  (Note the String array in both examples)

Hashtable allElements = wrapper.getAllElements();
String paramOne[] = (String)allElements.get(One);

Both code works if you add it to the example code I uploaded Saturday:
www.mail-archive.com/[EMAIL PROTECTED]/msg87269.html

Regards,
David

-Original Message-
From: news [mailto:[EMAIL PROTECTED] Behalf Of Martin Cooper
Sent: Monday, November 24, 2003 6:03 PM
To: [EMAIL PROTECTED]
Subject: Re: getParameter() returns null on multipart requests



Terry Brick [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 Hello,
 When I submit a multipart form to my action I am
 unable to get use getParameter() on the request object
 to get my form field values.  As I understand it
 struts is supposed to automatically create a
 MultipartRequestWrapper which allows you to do this
 for multipart requests...
 I've seen some postings regarding this, but I still
 don't understand what I need to do.  I think there was
 some mention that MultipartRequestWrapper doesn't work
 right if you're not utilizing the ActionForm?

It still works, but it won't do as much for you behind the scenes. ;-)

From within an Action, using getParameter() should still work for regular
(i.e. non-file) items, because the request object passed to the Action is
the wrapped request. If you're calling that method from somewhere else, it
may or may not work, depending on whether or not you have a wrapped request.
(In many places, you will not have a wrapped request, because the Servlet
2.2 spec does not permit such a thing, and Struts 1.x is Servlet 2.2
compatible.)

--
Martin Cooper



 I also tried instantiating my own
 MultipartRequestWrapper by doing new
 MultipartRequestWrapper(request).  That doesn't solve
 the problem either.

 Any ideas? I'm using the latest nightly build (Struts
 1.2).

 Thanks!


 __
 Do you Yahoo!?
 Free Pop-Up Blocker - Get it now
 http://companion.yahoo.com/




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


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



RE: getParameter() returns null on multipart requests

2003-11-24 Thread David Friedman
Martin,

I agree Terry could have had it so much easier using an ActionForm. But, I
recall that wasn't what Terry wanted to do back in the first post, hence the
wrapper example, then the follow-ups about keeping everything in one place,
that wrapper.

Is there a way I missed to get the MultiPartRequestWrapper for that action
in Terry's no-ActionForm case instead of initializing it all over again sans
ActionForm?

Personally, I prefer adding FormFiles to my ActionForm and getting uploaded
files that way.

Regards,
David

-Original Message-
From: news [mailto:[EMAIL PROTECTED] Behalf Of Martin Cooper
Sent: Monday, November 24, 2003 7:13 PM
To: [EMAIL PROTECTED]
Subject: Re: getParameter() returns null on multipart requests



David Friedman [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 Martin,

 I don't know if Terry got it working, but I don't see why he (or anyone)
 couldn't keep it simple by using a CommonsMultiPartRequestWrapper's
 getTextElements() or getAllElements() methods, liks so:

Why is duplicating the work keep[ing] it simple? Struts does all of the
parsing behind the scenes for you, and makes all of the parameters available
to you. The example code you posted does pretty much the same things that
the Struts code does behind the scenes, but by the time your action is
invoked, Struts has done it already, without you having to implement any
file upload functionality in your actions. (In fact, I'm not sure I
understand how your code can work, given that Struts will already have
parsed the input stream, making it unavailable to a second parse.)

--
Martin Cooper



 // Assuming wrapper is the initialized CommonsMultiPartRequestWrapper
 Hashtable textElements = wrapper.getTextElements();
 String paramOne[] = (String)textElements.get(One);

 // OR  (Note the String array in both examples)

 Hashtable allElements = wrapper.getAllElements();
 String paramOne[] = (String)allElements.get(One);

 Both code works if you add it to the example code I uploaded Saturday:
 www.mail-archive.com/[EMAIL PROTECTED]/msg87269.html

 Regards,
 David

 -Original Message-
 From: news [mailto:[EMAIL PROTECTED] Behalf Of Martin Cooper
 Sent: Monday, November 24, 2003 6:03 PM
 To: [EMAIL PROTECTED]
 Subject: Re: getParameter() returns null on multipart requests



 Terry Brick [EMAIL PROTECTED] wrote in message
 news:[EMAIL PROTECTED]
  Hello,
  When I submit a multipart form to my action I am
  unable to get use getParameter() on the request object
  to get my form field values.  As I understand it
  struts is supposed to automatically create a
  MultipartRequestWrapper which allows you to do this
  for multipart requests...
  I've seen some postings regarding this, but I still
  don't understand what I need to do.  I think there was
  some mention that MultipartRequestWrapper doesn't work
  right if you're not utilizing the ActionForm?

 It still works, but it won't do as much for you behind the scenes. ;-)

 From within an Action, using getParameter() should still work for regular
 (i.e. non-file) items, because the request object passed to the Action is
 the wrapped request. If you're calling that method from somewhere else, it
 may or may not work, depending on whether or not you have a wrapped
request.
 (In many places, you will not have a wrapped request, because the Servlet
 2.2 spec does not permit such a thing, and Struts 1.x is Servlet 2.2
 compatible.)

 --
 Martin Cooper


 
  I also tried instantiating my own
  MultipartRequestWrapper by doing new
  MultipartRequestWrapper(request).  That doesn't solve
  the problem either.
 
  Any ideas? I'm using the latest nightly build (Struts
  1.2).
 
  Thanks!
 
 
  __
  Do you Yahoo!?
  Free Pop-Up Blocker - Get it now
  http://companion.yahoo.com/




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




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


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



RE: getParameter() returns null on multipart requests

2003-11-23 Thread David Friedman
Terry,

I know there isn't much on file uploads but it is so much easier having your
ActionForm or DynaActionForm include a FormFile object.  Unfortunately, this
doesn't work well for random amounts of images to upload on a page.  I wrote
this quick Action class to get the point across on how to get to the
MultiPartRequestHandler when your Action has no 'name=ActionForm' setting.

This works fine as long as your form submit has two key pieces:
1) enctype=multipart/form-data
2) method=POST

I explained how to figure out which file is uploaded as which field name.
The output looks like this example (named my form fields uploading and
uploading2 for no reason):

Field: uploading, FileName: david.html, size: 902
Field: uploading2, FileName: tutorial.pdf, size: 1477977

It's up to you to figure out how to save the binary streams. :)

Regards,
David

P.S. This file works exactly as-is for an action, if you leave the
'name=ActionForm' blank in the struts-config.xml (or modular) struts
configuration file.

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
/*
 * Created on Nov 22, 2003
 *
 * To change the template for this generated file go to
 * WindowPreferencesJavaCode GenerationCode and Comments
 */
package friedman.utils;

import java.util.Enumeration;
import java.util.Hashtable;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.struts.action.Action;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.upload.CommonsMultipartRequestHandler;
import org.apache.struts.upload.FormFile;

public class ParameterAction extends Action {
public ActionForward execute(
ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response)
throws Exception {

byte data[] = null;
CommonsMultipartRequestHandler cmrh =
new CommonsMultipartRequestHandler();
Enumeration e = null;
FormFile ff = null;
Hashtable h = null;

cmrh.setServlet(servlet);
cmrh.handleRequest(request);
h = cmrh.getFileElements();

// Catch null pointer exception
try {

// Get a particular item, say upload field where 
'named=uploading'
e = h.keys();
while (e.hasMoreElements()) {
String key = (String) e.nextElement();
ff = (FormFile) h.get(key);
System.out.println(
Field: 
+ key
+ , FileName: 
+ ff.getFileName()
+ , size: 
+ ff.getFileSize());

// open and write the binary data 'data'
data = ff.getFileData();
}

} catch (NullPointerException npe) {
System.out.println(Something was missing:  + 
npe.getMessage());
}
return (mapping.findForward(success));
}
}
}=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

-Original Message-
From: Terry Brick [mailto:[EMAIL PROTECTED]
Sent: Saturday, November 22, 2003 10:23 PM
To: Struts Users Mailing List
Subject: RE: getParameter() returns null on multipart requests


Hi, thanks for replying...

1)  I'm not using the actionform capabilities of
struts.  I generally just create my own actionform by
getting the necessary data out of the request object
(long story).  So, in other words, in my struts
config, there's no actionform associated with the
action.

2)  Yes, the form tag looks like
form name=foo method=post
enctype=multipart/form-data


--- David Friedman [EMAIL PROTECTED] wrote:
 Terry,

 1. Does your actionform receive data?

 2. Did you set the enctype on your form
 appropriately for
 multipart/form-data ?

 Regards,
 David

 -Original Message-
 From: Terry Brick [mailto:[EMAIL PROTECTED]
 Sent: Saturday, November 22, 2003 1:08 PM
 To: [EMAIL PROTECTED]
 Subject: getParameter() returns null on multipart
 requests


 Hello,
 When I submit a multipart form to my action I am
 unable to get use getParameter() on the request
 object
 to get my form field values.  As I understand it
 struts is supposed to automatically create a
 MultipartRequestWrapper which allows you to do this
 for multipart requests...
 I've seen some postings

RE: Inheritance in tile definitions II

2003-11-23 Thread David Friedman
Ed,

The tile definition is initialized before the pages/jsp's/actions are
called.  You can therefore access any name in any component as long as that
component is tiles aware.  In the case of your JSP's, juse use the tiles
taglib and do what you did in header.jsp to obtain the title (a getAsString,
if I recall correctly).  In the case of an action, you'd need to subclass
the TilesAction to manipulate it directly (i.e. to set the title from within
the Action directly, or perhaps set a content section if the page is
dynamic).

Regards,
David
  -Original Message-
  From: Ed Dowgiallo [mailto:[EMAIL PROTECTED]
  Sent: Sunday, November 23, 2003 9:19 AM
  To: Struts Users Mailing List
  Subject: Inheritance in tile definitions II


  My thanks to all those who offered suggestions for my first problem.

  Let's say that I have the following in a definitions file:

!--
= --

--
!-- Form
   --

--
!--
= --
definition name=form.layout page=/layouts/formLayout.jsp
  put name=system-short-name value=TDL/
  put name=user-name value=Guest/
  put name=title   value=Form Page Layout/
  put name=header  value=/common/header.jsp/
  put name=content value=${content}/
  put name=footer  value=/common/footer.jsp/
  put name=debug   value=/debug.jsp/
/definition
definition name=login.form extends=form.layout
  put name=title   value=Login Form/
  put name=content value=/security/login.jsp/
/definition

  When I access title using GetAsString from formLayout.jsp, I get the
expected value of Login Form.

  How do I access the value of title from header.jsp?

  Thank you,
  Ed


RE: Action which always forwards back to the requesting page

2003-11-23 Thread David Friedman
Franz,

Not all browsers support sending the HTTP_REFERER when you click on a page.
So, your best chances are to either:

1) Store the name of the last action in the session context so you know what
the last page is probably going to be (unless they use multiple browsers at
once when visiting your site).

2) Make your hyperlink for your locale-changing-Action dynamic so on every
page request lists the current page as a parameter to the local-changing
action. Ex: /localChange.do?page=/index.do if you're seeing /index.do,  or
/localChange.do?page=/summary.do if you're on /summary.do.  Be careful about
parameters if parameters are key to the page display.  Then you'd need to
include them in the urls, and, possibly in your redirect or forward after
you change the locale.

Regards,
David

-Original Message-
From: Franz-Josef Herpers [mailto:[EMAIL PROTECTED]
Sent: Sunday, November 23, 2003 8:08 AM
To: Struts Users Mailing List
Subject: Action which always forwards back to the requesting page


Hi,

I have written an action which sets the Locale depending on the language
choice of the user. The possibilty to choose the language should appear
on every page of my web application. My problem know is: How can I
configure an Action (or the forward of an Action) to always go back from
where it was requested.

Thanks in advance
Franz


--
Franz-Josef Herpers
Puschkinallee 9A
12435 Berlin
030/53 21 33 02
0173/54 23 666
[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: Hibernate plugin

2003-11-23 Thread David Friedman
Mark,

I have a simpler approach for Hibernate (v2.0.3 or v2.1 under Struts v1.0 or
v1.1)

1. Start with the Hibernate example Struts PlugIn code and struts-config.xml
configuration text at:
http://www.hibernate.org/105.html

2. Do NOT put any context entries in server.xml or web.xml!

3. Choose any name OTHER than the example java:comp/env/jdbc/mn-test.  Any
name under java:/comp in Tomcat is read-only and cannot be used.  I
selected one using my initial and some related hibernate words
dgf:/hibernate/SessionFactory.  Put that in your hibernate.cfg.xml file as
the 'name=...' parameter of the session-factory tag, along the lines of
this example:

session-factory name=dgf:/hibernate/SessionFactory
!-- properties --
!-- mapping files --
mapping resource=hibernate/Misc.hbm.xml/
/session-factory

If you use a hibernate.properties file, what you need is described here:
http://www.hibernate.org/hib_docs/api/net/sf/hibernate/cfg/Environment.html

Since I use hibernate.cfg.xml instead of hibernate.properties, I'm guessing
you'll need something like this in your hibernate.properties file:
hibernate.jndi.url dgf:/hibernate
hibernate.jndi.class javax.naming.Context
hibernate.session_factory_name SessionFactory

4. Hibernate creates the non-existent JNDI context for me on webapp start
and puts the session-factory in it.  My facade class opens the session this
way:

Content ctx = new InitialContext();
SessionFactory sf = (SessionFactory) ctx.lookup(jndiLocation);
Session session = sf.openSession();

That's all I do.  Oh, I'm using hibernate 2.1beta6 now for my facade because
it allows me to use named parameters in queries and hide the hibernate types
more easily.  (sorry, I think I read too much into Ted Husted's Struts in
Action book, I'm trying to facade EVERYTHING! LOL).

Feel free to email me off-list if you need futher help.

Regards,
David


-Original Message-
From: Mark Lowe [mailto:[EMAIL PROTECTED]
Sent: Monday, November 24, 2003 12:32 AM
To: Struts Users Mailing List
Subject: Hibernate plugin


After spending all night pissing around with various hibernate plugins
to provide a datasource to use with hibernate?

My JNDI datasource reports being okay in my container log,

Context path=/mn-test docBase=mn-test debug=5
reloadable=true crossContext=true
Logger className=org.apache.catalina.logger.FileLogger
prefix=mn-test suffix=.log 
timestamp=true /

Resource name=jdbc/mn-test scope=Shareable
type=javax.sql.DataSource /
ResourceParams name=jdbc/mn-test
..

then in my hibernate.cfg.xml

property name=connection.datasource
java:comp/env/jdbc/mn-test
/property

...

Every-time i try and get the datasource from the servlet context I get
a null pointer exception.. While this of course is a life changing
experience for me, i novelty is waring thin. If anyone has is working
in reality , then any input would be greatly appreciated.


Cheers Mark


-
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: Hibernate plugin

2003-11-23 Thread David Friedman
Shh I don't think I've ever seen any Hibernate errors on 
startup using the code from the Hibernate site. And it works
fine accessing it either through JNDI or a Servlet attribute
named SESSION_FACTORY_KEY. :)

http://www.hibernate.org/105.html

Regards,
David

-Original Message-
From: Joe Hertz [mailto:[EMAIL PROTECTED]
Sent: Monday, November 24, 2003 1:29 AM
To: 'Struts Users Mailing List'
Subject: RE: Hibernate plugin


I got it working when I started with the struts-hibernate example that
Ted Husted wrote. Used the plugin from it.

I believe JNDI is avoided entirely with it.

I get some Hibernate SessionFactory Errors on startup occasionally, but
they stopped me cold.

Fix the addClass() calls here, but otherwise, it goes a little bit like
this:

package struts;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;

import net.sf.hibernate.HibernateException;
import net.sf.hibernate.MappingException;
import net.sf.hibernate.Session;
import net.sf.hibernate.SessionFactory;
import net.sf.hibernate.cfg.Configuration;
import org.apache.struts.action.ActionServlet;
import org.apache.struts.action.PlugIn;
import org.apache.struts.config.ModuleConfig;

/**
 * Initialize the Hibernate SessionFactory for this project
 * as an application scope object.
 *
 * @author Ted Husted
 * @version $Revision: 1.3 $ $Date: 2003/03/14 21:59:41 $
 */
public class HibernatePlugIn implements PlugIn {

/**
 * A field to store the reference to our SessionFactory.
 * Can close and dispose if not null.
 */
private SessionFactory sf;

/**
 * A public identifer for the persistence session,
 * kept in servlet session (client) scope
 * [HIBERNATE_SESSION].
 */
public static String SESSION = HIBERNATE_SESSION;

/**
 * A public identifer for the session factory,
 * kept in application (global) scope
 * [HIBERNATE_SESSION_FACTORY].
 */
public static String SESSION_FACTORY = HIBERNATE_SESSION_FACTORY;

/**
 * Fetch the SessionFactory from application scope.
 * @param request The requeste we are servicing
 * @return The SessionFactory for this application session
 * @throws HibernateException
 */
public static SessionFactory sessionFactory(HttpServletRequest
request)
throws HibernateException {
Object sf =
request.getSession().getServletContext().getAttribute(SESSION_FACTORY);
if (null == sf) {
throw new HibernateException(SESSION_FACTORY);
}
return (SessionFactory) sf;
}


/**
 * Open a new session with the application-scope SessionFactory.
 * Session is not retained, only returned.
 *
 * @param request The requeset we are servicing
 * @return An open session
 * @throws HibernateException
 */
public static Session open(HttpServletRequest request) throws
HibernateException {
return sessionFactory(request).openSession();
}

/**
 * Open a new Session and cache it in the HttpSession or
 * fetch the existing Session.
 *
 * @param request The requeset we are servicing
 * @return An open session
 * @throws net.sf.hibernate.HibernateException if session cannot be
instantiated
 */
public static Session reconnect(HttpServletRequest request)
throws HibernateException {

Session s = (Session)
request.getSession(true).getAttribute(SESSION);
if (null != s) {
s.reconnect();
} else {
s = open(request);
request.getSession().setAttribute(SESSION, s);
}
return s;
}

/**
 * Expire the Session, to ensure fresh data or to switch approaches.
 *
 * @param request The requeset we are servicing
 * @return An open session
 * @throws net.sf.hibernate.HibernateException if session cannot be
instantiated
 */
public static void expire(HttpServletRequest request)
throws HibernateException {

HttpSession httpSession = request.getSession();
if (null!=httpSession) {
Session s = (Session) httpSession.getAttribute(SESSION);
if (null != s) {
s.close();
httpSession.removeAttribute(SESSION);
}
}
}

/**
 * The classes with mappings to add to the Configuration are
enumerated here.
 * There should be a ${class}.hbm.xml mapping file for each class
 * stored with each compiled class file.
 * p
 * To complete the Hibernate setup, there must be a valid
hiberate.properties
 * file under the classes folder (root of the classpath),
 * which specifies the details of the database hookup.
 * p
 * The mapping documents and properties file is all that Hibernate
requires.
 * p
 * A JDBC Driver is not included in this distribution and *must* be
 * available on your server's or container's classpath

RE: Problem in deploying struts app in production environment. Pls help

2003-11-22 Thread David Friedman
What is the .do page error, exactly?  Are there
any error messages in the Tomcat /logs directory?

Regards,
David

-Original Message-
From: Samanth Athrey [mailto:[EMAIL PROTECTED]
Sent: Saturday, November 22, 2003 3:50 AM
To: [EMAIL PROTECTED]
Subject: Problem in deploying struts app in production environment. Pls
help
Importance: High


Hello,
Am using struts1.1, tomcat 4.1.27. During development there was no
problem. But when the same was deployed on th production server, not a
single page was displayed correctly. Struts code is displayed as it is.
When I click on a link, the .do page it says cannot be displayed.

All the jar files are in place and the production environment is a
replica of my development envi. Is there something that am missing here?
Pls help.


Regards,
Samanth Athrey


-
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 in deploying struts app in production environment. Pls help

2003-11-22 Thread David Friedman
We're missing key details

1. Go to the Tomcat manager (often http://hostname:8080/manager/html/list)
application and make sure it is listed.  If it isn't shown, you haven't
deployed it correctly.  Stop/restart Tomcat. If it is still not shown, check
that you either deployed it directly into Tomcat's webapps/ folder for it to
be seen on tomcat startup OR that you edited the server.xml file to ADD the
context entry pointing to the directory used by your production
copy/deployment.

2. Is there a regular web server (Apache httpd?) passing the requests onto
Tomcat?  If so, you might have to edit the Apache httpd's workers.properties
or workers2.properties files to ensure it passes that context through to
Tomcat.

3. Do you have all the libraries you need in TOMCAT_HOME/common/ and
TOMCAT_HOME/shared on your production server as you do on your test server?

If all of the above is set, you should see startup messages in your log
files on both a good context startup as well as on a bad context startup.

Regards,
David

-Original Message-
From: Samanth Athrey [mailto:[EMAIL PROTECTED]
Sent: Saturday, November 22, 2003 4:06 AM
To: 'Struts Users Mailing List'
Subject: RE: Problem in deploying struts app in production environment.
Pls help


No. There are no messages in the logs directory. It just displays a
message The page cannot be found whenever a link is clicked. This is
the standard page that IE throws when a page cannot be found.

Regards
Sam

-Original Message-
From: David Friedman [mailto:[EMAIL PROTECTED]
Sent: Saturday, November 22, 2003 2:25 PM
To: Struts Users Mailing List; [EMAIL PROTECTED]
Subject: RE: Problem in deploying struts app in production environment.
Pls help


What is the .do page error, exactly?  Are there
any error messages in the Tomcat /logs directory?

Regards,
David

-Original Message-
From: Samanth Athrey [mailto:[EMAIL PROTECTED]
Sent: Saturday, November 22, 2003 3:50 AM
To: [EMAIL PROTECTED]
Subject: Problem in deploying struts app in production environment. Pls
help
Importance: High


Hello,
Am using struts1.1, tomcat 4.1.27. During development there was no
problem. But when the same was deployed on th production server, not a
single page was displayed correctly. Struts code is displayed as it is.
When I click on a link, the .do page it says cannot be displayed.

All the jar files are in place and the production environment is a
replica of my development envi. Is there something that am missing here?
Pls help.


Regards,
Samanth Athrey


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


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




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


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



RE: Still no reply for :Problem in grouping using logic iterate logic equal

2003-11-22 Thread David Friedman
This sounds like a job for ...  the DisplayTag Taglib.
See this example page:

http://www.displaytag.org/example-grouping.jsp

Your formbean looks pretty simple:
(Should I ask why your properties start with a capital letter?)
myteam.teamName
myteam.Firstname
myteam.Midinitial
myteam.Lastname

If so it's practically build for the displaytag library, might
even work a bit like this:

displaytag:table name=myTeamFormBean.allTeams
displaytag:column property=teamName title=Team Name group=1/
displaytag:column property=Firstname title=First Name /
displaytag:column property=Midinitial title=Middle Initial /
displaytag:column property=Lastname title=Last Name /
/displaytag:table

If you use the displaytag library, follow their directions
about the handful of apache commons .jar files that need
to be updated!!

Regards,
David

-Original Message-
From: Joe Hertz [mailto:[EMAIL PROTECTED]
Sent: Saturday, November 22, 2003 4:39 AM
To: 'Struts Users Mailing List'
Subject: RE: Still no reply for :Problem in grouping using logic iterate
 logic equal


Your doing a bean:write of the team name inside of your iterate, so
yeah, the team name is going to show up on every iteration. 

What approaches have you tried already? Which is the part your not
getting?


 -Original Message-
 From: Shakti [mailto:[EMAIL PROTECTED] 
 Sent: Saturday, November 22, 2003 4:11 AM
 To: Struts Users Mailing List
 Subject: Still no reply for :Problem in grouping using logic 
 iterate  logic equal
 
 
 
  Hi,
MyTeamFormBean contains an arraylist allTeams having 
  MyTeamRowBean with attributes :
String teamName, first, middle  last
 
logic:iterate id=myteam name=myTeamFormBean 
 property=allTeams
  tr
   td Bbean:write name=myteam 
 property=teamName //B/td
   tdnbsp;/td
  /tr
  tr
   tdnbsp;/td
   tdnbsp;bean:write name=myteam 
  property=Firstname/nbsp;bean:write name=myteam 
  property=Midinitial/nbsp;bean:write name=myteam
 property=Lastname/
  /td
   /tr
  /logic:iterate
 
Which produces something like this 
 
   Team Name 1
  Firstname1 1  Midinitial1 1  Lastname 1 1
Team Name 1
  Firstname1 2  Midinitial1 2  Lastname 1 2
Team Name 1
  Firstname1 3  Midinitial1 3  Lastname 1 3
Team Name 2
  Firstname2 1  Midinitial2 1  Lastname 2 1
Team Name 2
  Firstname2 2  Midinitial2 2  Lastname 2 2
Team Name 2
  Firstname2 3  Midinitial2 3  Lastname 2 3
Team Name 3
  Firstname3 1  Midinitial3 1  Lastname 3 1
Team Name 3
  Firstname3 2  Midinitial3 2  Lastname 3 2
Team Name 3
  Firstname3 3  Midinitial3 3  Lastname 3 3
Team Name 4
  Firstname4 1  Midinitial4 1  Lastname 4 1
Team Name 4
  Firstname4 2  Midinitial4 2  Lastname 4 2
Team Name 4
  Firstname4 3  Midinitial4 3  Lastname 4 3
Team Name 5
  Firstname5 1  Midinitial5 1  Lastname 5 1
Team Name 5
  Firstname5 2  Midinitial5 2  Lastname 5 2
Team Name 5
  Firstname5 3  Midinitial5 3  Lastname 5 3
 
 
but i want something like this. ..
 
 
Team Name 1
  Firstname1 1  Midinitial1 1  Lastname 1 1
  Firstname1 2  Midinitial1 2  Lastname 1 2
  Firstname1 3  Midinitial1 3  Lastname 1 3
Team Name 2
  Firstname2 1  Midinitial2 1  Lastname 2 1
  Firstname2 2  Midinitial2 2  Lastname 2 2
  Firstname2 3  Midinitial2 3  Lastname 2 3
Team Name 3
  Firstname3 1  Midinitial3 1  Lastname 3 1
  Firstname3 2  Midinitial3 2  Lastname 3 2
  Firstname3 3  Midinitial3 3  Lastname 3 3
Team Name 4
  Firstname4 1  Midinitial4 1  Lastname 4 1
  Firstname4 2  Midinitial4 2  Lastname 4 2
  Firstname4 3  Midinitial4 3  Lastname 4 3
Team Name 5
  Firstname5 1  Midinitial5 1  Lastname 5 1
  Firstname5 2  Midinitial5 2  Lastname 5 2
  Firstname5 3  Midinitial5 3  Lastname 5 3
 
 
 
  can anyone plz help me out in this ...
 
  Thanks in advance ..
  Shakti..
 
 
 
 -
 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: [OT] xdoclet + hibernate

2003-11-22 Thread David Friedman
Mark,

There are plenty of Hibernate and Xdoclet questions
on the hibernate forum:
http://forum.hibernate.org

Regards,
David

-Original Message-
From: Mark Lowe [mailto:[EMAIL PROTECTED]
Sent: Saturday, November 22, 2003 9:32 AM
To: Struts Users Mailing List
Subject: Re: [OT] xdoclet + hibernate


Thanks Matt

I found the xdoclet list just after I posted this question. Hopefully 
the list is as good as this one.

I've been through the xpetstore demo.. The hibernate tags are along the 
same lines as mine and there's nothing obviously wrong with my build 
file.

How does xdoclet fail? If I've an error in my tags will it fail to 
generate any files? Or would it tell me that one of my tags is duff?

Cheers Mark

On 22 Nov 2003, at 13:42, Matt Pease wrote:

 If you want examples of combining the two, as well as
 using xdoclet with a bunch of other things:

 JSP, Struts, Sitemesh, EJB 2.0 and CMP 2.0, Velocity, WebWork,
 Sitemesh, POJO and Hibernate.

 then check out http://xpetstore.sourceforge.net/

 matt

 -Original Message-
 From: Mark Lowe [mailto:[EMAIL PROTECTED]
 Sent: Saturday, November 22, 2003 7:23 AM
 To: Struts Users Mailing List
 Subject: [OT] xdoclet + hibernate


 Sorry to post this group with an almost unrelated question, but I'm
 sure someone on this list must be using xdoclet to generate hibernate
 resources.

 I wont take the piss and post the problem on this list but I would
 appreciate it if anyone who's been using hibernatedoclet could drop me
 a mail..

 Cheers Mark


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


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



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


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



RE: DynaValidator can't get validation to work

2003-11-22 Thread David Friedman
Your login.jsp seems to be missing the form and fields. Do you have your
html:javascript formName=UserForm/ in it so you get the validation code?
Does your login page form also set the html:form onsubmit=return
validateUserForm(this)  ?

Regards,
David

-Original Message-
From: M.Schipperheyn [mailto:[EMAIL PROTECTED]
Sent: Saturday, November 22, 2003 1:31 PM
To: [EMAIL PROTECTED]
Subject: DynaValidator can't get validation to work


Hi,

I'm a newbie and I can't get validation to work using Dynabeans and
validation. Any help's appreciated. All the stuff I find on-line just
doesn't seem to cut it.
I'm getting no errors. When I post an empty username or password, no errors
are shown on the page. Input doesn't seem to get validated.

[Struts-config]
   form-beans
form-bean dynamic=true name=UserForm
type=org.apache.struts.validator.DynaValidatorForm
form-property name=username type=java.lang.String /
form-property name=password type=java.lang.String /
/form-bean
/form-beans

   action-mappings
action
input=/logon.jsp
name=UserForm
path=/logon
scope=request
type=nl.executieverkoop.action.LogonAction
validate=true

forward name=success path=home /
forward name=failure path=login /
/action
/action-mappings

plug-in className=org.apache.struts.validator.ValidatorPlugIn
set-property property=pathnames
value=/WEB-INF/validator-rules.xml,/WEB-INF/validator.xml /
/plug-in

validator.xml and validator-rules.xml are getting loaded. I can see it in
the log.

[validator.xml]
formset
form name=UserForm

field
property=username
depends=required

msg
name=required
key=prompt.username.required/
/field
field
property=password
depends=required,minLength

arg0
key=prompt.password/

var
var-nameminlength/var-name
var-value3/var-value
/var
/field
/form
/formset

[LogonAction]
public class LogonAction extends Action {
public ActionForward execute(
ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response)
throws Exception {

DynaValidatorForm userForm = (DynaValidatorForm) form;
Session session;
UserBean user;

Locale locale = getLocale(request);
MessageResources messages = getResources(request);

String username = (String)

PropertyUtils.getSimpleProperty(form, username);
String password = (String)

PropertyUtils.getSimpleProperty(form, password);

//hibernate lookup user
try{
SessionFactory sf = (SessionFactory)
servlet.getServletContext().getAttribute(HIBERNATE_SESSION_FACTORY);
session = sf.openSession();
List users = session.find(from UserBean as
user where user.username = ? and user.password = ?, new Object[]{username,
password},new Type[] { Hibernate.STRING, Hibernate.STRING} );
if(users.isEmpty()) {
return
mapping.findForward(failure);
}
sf.close();
}catch (HibernateException e) {
System.out.println(e);
}

return mapping.findForward(success);
}
}

[logon.jsp]
%@ page language=java %
%@ taglib  uri=/WEB-INF/struts-html.tld prefix=html %
%@ taglib uri=/WEB-INF/struts-bean.tld prefix=bean %
%@ taglib uri=/WEB-INF/struts-logic.tld prefix=logic %

logic:messagesPresent
UL

html:messages id=error
LIbean:write name=error//LI
/html:messages
/UL
.

Any ideas?

Kind regards,

Marc


-
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: getParameter() returns null on multipart requests

2003-11-22 Thread David Friedman
Terry,

1. Does your actionform receive data?

2. Did you set the enctype on your form appropriately for
multipart/form-data ?

Regards,
David

-Original Message-
From: Terry Brick [mailto:[EMAIL PROTECTED]
Sent: Saturday, November 22, 2003 1:08 PM
To: [EMAIL PROTECTED]
Subject: getParameter() returns null on multipart requests


Hello,
When I submit a multipart form to my action I am
unable to get use getParameter() on the request object
to get my form field values.  As I understand it
struts is supposed to automatically create a
MultipartRequestWrapper which allows you to do this
for multipart requests...
I've seen some postings regarding this, but I still
don't understand what I need to do.  I think there was
some mention that MultipartRequestWrapper doesn't work
right if you're not utilizing the ActionForm?

I also tried instantiating my own
MultipartRequestWrapper by doing new
MultipartRequestWrapper(request).  That doesn't solve
the problem either.

Any ideas? I'm using the latest nightly build (Struts
1.2).

Thanks!


__
Do you Yahoo!?
Free Pop-Up Blocker - Get it now
http://companion.yahoo.com/

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


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



RE: tiles:insert page action with form - problem?

2003-11-21 Thread David Friedman
Fred,

Try checking out a org.apache.struts.tiles.actions.TilesAction as your
action type.  That gives you direct access to the tiles layout so you can
add/set tiles information to your choice of values.

Regards,
David

-Original Message-
From: Fred Bloggs [mailto:[EMAIL PROTECTED]
Sent: Friday, November 21, 2003 7:38 AM
To: Struts Users Mailing List
Subject: Re: tiles:insert page action with form - problem?


Dear All

I have been struggling with this for a while now and
seemed to have got part of the way but now I seem to
have hit a brick wall.

I would like to insert a tile (into a jsp page) which
is actually the result of action.  The action takes as
input form parameters.

I have tried the following:

tiles:insert
page=/getnewsdo?categoryid=167topicid=234/

This works and populates the associate form correctly,
but how do I do it programmatically in my jsp page if
I have the two variable available, i.e. categorid and
topicid  using (Exepression Lanaguage) EL in the jsp?

Ideally I would like to do the following:

tiles:insert
page=/getnewsdo?categoryid=${categoriyid}topicid=${topicid}/

But this does not work.  I cannot figure out how to
make it work.  I have scanned the web and found a
reference that suggests that EL may not work in
certain tags if the tag has tagdependant set.

Is there another  better way of doing this with the
tiles:insert or tiles:put tags?

I am using Struts 1.1 with Tomcat 4.1.28

I would be grateful for any pointers.


--- Fred Bloggs [EMAIL PROTECTED] wrote:
 Dear All

 I am relatively new to using struts tiles and I am
 having a problem trying to figure out how to do the
 following:

 I have an action that returns the news where the
 users
 submits a form specifying the subject category and
 date.  The action finds the relevant news and then
 forwards it to a view page to be displayed for the
 user.  This works.

 Now I would like to re-use the action but this time
 I
 know in advance what subject category and date need
 to
 be displayed.  I want to insert the tile into
 another
 page.

 I have tried the following but it does not work:

 tiles:insert page=/getnews
   tiles:put name=category  value=${val.category}
 /
   tiles:put name=bean beanName=GetnewsForm/
 /tiles:insert
 This just makes the bean available to the tile for
 use
 inside the that jsp.

 However the above does not cause the form to be be
 populated, infact no form is passed to  the action
 i.e. It is  null.

 How would I insert the results of an action into a
 jsp
 which uses parameters harvested from that jsp which
 are used to populate the form?  I.e. How do I
 programmatically cause a form to be created that is
 passed to the action from a tiles:insert (or
 similar)?

 I thought about having a separate jsp page that has
 html:form action= with html:hidden parameters made
 available to it by the tiles:put from the original
 insert. But I could not figure out how to
 automatically make that page execute the submission
 without waiting for the user to press the submit
 button.

 Any help will be greatly appreciated.

 Thanks in advance.

 __
 Do you Yahoo!?
 Protect your identity with Yahoo! Mail AddressGuard
 http://antispam.yahoo.com/whatsnewfree


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



__
Do you Yahoo!?
Free Pop-Up Blocker - Get it now
http://companion.yahoo.com/

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


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



RE: Inheritance in tile definition files I

2003-11-21 Thread David Friedman
How do you get to your JSP?  Do you use and action?  If so, are you using
'path=login.form' or 'path=form.layout' and do you see any tiles loading
errors?

Are you getting to your JSP directly from the outside world (not through an
action's mapping)?  If so, you need to first load your tile definition in
your main JSP by using
tiles:insert definition=some.tiles.definition.name/

Regards,

David

  -Original Message-
  From: Ed Dowgiallo [mailto:[EMAIL PROTECTED]
  Sent: Friday, November 21, 2003 1:07 PM
  To: [EMAIL PROTECTED]
  Subject: Inheritance in tile definition files I


  I'm having a little trouble with the tile definition files after working
through the tutorial.  As a simple example of what I am hitting, I get the
error message:

  javax.servlet.jsp.JspException: Error - tag useAttribute : attribute
'title' not found in context. Check tag syntax

  at
org.apache.struts.taglib.tiles.UseAttributeTag.doStartTag(UseAttributeTag.ja
va:225)

  at _common._header._jspService(_header.java:50)

  [SRC:/common/header.jsp:21]

  The relevant section of my definition file looks like this:

!--
= --

--
!-- Form
   --

--
!--
= --
definition name=form.layout page=/layouts/formLayout.jsp
  put name=system-short-name value=TDL/
  put name=user-name value=Guest/
  put name=title   value=Form Page Layout/
  put name=header  value=/common/header.jsp/
  put name=content value=${content}/
  put name=footer  value=/common/footer.jsp/
/definition
!--
= --

--
!-- Security Module
  --

--
!--
= --
definition name=login.form extends=form.layout
  put name=title   value=Login Form/
  put name=content value=/security/login.jsp/
/definition

  header.jsp contains the following:

  %@ page contentType=text/html;charset=UTF-8%
  %@ taglib prefix=tiles uri=/WEB-INF/struts-tiles.tld%
  table width=100% border=0 cellspacing=0 cellpadding=0

  ...

tr class=banner
  td width=3/td
  td class=system-name align=left width=80%
span class=banner-valueTDL#160;/span
span class=page-titletiles:getAsString
name=title//span
  /td

  ...

  Comments and suggestions would be greatly appreciated.
  Ed


RE: Inheritance in tile definition files I

2003-11-21 Thread David Friedman
Ed,

I wrote about this back in August, at that time,
Struts 1.0 had a limitation with logic:forwards
(see below).  The v1.1 production release says the
same thing:

 The logical name of the global ActionForward entry
 that identifies the destination, and forwarding
 approach, to be used. Note: forwarding to Tiles
 definitions is not supported from this tag. You
 should forward to them from an Action subclass.

http://jakarta.apache.org/struts/userGuide/struts-logic.html

A logic:redirect would be better so it goes outside
and does a new request for that page.  I'd recommend
an ActionForward class, but, if you go directly to
the page, heed my tiles:insert definition= note
below.

Regards,
David

-Original Message-
From: Ed Dowgiallo [mailto:[EMAIL PROTECTED]
Sent: Friday, November 21, 2003 2:12 PM
To: Struts Users Mailing List
Subject: Re: Inheritance in tile definition files I


I get to the JSP by forwarding from a non-Struts JSP.  There do not appear
to be any tiles loading errors.

From welcome.jsp:

%@ page contentType=text/html;charset=UTF-8%
%@ taglib prefix=logic uri=/WEB-INF/struts-logic.tld%
html
  body
logic:forward name=welcome/
  /body
/html

From struts-config.xml:

  global-forwards
forward name=welcome path=/loginForm.do/
  /global-forwards

  action-mappings
action path=/loginForm parameter=login.form name=loginForm
validate=false scope=request
type=org.apache.struts.actions.ForwardAction/
  /action-mappings

Thank you,
Ed
- Original Message -
From: David Friedman [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]
Sent: Friday, November 21, 2003 1:22 PM
Subject: RE: Inheritance in tile definition files I


 How do you get to your JSP?  Do you use and action?  If so, are you using
 'path=login.form' or 'path=form.layout' and do you see any tiles
loading
 errors?

 Are you getting to your JSP directly from the outside world (not through
an
 action's mapping)?  If so, you need to first load your tile definition in
 your main JSP by using
 tiles:insert definition=some.tiles.definition.name/

 Regards,

 David

   -Original Message-
   From: Ed Dowgiallo [mailto:[EMAIL PROTECTED]
   Sent: Friday, November 21, 2003 1:07 PM
   To: [EMAIL PROTECTED]
   Subject: Inheritance in tile definition files I


   I'm having a little trouble with the tile definition files after working
 through the tutorial.  As a simple example of what I am hitting, I get the
 error message:

   javax.servlet.jsp.JspException: Error - tag useAttribute : attribute
 'title' not found in context. Check tag syntax

   at

org.apache.struts.taglib.tiles.UseAttributeTag.doStartTag(UseAttributeTag.ja
 va:225)

   at _common._header._jspService(_header.java:50)

   [SRC:/common/header.jsp:21]

   The relevant section of my definition file looks like this:

 !--
 = --

 --
 !-- Form
--

 --
 !--
 = --
 definition name=form.layout page=/layouts/formLayout.jsp
   put name=system-short-name value=TDL/
   put name=user-name value=Guest/
   put name=title   value=Form Page Layout/
   put name=header  value=/common/header.jsp/
   put name=content value=${content}/
   put name=footer  value=/common/footer.jsp/
 /definition
 !--
 = --

 --
 !-- Security Module
   --

 --
 !--
 = --
 definition name=login.form extends=form.layout
   put name=title   value=Login Form/
   put name=content value=/security/login.jsp/
 /definition

   header.jsp contains the following:

   %@ page contentType=text/html;charset=UTF-8%
   %@ taglib prefix=tiles uri=/WEB-INF/struts-tiles.tld%
   table width=100% border=0 cellspacing=0 cellpadding=0

   ...

 tr class=banner
   td width=3/td
   td class=system-name align=left width=80%
 span class=banner-valueTDL#160;/span
 span class=page-titletiles:getAsString
 name=title//span
   /td

   ...

   Comments and suggestions would be greatly appreciated.
   Ed



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



RE: Email Validation Rules

2003-11-18 Thread David Friedman
I'd suggest calling:

org.apache.commons.validator.GenericValidator.isEmail(String arg);


-Original Message-
From: Ramadoss Chinnakuzhandai [mailto:[EMAIL PROTECTED]
Sent: Tuesday, November 18, 2003 1:03 PM
To: Struts Users Mailing List
Subject: Email Validation Rules


Can any one correct me where I'm wrong using the following rule for
validating email addressIt fails to validate against the valid email
address..?

[EMAIL PROTECTED],4}$

Tnx in advance :)

-Ram







-
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 to disable submit button when click on checkbox

2003-11-17 Thread David Friedman
I misread your post.  If the checkboxes are in the same form, here is some
example javascript code in an HTML page (save it as example.html, check
some boxes, then hit submit. Everything you need to know should be in it.
The rest is between you and JavaScript.

html
head
titletitle
/title
/head
body
script language=javascript
function traverse(frm) {
var i = frm.length;
alert(size:  + i +  elements);
for ( j = 0 ;j  i ; j++ ) {
if ( frm.elements[j].type ==  checkbox ) {
alert( Analyzing type  + frm.elements[j].type +
, named  + frm.elements[j].name +
, value  + frm.elements[j].value +
, checked  + frm.elements[j].checked );
}
};
return david.html;
}
/script
form name=david action=example.html onSubmit=traverse(this)
input type=checkbox name=id value=11
input type=checkbox name=id value=22
input type=submit name=submit value=submit
/form
/body
/html


-Original Message-
From: YuenSun Lam [mailto:[EMAIL PROTECTED]
Sent: Monday, November 17, 2003 11:49 PM
To: Struts Users Mailing List
Subject: RE: how to disable submit button when click on checkbox


Thanks for the reply. Do you mean change it to
onclick=this.form.delete.disabled=true?It's still not working. The
checkbox is not even checked when click on it.

David Friedman [EMAIL PROTECTED] wrote:Philip,

If it is in the same  ...  form tag, try this javascript:
this.form.delete.disabled=true

-David

-Original Message-
From: Philip [mailto:[EMAIL PROTECTED]
Sent: Monday, November 17, 2003 11:02 PM
To: [EMAIL PROTECTED]
Subject: how to disable submit button when click on checkbox


I have a question regarding checkbox, how can I disable a certain submit
button when click on a checkbox?
I tried the following but is not working:

onclick=document.formName.delete.disabled=true /

Also, is there a way I can count how many checkbox are selected in my jsp
code?

Please kindly help me.



-
Do you Yahoo!?
Protect your identity with Yahoo! Mail AddressGuard


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



-
Do you Yahoo!?
Protect your identity with Yahoo! Mail AddressGuard


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



RE: Simple Question

2003-11-14 Thread David Friedman
For maintaining the JSESSIONID if someone has their cookies turned off -
this ensures the id is embedded in the link when cookies aren't available.

Regards,
David

-Original Message-
From: Srinivas Kusunam [mailto:[EMAIL PROTECTED]
Sent: Friday, November 14, 2003 3:49 PM
To: 
Subject: Simple Question



Hi All,

  I my team while in a Code-Review we had a discussion wether to use

  html:img  or normal a href=...  as the later
one can do the same work. One option accepted was why do we need Tag over
head if a href= can handle that ??

  What do you guys suggest 

Thanks,
Srini


-
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: R: who want to join xmoon project ?

2003-11-13 Thread David Friedman
Mario,

Where did you hear that dynabean will not be supported?  I'm using the 2.1b6
release and it has components that can be dynabeans.  I didn't see any notes
about it going away anytime soon. (not that I've used those dynabean
components yet).

Regards,
David

-Original Message-
From: Mario [mailto:[EMAIL PROTECTED]
Sent: Thursday, November 13, 2003 10:02 AM
To: 'Struts Users Mailing List'
Subject: R: R: who want to join xmoon project ?


Yes but i'll remove it because hibernate probably will not support dynabean
in the future. i'm using commons sql and i'll publish another demo soon (i
hope)

-Messaggio originale-
Da: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Inviato: giovedì 13 novembre 2003 15.50
A: Struts Users Mailing List
Oggetto: Re: R: who want to join xmoon project ?


I noticed that the example has a couple of Hibernate xml files in it aswell
?

Mike



|-+
| |   Mario  |
| |   [EMAIL PROTECTED]|
| |   idea.com|
| ||
| |   13/11/2003 11:14 |
| |   AM   |
| |   Please respond to|
| |   Struts Users|
| |   Mailing List|
|-+

---
---|
  |
|
  |   To:   [EMAIL PROTECTED]
|
  |   cc:
|
  |   Subject:  R: who want to join xmoon project ?
|

---
---|




Added new documentation about the login example. A quick tour of xmoon.



http://www.xmoon.it



-Messaggio originale-
Da: Mario [mailto:[EMAIL PROTECTED]
Inviato: mercoledì 12 novembre 2003 14.30
A: '[EMAIL PROTECTED]'
Oggetto: who want to join xmoon project ?



It's an opensource project that speed up your development time.

http://www.xmoon.it http://www.xmoon.it/



contact me.















The information in this message is confidential and may be legally
privileged. It is intended solely for the addressee; access to this
email by anyone else is unauthorised.

If you are not the intended recipient: (1) you are kindly requested
to return a copy of this message to the sender indicating that you
have received it in error, and to destroy the received copy; and (2)
any disclosure or distribution of this message, as well as any action
taken or omitted to be taken in reliance on its content, is prohibited
and may be unlawful.




-
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: Dynamic Image from DB to JSP

2003-11-12 Thread David Friedman
Marc,

If you have performance problems, here is a suggestion:

Keep an index in your application scope that has the totals (since
load-time) of how many times each item has been displayed.  Then, keep
copies of the top 50 on-disk.  That way, if the image is one of your top-50,
you don't need the database but can simply open the disk file and read/print
it for speed on your most-used ones and only remove the temp files you made
for the less frequently used ones.

Regards,
David

-Original Message-
From: Marc AMIR-TAHMASSEB [mailto:[EMAIL PROTECTED]
Sent: Wednesday, November 12, 2003 9:59 AM
To: Struts Users Mailing List
Subject: Re: Dynamic Image from DB to JSP


Dear Hubert and David,
thanks for your help. Finaly i did like this :

in my jsp  a create a image tag as :
img src=loadImage.do?id=%=Integer.toString(image.getId())% 

loadImage.do create first a Java Temporary File (File.createTempFile)
containing the bytes of the image comming from the DB. Then it generates
a document with the appropriate content type (that i stored before)
and i push the image bytes[] to the response like this :

response.setContentType(image/pjpeg);
response.setHeader(Content-Disposition, filename=+img.getName());
response.setHeader(Cache-Control, no-cache);
response.setContentLength((int)img.length());

OutputStream ou = response.getOutputStream();
FileInputStream in = new FileInputStream(img);
byte[] buffer = new byte[(int)img.length()];
in.read(buffer);
ou.write(buffer);
ou.flush();
ou.close();
in.close();
img.delete();
img.deleteOnExit();

Regards,
Marc

David Friedman wrote:

Marc,

That's a tricky one I've planned for but haven't started yet.  My research
showed the html:img tag should be used with a path.  That path can invoke
an
action (direct, not tiled) that sets the content-type to the right type of
image then tosses out the binary stream. So, it should be something like
this:

html:write get a URL such as /images.do?id=555 or
http://somehost/images.do?id=555;.  Then your map an action for /images
to set the content type, open the database, and print the binary stream
appropriately.  Sounds a bit list an advertising program, almost. :)

If something else works for you, please let me know as this is type of
image
display is on my to-do list.

Regards,
David




-
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: Accessing application scope in Action.execute()

2003-11-10 Thread David Friedman
Dear Looser, 

Inside the execute, you can set/get application
scope properties using the Action class methods
getServlet() followed by two more commands:

getServlet().getServletContext().getAttribute(String);
OR
getServlet().getServletContext().setAttribute(String, obj);

Regards,
David

-Original Message-
From: Looser [mailto:[EMAIL PROTECTED]
Sent: Monday, November 10, 2003 10:03 AM
To: struts Mailinglist
Subject: Accessing application scope in Action.execute()


Hi,

is there any chance to access objects in application scope in my action 
classes ?

I have to override the .execute(ActionMapping mapping,ActionForm 
form,HttpServletRequest request,HttpServletResponse response) method but 
none of these parameters give me access to application scope like 
'getServletContext().getAttribute(myAttribute)' would do.

Which is the best practise to store objects in application scope and 
retrieve them back in my ActionClasses ?

Thx for your answers...


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



  1   2   >