RE: Help on ApplicationResources

2004-03-04 Thread Todd G. Nist
Kamakshya,

There is an implementation of this available at
http://sourceforge.net/project/showfiles.php?group_id=49385.

Go to the above site and about halfway down the page you will find a project
category called:
MessageResources Impls 

Under this you will find a package called:

ojb-msg-resources

You can download it along with the demo application to see how to apply it
to your application.

HTH,

Todd

-Original Message-
From: Prasad, Kamakshya [mailto:[EMAIL PROTECTED]
Sent: Thursday, March 04, 2004 12:23 AM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: Help on ApplicationResources


Hi All,
 
We are using struts framework for building an application for a client.
In the system, the client wants to have all the error messages, labels
etc in the database instead of having them in a properties file. Please
let me know that how can we extend the necessary packages provided by
struts with a minimal changes and with the ability to continue using the
normal functionalities provided by struts like bean:message, errors,
ActionErrors etc.
 
Thanks and Regards,
Kamakshya 
 


begin 666 winmail.dat
M)\^(A4.`0:0 `$```!``$``0[EMAIL PROTECTED](Y 0```#H``$(@ `
M ```$E032Y-:6-R;[EMAIL PROTECTED];Y.;W1E`#$(`0V ! `[EMAIL PROTECTED]``$
M@ ,[EMAIL PROTECTED]'[EMAIL PROTECTED] `- (```HP```$+
M`,```,`)@``P`I```#`X```,[EMAIL PROTECTED]'@!P``$`
M```=25L!O;B!!'!L:6-A=EO;E)EV]UF-EP``7$``0``
M`!8!Q '[EMAIL PROTECTED](N:@FEO($!QA1T,`0```!D```!33510
M.E1.25-40$)%3$Q33U542Y.150`[EMAIL PROTECTED] ``8.`(TH_,!Q $
[EMAIL PROTECTED]01F(X4NFB0J*$0'VV* ```#`!0.`0L`
M'[EMAIL PROTECTED])$ $4! ``$ 0``#H``!,6D9U.D9'= ,`@!R8W!G,3(U
MXC(#0W1E 5!`0,!]_\*@ *D`^0'$P* #_,`4 16/PA5![(1)0Y1`P$`-H
MX0K V5T,@8`!L,1)?8S!$83MS 2+!$S.\)][8[!\.,#41(@[EMAIL PROTECTED],PL)
M`60S-A90[EMAIL PROTECTED])A`,!KVAY82PGJ(*A J 5@$D[EMAIL PROTECTED]( .1!W +44'
M@ (P%T:0(@(]F(/1T:[EMAIL PROTECTED]V 8!Z01^@(@0' Z+R\:PAA8P$0
M!;!G92[2;[EMAIL PROTECTED] #8H%D*@,1U ;W=F`Q 'DYPAP/PG !P7VD`9#TT
M.3,X-2[Y'9I';R @)$8![0!N!=AZ0`) .L![199B=0,A,0= 9G=A2!D
[EMAIL PROTECTED] F,@JP(E @[EMAIL PROTECTED] #\P#(. )S(HP+4Y!C'Z!E9P6P* JH'LI
M@ F .AV5`9$%T 0]THX5('D'3!!)'R$$(7T=J54G,!*!(#,I+P#0:P\H
[EMAIL PROTECTED](M;7/9RT8(SE'9I9*3$JH/#HA%[!A)T FX![0%[#\;FI
M42 P)B,!``1@'M#^ M0# ?I8!%! D-1_R7R-H(H(#41)@$O,07 -HGQ
M)0M([EMAIL PROTECTED] 1PS$=N.HM/+)/!1!GX '0QSRS'91`V$Z(%!RDF$L@0L
M'.@@6P# LP,0)@`Z:R+ /S) *J#.;@!T 4$')V# +@([EMAIL PROTECTED]@+FIP71V4
[EMAIL PROTECTED] ^\!Y0'!S9@0C3]P30K $] @,#0_(L!T$1@( [EMAIL PROTECTED](S$,!33M6
M/O!S='(GD'/B+0$`=D!J'2 *P 0KBXV@ #0'F N(C$[1@:=4A1K\B0$*E
M=6(B\F$^\$AE;' ?\ [EMAIL PROTECTED]\VFS',2LZ9D0PF '87]+;57(0$@[EMAIL PROTECTED]
M!2F@:[EMAIL PROTECTED];!K*: %L6+Z=0,09$^[EMAIL PROTECTED]:P'W$E!4DH='-Y
M_T80'U _8R4O0I4 !P4 '_)@$3X:A*T$F(P20`V %P/L'@2RS]P(,%*
MX#,U%[EMAIL PROTECTED]'1#L 1/S D0 [EMAIL PROTECTED](F,6U8LKTJ`W $D!^P
[EMAIL PROTECTED]'90?0 5 !X @:[YN-\(3X$Q-\$T0G=6H?\.T GP)T F
M,B* +2$L@L!/S U! BP4'0`0`G0)Y[QV43\4UHRH`;0N !W ]8?\3T35P
M!Y$G(C6G`: #$;@_R@@)@$%H (PX *4$]5)C+'91=T')C(F9U;B,0?Q_!
M!T FX%OR8/E/MC:P:ZTD#Q7X !P.EE/C]PUU;#5Y [EMAIL PROTECTED]:P_UB0
M)04MM1Y0`' =,3+,!9PL1:R8_F$XK?70'@!$ $```!+/$,R-3)$
[EMAIL PROTECTED]0S8P0D1,T,Q,S!$1$8P03(R.3)0-AET86PM;[EMAIL PROTECTED]
M8V%P:71A;'-EG9I8VEN9RYC;RYJ#X```,`5D!P``@ @@[EMAIL PROTECTED]
MP ```$8``X4#``*  ``# [EMAIL PROTECTED]
MA0,`'8 (( 8``, ```!``%`P`R@ @@
[EMAIL PROTECTED] ```$8`4H4``=J`0``#.  ``# 
[EMAIL PROTECTED] `P`T@ @@[EMAIL PROTECTED] ```$8`
M!H4+`#B  ``# [EMAIL PROTECTED],`.8 (
M( 8``, ```!`!%`P`[@ @@[EMAIL PROTECTED] ``
M`$8`(4`$F  ``# [EMAIL PROTECTED]
M``$`'@!*@ @@[EMAIL PROTECTED] ```$8`-X4```$!
M`!X`2X (( 8``, ```!`#B%```!`0`
M`?@/`0```! ```SIY!$*8CA2Z:)HH1`?;9`@'Z#P$0LZ01F(
MX4NFB0J*$0'VV0(!^P\!DP`XH;L0!40J[ `K*E;``!M
MW!S=YD;P``$Y)5$'[EMAIL PROTECTED]1]C=6UE;G1S(%N
M9!3971T:6YGUQT;FES=%Q,;V-A;!3971T:6YGUQ!'!L:6-A=EO;B!$
M871A7$UI8W)OV]F=%Q/=71L;V]K7UA:6QB;[EMAIL PROTECTED]'-T```#`/X/!0,`
[EMAIL PROTECTED],# P,# P,#!,T$W.3 T-#(Y.#A%,31038X
M.3!!.$$Q,3 Q1C9$.4,T-T$V.3 P``,`!A!=M84H`P`'$+0#```#`! 0
M``,`$1 `'@`($ $```!E2T%-04M32%E!+%1(15)%25-!3DE-
M4$Q%345.5$%424].3T942$E3059!24Q!0DQ%051(5%10.B\O4T]54D-%1D]2
H1T5.150O4%)/2D5#5]32$]71DE,15-02% _1U)/55!)1 !-)0``
`
end



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



RE: Encode/Encrypt url parameters?

2004-02-25 Thread Todd G. Nist
Jacob,

I would be interested in looking at your solution for this problem.  Thanks
in advance.

Regards,

Todd

-Original Message-
From: Hookom, Jacob [mailto:[EMAIL PROTECTED]
Sent: Wednesday, February 25, 2004 12:00 PM
To: Struts Users Mailing List
Subject: RE: Encode/Encrypt url parameters?


I wrote a CryptoFactory to take care of this.  We use it for cross domain
session validation.

// example code:
CryptoFactory cf = CryptoFactory.create(aPassword,PBEWithMD5AndDES);
Date goodUntil = new Date(System.currentTimeMillis()+somePeriodMs);
String token = cf.encryptUrl(+goodUntil.getTime());
request.setAttribute(token, token);



Then, we have a CryptoFilter which looks for a param to validate locally
with the same password and algorithm.  The result is the +timeLongMillis
of when the token is good until which I compare to now.

Any kind of String data can be encrypted, we just use what I wrote as kind
of a key that's only good for so long to download reports from another
server with the CryptoFilter installed.

If anyone's interested in the source code (two classes and an exception
class), feel free to email me DIRECTLY.  US Export laws apply here ;-)

-Jacob

-Original Message-
From: Jim Theodoridis [mailto:[EMAIL PROTECTED]
Sent: Wednesday, February 25, 2004 10:45 AM
To: Struts Users Mailing List
Subject: Re: Encode/Encrypt url parameters?

Maybe U can use javascript to set the value of parameters to hidden fields??




- Original Message -
From: David Erickson [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]
Sent: Wednesday, February 25, 2004 3:32 AM
Subject: Re: Encode/Encrypt url parameters?


 Aye Encrypt is exactly what I'm needing to do.  Thanks!
 -David

 - Original Message -
 From: Dhaliwal, Pritpal (HQP) [EMAIL PROTECTED]
 To: Struts Users Mailing List [EMAIL PROTECTED]
 Sent: Tuesday, February 24, 2004 6:04 PM
 Subject: RE: Encode/Encrypt url parameters?


  I think you really mean encrypt.. Not just code and decode..
 
  Look at this: http://javaalmanac.com/egs/javax.crypto/DesFile.html
 
  URLDecoder is and URLEncoder is put put those %20 instead of space in
the
  URL I think.. Doesn't really add any security to what is URLEncoded.
 
  I guess you can get the encrypted value.. URLEncode it.. Put it as a
 hidden
  parameter.  Then decrypt it when you get back.. The little tutorial/code
I
  linked should help you.
 
  Pritpal Dhaliwal
 
 
  -Original Message-
  From: Geeta Ramani [mailto:[EMAIL PROTECTED]
  Sent: Tuesday, February 24, 2004 4:42 PM
  To: Struts Users Mailing List
  Subject: Re: Encode/Encrypt url parameters?
 
 
  David:
 
  It's been a real long day and my brain's fuzzing over.. but I'm assuming
 you
  know all about java.net.URLDecoder and java.net.URLEncoder..? geeta
 
  David Erickson wrote:
 
   Hi I was wondering if there are any easy to use Java classes or
   otherwise that could be used to encrypt or encode url parameters?
   Basically what I want to do is this:
  
   Action (encodes the url parameters, puts them into the request object)
   - forwards to jsp containing a link that grabs those parameters from
   the request - click link takes you to an Action that decodes and uses
   them.
  
   The parameters are to files on our site.. its no big deal because they
   are in the web-inf directory and unaccessable from the web but I'd
   rather hide them from the surfers anyway.  Is there any good way to do
   this?
  
   Thanks,
   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]
 
 
 
  -
  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: hibernate-struts example -- where is it?

2004-02-12 Thread Todd G. Nist
Daniel,

It appears to be out there at the following url, about half way down the
page.  I would also look at the appfuse project on the same page, it
provides a very good example.

http://sourceforge.net/project/showfiles.php?group_id=49385

There are also several other examples out there:

http://hibernate.bluemars.net/114.html
http://homepage.mac.com/edahand/projects/java/example1.html

HTH,

Todd

-Original Message-
From: Tarkenton, Daniel S. [mailto:[EMAIL PROTECTED]
Sent: Thursday, February 12, 2004 10:36 AM
To: '[EMAIL PROTECTED]'
Subject: hibernate-struts example -- where is it?


Hello all.  Long time struts user here, newbie to hibernate.  I found a link
on the hibernate.org site to a struts-hibernate example written by Ted
Husted.  I thought this would be a great example for me since I really
learned a lot from the Struts in Action book.



Well the link was to http://struts.sourceforge.net/#welcome but I could not
find the struts-hibernate example there.  I can't find it anywhere.  Is this
still around, and where can I get it?

Thanks!





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



RE: [OT] eclipse and jsp editing

2003-12-31 Thread Todd G. Nist
MyEclipse works well.  It dose cost $30.00, but seems well worth it based on
the features and ease of use and no I am not associated with the company.
For more information look at:

  http://www.myeclipseide.com

Hope that helps.

Regards,
Todd

-Original Message-
From: Ashish Kulkarni [mailto:[EMAIL PROTECTED]
Sent: Wednesday, December 31, 2003 12:41 AM
To: Struts Users Mailing List
Subject: [OT] eclipse and jsp editing


Hi

is there any good plugin for editing jsp and setting
up a web project, i have tried lomboz but find it very
complicated to use
I find setting web prject in jsp much easy
any comments
(or any free jsp editor will also work)
Ashish

__
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: hide section of form

2003-10-24 Thread Todd G. Nist
Jan,

Set the attribute display to none on the DIV and then set it to block.
By setting it to none no space will be allocated for the div.

Regards,
Todd G. Nist

-Original Message-
From: Jan Kester [mailto:[EMAIL PROTECTED]
Sent: Friday, October 24, 2003 12:43 PM
To: Struts Users Mailing List
Subject: RE: hide section of form


Thanks,

I did add DHTML and used DIV with visibility hidden and visibility visible.
Only, the submit buttons that come afterwards, remain in the same location.
That is, when the questions are hidden, the buttons are a far below in the
page.

Regards, Jan

-Mensaje original-
De: Rajat Pandit [mailto:[EMAIL PROTECTED]
Enviado el: viernes, 24 de octubre de 2003 10:14
Para: 'Struts Users Mailing List'
Asunto: RE: hide section of form


Thoug a non struts related question,  you might want to consider layers
(DHTML) and make them visible or invisible. Try using dreamweaver. It
has a good tool for making layers

-Original Message-
From: Jan Kester [mailto:[EMAIL PROTECTED]
Sent: Friday, October 24, 2003 12:59 AM
To: Struts Users Mailing List
Subject: hide section of form


Hello

how can I hide a section of my form with struts/javascript. That is,
someone presses a radio button and sees additional questions, presses
the opposite radio button and questions disappears. Without reloading
the form.

Regards, Jan


-
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: Converting a ResultSet to a List of POJOs

2003-09-06 Thread Todd G. Nist
Matt,

If you pull the scaffold project from
http://sourceforge.net/project/showfiles.php?group_id=49385, there is a
class called ResultSetUtils which provides the below methods for mapping a
ResultSet to a Collection of a given class or returning a given element from
the ResultSet.  It uses reflection and the meta data of the resultSet in
conjunction with BeanUtils and PropertyUtils to invoke the setters on the
POJO.

Seems to work fairly well.

Regards,

Todd G. Nist


/**
 * Populate target bean with the first record from a ResultSet.
 *
 * @param resultSet The ResultSet whose parameters are to be used
 * to populate bean properties
 * @param target An instance of the bean to populate
 * @exception SQLException if an exception is thrown while setting
 * property values, populating the bean, or accessing the ResultSet
 * @returns True if resultSet contained a next element
 */
public static boolean getElement(Object target, ResultSet resultSet)
throws SQLException {

}

/**
 * Return a ArrayList of beans populated from a ResultSet.
 *
 * @param resultSet The ResultSet whose parameters are to be used
 * to populate bean properties
 * @param target An instance of the bean to populate
 * @exception SQLException if an exception is thrown while setting
 * property values, populating the bean, or accessing the ResultSet
 */
 public static Collection getCollection(Object target, ResultSet
resultSet)
throws SQLException {
 
 }



-Original Message-
From: news [mailto:[EMAIL PROTECTED] Behalf Of Vic Cekvenich
Sent: Saturday, September 06, 2003 3:59 AM
To: [EMAIL PROTECTED]
Subject: Re: Converting a ResultSet to a List of POJOs


There are no people more expert in Struts than you Matt.

I think you can use RowSet to wrap a ResultSet, and RowSet has a
toCollection or getCollection method. (Or just don't user ResultSet at
all, just use RowSet, Sun has default implementation in JDC, but
Orcale has an extra download, other do to).

Worst case you write your own helper object.

But... I would use a DAO layer(and not code to JDBC), it will be
cheaper/faster in the long run.
Consider writing a console generator (I have one, in CVS at bP for
iBatis that jsut enmerates all tables in DB) that takes a SQL  Strings[]
in XML file, and based on that queries the DB, and writes a real DAO and
beans (and can do this anytime, for any of your projects). (I do not
know how well Hibernate works with SQL).

.V

Matt Raible wrote:
 Dear Struts Experts,

 I recently started a new project where most of the backend code is already
 written with JDBC and ResultSets.  The ResultSets are iterated through and
a
 POJOs values are set using pojo.setName(rs.getString(...)), etc. - you
get
 the point.  I'm wondering if there's an easier way - so I could do
something
 like this:

 ResultSet rs = stmt.executeQuery(SELECT ...);
 List objects = FancyUtilitity.convertResultSetToListOfObjects(rs,
 object.class);

 Hibernate let me do this very simply - and I miss the fact that I could
type
 a line or two to get a List of POJOs.

   List users = ses.createQuery(from u in class  + User.class
+ order by u.name).list();

 I've looked at the RowSetDynaClass (http://tinyurl.com/mekh), which has an
 interesting way of doing this - is this the recommended approach in the
 JDBC world?  Here's an example using it:

ResultSet rs = stmt.executeQuery(SELECT ...);
RowSetDynaClass rsdc = new RowSetDynaClass(rs);
rs.close();
stmt.close();
...;// Return connection to pool
List rows = rsdc.getRows();
...;   // Process the rows as desired


 Thanks,

 M



-
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: Editor for JSP in Eclipse

2003-08-01 Thread Todd G. Nist
I have just started using MyEclipse Enterprise Workbench,
http://www.myeclipseide.com/ , which provides smart editors with code
completion, including Struts tags, and syntax coloring: JSP, HTML, XML, CSS,
and J2EE deployment descriptors.  In addition, it supports
JSP syntax validation and native JSP debugging - full support for JSR045
plus support for WebApps and J2EE EJB development.

It does have a cost of $30.00 for a years subscription, but for the quality
and time savings it seems worth it to me.  Oh, by the way I have no
affiliation with this organization other then using their tool.

HTH.

Regards,

Todd G. Nist

-Original Message-
From: Ashish Kulkarni [mailto:[EMAIL PROTECTED]
Sent: Friday, August 01, 2003 10:50 AM
To: Struts Users Mailing List
Subject: RE: Urgent: Editor for JSP in Eclipse


Hi,
i was looking at
http://black-sun.sourceforge.net/
which is the editor for jsp???

Ashish

--- [EMAIL PROTECTED] wrote:
 Thanx a lot!!! works great for me

 --mohan


  I am using the blacksun plugin.  It does have a
 find start/end tag
  feature.
 
  http://black-sun.sourceforge.net/
 
  -Original Message-
  From: [EMAIL PROTECTED]
 [mailto:[EMAIL PROTECTED]
  Sent: Thursday, July 31, 2003 4:31 PM
  To: [EMAIL PROTECTED]
  Subject: Urgent: Editor for JSP in Eclipse
 
 
  Hi All
  I am using Eclipse and i need a JSP editor/ HTML
 editor to stuff like
  matching HTML tags in my JSPs and warn if there
 are no matching tags for
  an HTML tag, i have downloaded the solar eclipse
 plug-in but it ownly
  colors various JSP/HTML elements but i am not sure
 how to find mactching
  HTML tags or JSP tags wid it
 
 
 
  Thanx
 
  --MOhan
 
 
 
 

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

***
   This electronic mail transmission contains
 confidential and/or
  privileged  information intended only for the
 person(s) named.  Any use,
  distribution,  copying or disclosure by another
 person is strictly
  prohibited.
 

***
 
 
 
 
 

-
 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]



=
A$HI$H

__
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.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: Struts and Jetspeed

2003-07-31 Thread Todd G. Nist
Have you looked at http://www.liferay.com/products/index.jsp which is built
open source technologies like Hibernate, Lucene, and Struts.


-Original Message-
From: BaTien Duong [mailto:[EMAIL PROTECTED]
Sent: Thursday, July 31, 2003 12:13 PM
To: Struts Users Mailing List
Subject: Re: Struts and Jetspeed


Joe Germuska wrote:

 At 22:22 -0600 7/30/03, jakarta-lists wrote:

Has anyone successfully use Struts with Jetspeed?  I'm looking
 into the possiblilty of having jetspeed do the authentication,
 templating and layout.. while struts will handle the control of the
 app. It sounds like a good idea to me, but I haven't worked with
 struts enough yet to know for sure and I would like to know about
 pitfalls if any.

Struts has a much better control, while JetSpeed has established
portlets and facilities to connect devices to portlets. The problem with
Jetspeed is that it is binding to Turbine, while Struts allows complete
separation of controller framework and presentation layer. Struts-Tiles
enable 1 single web-page view rather than portal view and portlet view.

With the release of JSR-168 specification  of portal/portlet container
based on standard Servlet container, it makes a lot of sense to refactor
Struts framework to work with standard Servlet / Portal /Portlet
container. Then an effort to refactor Jetspeed portlets into this
framework. I wonder if any developer has playing with this idea? I heard
Craig and Cedric have something under their desks, and not ready to
share yet? Am I  right?



 It doesn't sound like there's much left for Struts to do once you use
 Jetspeed (or Turbine, its underlying framework) for authentication,
 templating, and layout.

 Once you're talking about providing content to individual portlets in
 your Jetspeed installation, you can do it with much less work than
 adding Struts in to the mix.

 Joe

BaTien


-
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: Example for Struts in Cocoon

2003-04-02 Thread Todd G. Nist
Kavitha,

There was a post awhile back by Don Brown about a prototype of a Struts 1.1
plugin that integrates Cocoon
into the Struts framework he developed.

More information, including how and why, and a demo, visit:
http://www.twdata.org/struts


Hope this helps.

Regards,
Todd G. Nist
-Original Message-
From: kavitha ramesh [mailto:[EMAIL PROTECTED]
Sent: Wednesday, April 02, 2003 8:39 AM
To: [EMAIL PROTECTED]
Subject: Example for Struts in Cocoon


Hi,

If someone works with strutscocoon integration, could
you please send me an example?Or could u suggest me
some link?

Kavitha Ramesh.


Missed your favourite TV serial last night? Try the new, Yahoo! TV.
   visit http://in.tv.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: alternating row colors in the iterate tag.

2002-09-10 Thread Todd G. Nist

Nanijon,

You can find the a taglib for this at:
http://jakarta.apache.org/struts/resources/taglibs.html once there look down
the page for RowTag, works quite well.

If you would prefer to use a scriplet then the following will work:

style
/* Even row */
td.row0 {
background-color: #FF;
}
/* Odd row */
td.row1 {
background-color: #cc;
}
/style
...
logic:iterate ... indexId=i ...
trtd class=row%= i % 2 %your text or data here/td/tr
/logic:iterate

Hope this helps.

Regards,
Todd G. Nist

-Original Message-
From: Nani Jon [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, September 10, 2002 3:32 PM
To: Struts Users Mailing List
Subject: Re: alternating row colors in the iterate tag.



Hey Dave:
Would you be so kind to share that code? It will be greatly appreciated.
Thanks,
Nanijon.
 David Graham wrote:I don't think you can do it directly with the iterate
tag. I think there is
a tag in the jakarta taglibs project that does this. I wrote my own tag to
do it (it doesn't take long). You would use your tag within the iterate tag
to generate the
Dave


Hi all:

Is there a way to alternate row background colors within an  tag? I
was able to do it using java scriplet. The problem is the
value of the varaible rowColor shows up on the JSP. Here is a snippet of
the code in the JSP page:



..

  String rowColor = #ff;
  String prevColor = #ff;
  String nextColor = #cc;
%

 ...

...

property=mainInfo.titleCollection type=com.acs.backend.dao.MusicDAO
 

 ..















-
Do You Yahoo!?
Yahoo! Finance - Get real-time stock quotes




_
Join the worlds largest e-mail service with MSN Hotmail.
http://www.hotmail.com


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



-
Do You Yahoo!?
Yahoo! Finance - Get real-time stock quotes



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




RE: Cannot Retrieve Mapping for Action

2002-08-29 Thread Todd G. Nist

Chandra,

Remove the .do from you action attribute in the form definition:

%@ taglib uri=/WEB-INF/struts-html.tld prefix=html %
html:html
head
/head
body
html:form  method=post action=/logon
.
.
.

HTH.

Regards,
Todd

-Original Message-
From: Chandrasekar [mailto:[EMAIL PROTECTED]]
Sent: Thursday, August 29, 2002 12:36 AM
To: Struts Users Mailing List
Subject: Cannot Retrieve Mapping for Action


Hi ,
First sorry for a lengthy mail.

Searched the mailing list archive and tried every solution suggested there
...

still nothing ...

I am getting the following error when trying to invoke the login page.(Using
weblogic 6.0)

Aug 29, 2002 9:39:13 AM IST Error HTTP
[WebAppServletContext(6765727,wisor
repwebapp)] Root cause of ServletException
javax.servlet.jsp.JspException: Cannot retrieve mapping for action /logon
at org.apache.struts.taglib.html.FormTag.lookup(FormTag.java:784)
at
org.apache.struts.taglib.html.FormTag.doStartTag(FormTag.java:481)
at jsp_servlet.__login._jspService(__login.java:123)
at weblogic.servlet.jsp.JspBase.service(JspBase.java:27)
at
weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImp
l.java:213)
at
weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppSer
vletContext.java:1302)
at
weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImp
l.java:1680)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:137)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)


Below are my configuration details

web.xml

servlet
servlet-nameaction/servlet-name
servlet-classorg.apache.struts.action.ActionServlet/servlet-class
init-param
  param-nameapplication/param-name
  param-valueApplicationResources/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-valuefalse/param-value
/init-param
load-on-startup2/load-on-startup
  /servlet

 !-- Standard Action Servlet Mapping --
  servlet-mapping
servlet-nameaction/servlet-name
url-pattern*.do/url-pattern
  /servlet-mapping

struts-config.xml file

struts-config
form-beans
form-bean name=loginForm type=com.wisor.pom.formbeans.LoginFormBean/
/form-beans
global-forwards
forward   name=loginForm path=/Login.jsp/
/global-forwards
action-mappings
action path=/logon
type=com.wisor.pom.action.LoginAction
name=loginForm
input=/Login.jsp
scope=request
validate=true
forward name=success path=/Login.jsp /
forward name=failure path=/Login.jsp /
/action
/action-mappings
/struts-config

// all my Action and ActionForm classes are available inside the
WEB-INF/classes directory
// JSP pages available inside webapp directory


my JSP page

%@ taglib uri=/WEB-INF/struts-html.tld prefix=html %
html:html
head
/head
body
html:form  method=post action=/logon.do
html:text property=username /
html:text   property=password /
html:submit/

/html:form
/body
/html:html

Thanks
Chandra


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



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




RE: Help - xml to pdf using struts

2002-08-21 Thread Todd G. Nist

Mark,

I have tested this out on 5.0, 5.01, 5.5, 6.0.26 and have not encountered
any problem with the page being displayed, what release of IE are you using?

I have attached a small servlet which will render a page straight to the
browser, at least under those listed above.

Hope it helps.

Regards,

Todd G. Nist

--- Servlet 

import javax.servlet.*;
import javax.servlet.http.*;

import java.io.ByteArrayOutputStream;
import java.io.BufferedReader;
import java.io.File;
import java.io.IOException;

import org.apache.avalon.framework.logger.ConsoleLogger;
import org.apache.avalon.framework.logger.Logger;

import org.xml.sax.InputSource;
import org.xml.sax.XMLReader;

import org.apache.fop.apps.Driver;
import org.apache.fop.apps.Version;
import org.apache.fop.apps.XSLTInputHandler;
import org.apache.fop.apps.FOPException;

import org.apache.fop.messaging.MessageHandler;

import javax.xml.transform.*;
import javax.xml.transform.stream.*;


public class GeneratePDF extends HttpServlet {

public void doGet(HttpServletRequest request, HttpServletResponse
response)
throws ServletException, IOException {
doPost(request, response);
}


public void doPost(HttpServletRequest request, HttpServletResponse
response)
throws ServletException, IOException {

String xslPath = ./;
String xmlFile = pdfxml.xml;  // your file name here
String xslFile = pdfxsl.xsl;  // your file name here
Logger log = null;

try {
// Initialize Logger
log = new ConsoleLogger(ConsoleLogger.LEVEL_WARN);
MessageHandler.setScreenLogger(log);
// Initialier Input Handler
XSLTInputHandler input = new XSLTInputHandler(new File(xmlFile),
new File(xslFile));

ByteArrayOutputStream out = new ByteArrayOutputStream();

Driver driver = new Driver();
driver.setLogger(log);
driver.setRenderer(Driver.RENDER_PDF);
driver.setOutputStream(out);
driver.render(input.getParser(), input.getInputSource());

// write the result out to the page
byte[] content = out.toByteArray();
response.setContentType( application/pdf );
//
// Content-disposition header - don't open in browser and
// set the Save As... filename.
// *There is reportedly a bug in IE4.0 which ignores this...
//
//response.setHeader(Content-disposition, attachment; 
filename= +
example.pdf);

response.setContentLength(content.length);
response.getOutputStream().write(content);
response.getOutputStream().flush();
}
catch (IOException e)
{
log.error(IOException caught while creating pdf using +
xslPath, e);
throw new ServletException(IOException caught while creating
pdf , e);
}
catch (IllegalArgumentException e)
{
log.error(IllegalArgumentException caught while creating pdf
using + xslPath, e);
throw new ServletException(IllegalArgumentException caught
while creating pdf , e);
}
catch (FOPException e)
{
log.error(FOPException caught while creating pdf using +
xslPath, e);
throw new ServletException(FOPException caught while creating
pdf , e);
}
}
}

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, August 20, 2002 10:14 AM
To: [EMAIL PROTECTED]
Subject: RE: Help - xml to pdf using struts


Yes.  The problem with IE is that it doesn't show the file and you get a
blank page.  This note at the fop site says:

Some browsers have problems handling the PDF result sent back to the
browser. IE is particularly bad and different versions behave differently.
Having a .pdf on the end of the url may help. 

http://xml.apache.org/fop/embedding.html

-Original Message-
From: Todd G. Nist [mailto:[EMAIL PROTECTED]]
Sent: Friday, August 16, 2002 1:34 PM
To: 'Struts Users Mailing List'
Subject: RE: Help - xml to pdf using struts


RE: Help - xml to pdf using strutsMike,

Did you set the content type to application/pdf and then return null
from you action once you successfully completed the transformation?  That is
what we do and it appears to work fine.

Regards,

Todd G. Nist

try {
// FO/Transformation code here

ByteArrayOutputStream pdf = new ByteArrayOutputStream();
// show PDF
response.setContentType(application/pdf);
byte[] content = pdf.toByteArray();
response.setContentLength(content.length);
response.getOutputStream().write(content);
response.getOutputStream().flush

RE: Container-managed authentication not possible

2002-08-21 Thread Todd G. Nist

You may want to take a look at the SecurityFilter project on SourceForge.net
by Max Cooper.  Summary form site:

SecurityFilter is a Java Servlet Filter that mimics the behavior and
 configuration format of container managed security, with several
 development and deployment advantages.

 See the Home Page http://securityfilter.sourceforge.net at for more
details.

Regards,

Todd G. Nist


-Original Message-
From: Brandon Goodin [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, August 21, 2002 2:48 PM
To: Struts Users Mailing List
Subject: RE: Container-managed authentication not possible


You can implement container managed security in web.xml only if it has been
setup within the server.xml under your host settings.

Brandon Goodin
Phase Web and Multimedia
P(406)862-2245
F(406)862-0354
http://www.phase.ws

-Original Message-
From: Elderclei R Reami [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, August 21, 2002 3:44 PM
To: [EMAIL PROTECTED]
Subject: Container-managed authentication not possible


Hi Friends,

It's been a month developing in struts, and the party's been pretty good.
I'm just finishing my first application
(30 jsps, actions, and so on), and now I'm including some security in it.

I'm in trouble regarding authentication, because my client's  ISP does not
let me change server.xml configs,
probably because they use virtual hosting. My question is: is it possible to
configure container-managed
authentication using the web.xml? Or must I implement my own authentication?

Cheers,
Elderclei R Reami
Vertis Tecnologia
+55 11 3887-0835
www.vertisnet.com.br


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



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



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




RE: Servlet Validation

2002-08-19 Thread Todd G. Nist

David,

Look at using a filter or the better yet the SecurityFilter project by Max
Cooper which mimics container managed
security.

SecurityFilter information can be found at:
http://securityfilter.sourceforge.net

Hope that helps.

Regards,

Todd G. Nist

-Original Message-
From: David Graham [mailto:[EMAIL PROTECTED]]
Sent: Monday, August 19, 2002 3:31 PM
To: [EMAIL PROTECTED]
Subject: Servlet Validation


Hi,
I want all my jsps to be called through the ActionServlet instead of
directly through a url.  I've subclassed ActionServlet and overridden the
process() method to do authentication.  So, on every request it will check
if the user is logged in and then provide the page they asked for.  How do I
set this up?  Here's my feeble attempt in the struts-config file:

action
name=bogusForm
type=com.ibm.sdfreg.action.AccountIndexAction
path=/account/
scope=request
validate=false
forward name=success path=/account/index.jsp /
/action

There is no bogusForm bean defined and the AccountIndexAction.perform()
method just forwards to the success page.  I want the user to type in this
url http://host/account/ and get the index page.  Is this even possible?

Thanks,
Dave



_
Chat with friends online, try MSN Messenger: http://messenger.msn.com


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



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




RE: IFrame Newbie Looking for IFrame Advice

2002-08-19 Thread Todd G. Nist

Stephen,

As to the first part of your question, I can not say for certain if WebLogic
will have the same problem with IFrames, I do not encounter any with JBoss,
and since they are inline as part of the main HTML document I don't believe
that you will have an issue.  As for updating the surrounding stuff, yes it
is possible.  However, if the content received by the iframe is to update
surrounding elements in the DOM, then the content must be received from the
same DOMAIN otherwise you will receive a security exception by default.  The
other issue is if you must support Netscape versions prior to 6.x (I think
it is 6.b1, not sure).

I have used this for RPC invocation of validation and population of certain
components in web-apps, generally takes around .5 seconds for the round trip
to the server to have the action generate the results.  The results are
returned to the iframe which then use some standard javascript to populate
the appropriate fields with values.  Works good for selection list and drop
downs rather then having the entire screen re-paint every time an option
changes.  Also works well for field validation which must take place on the
server.  What I have done is to simply create a iframe 0px by 0px and then
use it for the RPC.

Let me know if you have any questions.

Regards,

Todd G. Nist

-Original Message-
From: Molitor, Stephen [mailto:[EMAIL PROTECTED]]
Sent: Monday, August 19, 2002 7:08 PM
To: 'Struts Users Mailing List'
Subject: IFrame Newbie Looking for IFrame Advice


We're starting a new Struts app, and it might be nice to use IFrames in it.
Are there any gotchas with iframes in a J2EE / Struts app that I should be
aware of?  For example, the WebLogic documentation states that normal frames
can cause problems with the session id getting lost if improperly used.
Could this be a problem with iframes too?  Also, what if, as a result of the
user submitting something in the body page contained within the iframe, we
need to reach out and update the surrounding stuff.  Is that possible?

Thanks!

Steve Molitor
[EMAIL PROTECTED]

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



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




Sorry - test message PLEASE DELETE

2002-08-16 Thread Todd G. Nist

test message



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




RE: Help - xml to pdf using struts

2002-08-16 Thread Todd G. Nist

RE: Help - xml to pdf using strutsMike,

Did you set the content type to application/pdf and then return null
from you action once you successfully completed the transformation?  That is
what we do and it appears to work fine.

Regards,

Todd G. Nist

try {
// FO/Transformation code here

ByteArrayOutputStream pdf = new ByteArrayOutputStream();
// show PDF
response.setContentType(application/pdf);
byte[] content = pdf.toByteArray();
response.setContentLength(content.length);
response.getOutputStream().write(content);
response.getOutputStream().flush();
}

// return null from action

return null;

  -Original Message-
  From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
  Sent: Friday, August 16, 2002 11:43 AM
  To: [EMAIL PROTECTED]
  Subject: RE: Help - xml to pdf using struts


  Hi Lisa,

  That looks similar to my solution.  The biggest problem I had was with
getting IE to display the PDF inline without a PDF in the URL  Using a
Struts action, I wasn't able to get the URL to change at the appropriate
time with a redirect.  In the end, I sent the pdf as an attachment which
gives the open/save prompt.  Were you able to get around this problem?

  Thanks, Mike
-Original Message-
From: Lisa van Gelder [mailto:[EMAIL PROTECTED]]
Sent: Thursday, August 15, 2002 4:52 AM
To: 'Struts Users Mailing List'
Subject: RE: Help - xml to pdf using struts


Here is the bit of my action that deals with the pdf creation.

First I transform xml to fo using xsl (and Xalan). The result is written
to an InputSteam, which is passed into FOP. The result from FOP is then
written out the client and the content type is set to application/pdf.

HTH

Lisa

-Original Message-
From: Zimmer, Robin (SSABSA) [mailto:[EMAIL PROTECTED]]
Sent: 15 August 2002 09:37
To: 'Struts Users Mailing List'
Subject: RE: Help - xml to pdf using struts



Lisa, That sounds can you provide an example action please.

-Original Message-
From: Lisa van Gelder [mailto:[EMAIL PROTECTED]]
Sent: Thursday, 15 August 2002 6:01 PM
To: 'Struts Users Mailing List'
Subject: RE: Help - xml to pdf using struts



I do the xml - fo - pdf transformation in an Action, and then stream
the
result straight back to the browser.

Lisa

-Original Message-
From: Zimmer, Robin (SSABSA) [mailto:[EMAIL PROTECTED]]
Sent: 15 August 2002 09:28
To: 'Struts Users Mailing List'
Subject: RE: Help - xml to pdf using struts



Thanks for getting back to me. I appreciate that I have to have xsl:fo
to
transform the xml, but how best to render this using jsp??? Or do I need
a
servlet???

-Original Message-
From: David WIlkinson [mailto:[EMAIL PROTECTED]]
Sent: Thursday, 15 August 2002 5:57 PM
To: 'Struts Users Mailing List'
Subject: RE: Help - xml to pdf using struts



We had to address a similar issue of creating pdf's from xml and found
that it can be done in a simple way using xsl:fo to transform the xml.

Check out http://xml.apache.org/fop/index.html for more info.



-Original Message-
From: Zimmer, Robin (SSABSA) [mailto:[EMAIL PROTECTED]]
Sent: 15 August 2002 08:13
To: '[EMAIL PROTECTED]'
Subject: Help - xml to pdf using struts

I am in the last stages of implementating a Struts application. I now
have
to complete the reporting side. This basically consists of displaying
xml
output as HTML or PDF. I have the HTML side covered (I am using jakarta
XTags) but how do I render an xml to fo transformation to pdf by using
struts. I am aware of stxx but as far as I can see you have to override
the
actionservlet etc and this seems an overhead for what is a small part of
the
app. Can anyone please give some suggestions.

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






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

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

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




begin 666 ATT00066.htm
M/%$3T-465!%($A434P@4%53$E#((M+R]7,T,O+T141!(5$U,(#0N,!4
MF%NVET:6]N86PO+T5.(CX-CQ(5$U,/CQ(14%$/@T*/$U%5$$@2%144U%
M455)5CTB0V]N=5N=U47!E(B!#3TY414Y4/2)T97AT+VAT;6P[(-H87)S
M970]:7-O+3@X-3DM,2(^#0H\5$E43$4^4D4Z($AE;' @+2!X;6P@=\@1F
M('5S:6YG('-TG5TSPO5$E43$4^#0H-CQ-151!(-O;G1E;G0](DU32%1-
M3 U+C4P+C0Y,3(N,S P(B!N86UE/4=%3D52051/4CX\+TA%040^#0H\0D]$
M63X-CQ$258^/%-004X@8VQAW,],34Q-3,R,S$W+3$V,#@R,# R/CQ3TY4
M(9A8V4]07)I86P@8V]L;W(](S P,#!F9B -G-IF4],CY-:6ME+#PO1D].
M5#X\+U-004X^/]$258^#0H\1$E6/CQ34$%.(-L87-S/3$U,34S,C,Q-RTQ
M-C X,C P,CX\1D].5!F86-E/4%R:6%L(-O;]R/2,P

RE: Limiting No of Records per page/view

2002-08-03 Thread Todd G. Nist

Hello Vijay,

You can use the  length and offset attributes of the iterator tag.

The length is used to tell the iterator the number of times/number of items
to retrieve from the collection.

Offset is used to indicate the offset into the collection.

So for example, if you want to display only 10 items of the then you would
do something like this:

logic:iterate id=order
 name=orderlist
 length=10
 offset=0

Hope that helps.

Regards,

Todd G. Nist
-Original Message-
From: Vijay Kumar [mailto:[EMAIL PROTECTED]]
Sent: Saturday, August 03, 2002 4:15 AM
To: [EMAIL PROTECTED]
Subject: Limiting No of Records per page/view



Hi,
I am using Struts  . I need to displays say 10 records per page/view and
give user ability to click on either next button or hyperlink to display
next set of 10 records. User should also have the ability to go back by
clicking previous button. I am able to display all records using iterate
tag, but not able to limit the no of records shown. Any example or code will
be helpful.
This is what i am doing to display records.

logic:iterate id=selling name=table.list

tr
td width=150 height=15 class=tableRowsReadOnly
   nbspbean:write name=selling property=sellingcode/
/td

   td width=150 height=15 class=tableRowsReadOnly
   nbspbean:write name=selling property=season/
/td

/logic:iterate

Cheers
vkvk

_
Join the world’s largest e-mail service with MSN Hotmail.
http://www.hotmail.com


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



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




RE: App Resources bundle being read in on Servlet startup?

2002-07-04 Thread Todd G. Nist

Hello Carl,

I believe the classes you are looking for are the following:

org.apache.struts.util.MessageResourcesFactory
org.apache.struts.util.PropertyMessageResources

HTH.

Regards,

Todd G. Nist


-Original Message-
From: Schmidt, Carl [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, July 03, 2002 6:27 PM
To: Struts (E-mail)
Subject: App Resources bundle being read in on Servlet startup?


I've read the docs, but it just gives me some intro on the concepts behind
localization, resource bundles, etc.  I also read the source, but got a
little lost.  Can someone please direct me to the .java file within struts
where the application resources. props file is read in to the resource
bundle?

Carl

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



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




RE: WebPim

2002-06-04 Thread Todd G. Nist

Claudio,

The password is cc.

-Original Message-
From: Struts Newsgroup [mailto:@[EMAIL PROTECTED]]
Sent: Tuesday, June 04, 2002 7:40 AM
To: [EMAIL PROTECTED]
Subject: WebPim


Subject: WebPim
From: Claudio Parnenzini [EMAIL PROTECTED]
 ===
Hi all,

I have downloaded the WebPim Sample DB struts app from www.basebeans.com.
The zip file containing the sample application is protected by a password.

Could someone explain me, if there is any restriction to have access to the
code source???

If not, what is the password for the zip file (I saw any information on
basebeans.com about)???

Sorry if this email is out of context.

Regards.



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


begin 666 ATT00014.htm
M/%$3T-465!%($A434P@4%53$E#((M+R]7,T,O+T141!(5$U,(#,N,B\O
M14XB/@T*/$A434P^#0H\2$5!1#X-CQ-151!($A45% M15%5258](D-O;G1E
M;G0M5'EP92(@0T].5$5.5#TB=5X=]H=UL.R!C:%RV5T/5=I;F1O=W,M
M,3(U,B(^#0H\345402!.04U%/2)'96YEF%T;W(B($-/3E1%3E0](DU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%-)6D4],CY;W(@861D:71I;VYA
M;!C;VUM86YD[EMAIL PROTECTED] F;'0[/$$@2%)%1CTB;6%I;'1O.G-TG5T
MRUUV5R+6AE;'! :F%K87)T82YA%C:4N;W)G(CYM86EL=\ZW1R=71S
M+75S97(M:5L$!J86MAG1A+F%P86-H92YOF\+T$^)F=T.SPO1D].5#X-
9CPO4#X-@T*/]3T19/@T*/](5$U,/@``
`
end


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




RE: related to: Re: #2 - Use DispatchAction to organize related operations

2002-06-04 Thread Todd G. Nist

I have to ask a question;  Why not use a filter to handle this?  The filter
will be called before any components of struts are invoked.  It has access
to the request, response and session and can handle forwarding the request
to the login page or error page if they are not currently logged in.  If
container managed security is used, it will get invoked prior to the filter,
which can then check the getRemoteUser() and the session to ensure that they
have been logged in and perform any setup that is required for creating a
user object and storing the information in the session or wherever.  The
filter can then chain to the requested page with the chain.doFilter().

Any reason not to do this?

Todd

-Original Message-
From: Galbreath, Mark [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, June 04, 2002 7:56 AM
To: 'Struts Users Mailing List'
Subject: RE: related to: Re: #2 - Use DispatchAction to organize related
operations


Chuck is absolutely correct on the linear progression of action processing.
I, too am overriding processPreprocess and it works beautifully.  Besides
increasing security, it cuts down on unnecessary CPU bandwidth.

Mark

-Original Message-
From: Chuck Cavaness [mailto:[EMAIL PROTECTED]]
Sent: Monday, June 03, 2002 10:58 PM

Rick,

catch this earlier. I had implemented something along these lines awhile
back and soon remembered that the ActionForm is populated and the
validate() method is called, all of this before the Action's execute()
method is invoked. The question is, do you want to check whether or not the

What I suggest is to look at the processPreprocess() method in the
RequestProcessor and possibly override this to do your checks. It's called

Just some things to think about,
Chuck

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


begin 666 ATT00021.htm
M/%$3T-465!%($A434P@4%53$E#((M+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22P@=]O(%M(]V97)R:61I;F@')O8V5SU!R97!R;V-EW,@86YD
M(ET('=OFMS()E875T:69U;QY+B9N8G-P.R!97-I95S/]3TY4/@T*
M#0H\0E(^/$9/3E0@4TE:13TR/FEN8W)E87-I;F@V5C=7)I='DL(ET(-U
M=',@9]W;B!O;B!U;FYE8V5SV%R2!#4%4@8F%N9'=I9'1H+CPO1D].5#X-
MCPO4#X-@T*/% ^/$9/3E0@4TE:13TR/DUAFL\+T9/3E0^#0H\+U ^#0H-
MCQ0/CQ3TY4(%-)6D4],CXM+2TM+4]R:6=I;F%L($UEW-A9V4M+2TM+3PO
M1D].5#X-@T*/$)2/CQ3TY4(%-)6D4],CYF]M.B!#:'5C:R!#879A;F5S
MR!;/$$@2%)%1CTB;6%I;'1O.F-H=6-K8V%V86YEW- 871T8FDN8V]M(CYM
M86EL=\Z8VAU8VMC879A;F5ST!A='1B:2YC;VT\+T$^73PO1D].5#X-@T*
M/$)2/CQ3TY4(%-)6D4],CY396YT.B!-;VYD87DL($IU;F4@,#,L(#(P,#(@
M,3 Z-3@@4$T\+T9/3E0^#0H\+U ^#0H-CQ0/CQ3TY4(%-)6D4],CY2:6-K
M+#PO1D].5#X-CPO4#X-@T*/% ^/$9/3E0@4TE:13TR/F-A=-H('1H:7,@
M96%R;EEBX@22!H860@:6UP;5M96YT960@V]M971H:6YG(%L;VYG('1H
M97-E(QI;F5S(%W:EL92 \+T9/3E0^#0H-CQ4CX\1D].5!325I%/3(^
M8F%C:R!A;F0@V]O;B!R96UE;6)EF5D('1H870@=AE($%C=EO;D9OFT@

RE: Struts with WAP+HTML projects

2002-04-19 Thread Todd G. Nist

Hello Abhishek,

You may want to take a look at the following:

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

Struts for transforming XML with XSL (stxx) by By Jeff Pennal, OpenRoad
Communications
http://www.openroad.ca/opencode/stxx/index.html

HTH.

Regards,
Todd G. Nist

-Original Message-
From: Abhishek Srivastava [mailto:[EMAIL PROTECTED]]
Sent: Thursday, April 18, 2002 11:18 AM
To: [EMAIL PROTECTED]
Subject: Struts with WAP+HTML projects


Hello All,

I am working on a project which is for a portal which serves to HTML and WAP
clients. This project is developed using a home grown MVC model + jsp + XSL
So one jsp serves many types of clients by looking up the header sent by the
device and applying the right XSL file .. thus creating WML or HTML output
depending upon what the client device type is. The application logic remains
the same no matter what the client device is.
We are having lot of problems with our home grown MVC framework and want to
use struts ... from all the initial examples it appears that struts is used
only for jsp pages serving HTML output.
How can I use struts in a multi channel (WAP, HTML, PDA) portal like ours? I
don't want to write a new jsp per device type. the jsp and action classes
should remain the same only the XSL changes per device type.
I would appreciate your help, also please share your experience about using
struts in a WML+HTML project.
regards,
Abhishek.

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


begin 666 ATT7.htm
M/%$3T-465!%($A434P@4%53$E#((M+R]7,T,O+T141!(5$U,(#,N,B\O
M14XB/@T*/$A434P^#0H\2$5!1#X-CQ-151!($A45% M15%5258](D-O;G1E
M;G0M5'EP92(@0T].5$5.5#TB=5X=]H=UL.R!C:%RV5T/5=I;F1O=W,M
M,3(U,B(^#0H\345402!.04U%/2)'96YEF%T;W(B($-/3E1%3E0](DU3($5X
M8VAA;F=E(%-EG9EB!V97)S:6]N(#8N,XU-S8R+C,B/@T*/%1)5$Q%/E)%
M.B!3=')U=',@=VET:!705 K2%1-3!PF]J96-TSPO5$E43$4^#0H\+TA%
M040^#0H\0D]$63X-CPA+2T@0V]N=F5R=5D(9R;VT@=5X=]P;%I;B!F
M;W)M870@+2T^#0H-CQ0/CQ3TY4(%-)6D4],CY(96QL;R!!8FAIVAE:RP\
M+T9/3E0^#0H\+U ^#0H-CQ0/CQ3TY4(%-)6D4],CY9;W4@;6%Y('=A;G0@
M=\@=%K92!A(QO;VL@870@=AE(9O;QO=VEN9SH\+T9/3E0^#0H\+U ^
M#0H-CQ0/B9N8G-P.R9N8G-P.R9N8G-P.R9N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@87)E(AA=FEN9R!L;W0@;V8@')O8FQE
M;7,@=VET:!O=7(@:]M92!GF]W;B!-5D,@9G)A;65W;W)K(%N9!W86YT
M('1O/]3TY4/@T*#0H\0E(^/$9/3E0@4TE:13TR/G5S92!S=')U=',@+BXN
M(9R;VT@86QL('1H92!I;FET:6%L(5X86UP;5S(ET(%P5AG,@=AA
M=!S=')U=',@:7,@=7-E9#PO1D].5#X-@T*/$)2/CQ3TY4(%-)6D4],CYO
M;FQY(9OB!JW @%G97,@V5R=FEN9R!(5$U,(]U='!U=X\+T9/3E0^
M#0H-CQ4CX\1D].5!325I%/3(^2]W(-A;B!)('5S92!S=')U=',@:6X@
M82!M=6QT:2!C:%N;F5L(A705 L($A434PL(%!$02D@]R=%L(QI:V4@
M;W5RS\@23PO1D].5#X-@T*/$)2/CQ3TY4(%-)6D4],CYD;VXG=!W86YT
M('1O('=R:71E($@;F5W(IS!P97(@95V:6-E('1Y4N('1H92!JW @
M86YD(%C=EO;B!C;%SV5S/]3TY4/@T*#0H\0E(^/$9/3E0@4TE:13TR

RE: Using 2.3 Filters and Struts

2002-03-23 Thread Todd G. Nist

John,

The actual filter in deployment here only stores the user object once in the
session.  I thought that was a major oversight on my part and I had to go
check the actual code when you mentioned it; Thanks for the comment.  The
filter, checks to see if the user object is valid and if not, but the user
has been authenticated by the container, then the user object is created and
stored in the session, otherwise the user is sent to an error.jsp or
login.jsp page.  From that point, the filter always checks the user object
in the session, but does not create it again.  This was left out during the
cutting and pasting of code, sorry about that.  So with regards to you first
question/comment, I would agree with creating the user object only once.

Our filter mapping is handled at the /app/do/* and /app/pages/ level where
app is the specific web application.  All our actions are currently mapped
to the /do/* and you are required to be logged in to perform any action
under specific applications, i.e. a Buyer Site and Supplier Site exchange
type application.  We also have the basic portal or informational site which
is a different /app and requires no authentication to get into.  All .jsp's
are stored in the pages directory with the exception of those required to
support the login.jsp, error.jsp and index.jsp.

When a user first hits the site they are presented with the index.jsp which
is using tiles to define the screen layout.  One of the tiles created is the
login tile which allows a valid user to login to either/or the
Buy/Supplier Site.  The links for Buyer/Supplier point to an action
/app/do/loginAct?action=Buyer  or /app/do/loginAct?action=Supplier. Since
the /app/do is a protected resource the container presents the Form based
login.jsp page.  If the user is authenticated, we get the request in the
filter, create the user object, and the pass the action to the loginAct.
The login action is our case does little more then forward the user to the
appropriate page based on login success.  If there are any problems with the
login, the filter catches them and forwards the user to an error.jsp page
with the appropriate error messages.

The above could be done just as easily in the action, but we opted to do it
in the filter since at some point we my use our on security model and by
pass the container implementation completely.  So by doing things here in
the filter, we are all set if we decide for any reason we need to change the
flow of the application. (I think)

Regards,
Todd



-Original Message-
From: John Regan [mailto:[EMAIL PROTECTED]]
Sent: Thursday, March 21, 2002 12:49 PM
To: 'Struts Users Mailing List'
Subject: RE: Using 2.3 Filters and Struts


Thanks Todd!
I've developed a very similar solution.  Here are a couple of
questions/comments about the code:
1. I noticed that you are storing the user object in the session every time
this filter is invoked with a valid user.  My solution sets the user object
once in the session after a successful login in the LoginAction class.  Do
you see any issues with setting it once?
2.How do you handle the filter mapping?  Do you have a directory that
contains all the pages that a user has to be logged in to be able to view?

Thanks for the help,
JBR

-Original Message-
From: Todd G. Nist [mailto:[EMAIL PROTECTED]]
Sent: Thursday, March 21, 2002 7:09 AM
To: 'Struts Users Mailing List'
Subject: RE: Using 2.3 Filters and Struts


In your filter, you can do something like the below.  We have implemented
something similar to this but have container managed security on top of it.
So the container managed security gets invoked first and then the filter,
processes the request.  This lets us add any additional information to the
session to ensure logged inness.  Now when the session times out, the any
resource which is protected is first processed by the container managed
security, and then the filter is invoked.

You could just as easily use only the filter for ensuring logged inness.

Hope the below helps.

Regards,
Todd G. Nist

import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;

import org.apache.struts.action.ActionError;
import org.apache.struts.action.ActionErrors;

public class SecurityFilter implements Filter {

private FilterConfig config = null;
private ServletContext ctx = null;
private User user = null;

public void init(FilterConfig config) throws ServletException {
this.config = config;
this.ctx = config.getServletContext();
this.ctx.log(Filter SecurityFilter initialized.);
}

public void destroy() {
this.user = null;
this.ctx = null;
this.config = null;
}

public void doFilter(ServletRequest request, ServletResponse response,
FilterChain chain) throws IOException,
ServletException {

HttpServletRequest req = (HttpServletRequest)request;
String action = null;

ctx.log(User

RE: how to use an images for submit, cancel button etc

2002-02-22 Thread Todd G. Nist

You could try something like the below:

for cancel you could do this:

html:image src=images/cancel.gif border=0
property=org.apache.struts.taglib.html.CANCEL/

for the others you would need to do something like:
html:link href=javascript:submit();
html:image src=images/save.gif value=save border=0/
/html:link

Regards,

Todd G. Nist

-Original Message-
From: KM [mailto:[EMAIL PROTECTED]]
Sent: Friday, February 22, 2002 10:27 AM
To: Struts Users Mailing List
Subject: how to use an images for submit, cancel button etc


Hi

I am trying to develop a page where the user has to
select options from a drop down box and either clicks
submit or cancel. The submit and cancel options are
images instead of a button

Following is my code


tr
td align=right
  logic:equal name=subscriptionForm
property=action
  scope=request value=Create
html:submit
  bean:message key=button.save/
/html:submit
  /logic:equal
  logic:equal name=subscriptionForm
property=action
  scope=request value=Delete
html:submit
  bean:message key=button.confirm/
/html:submit
  /logic:equal
  logic:equal name=subscriptionForm
property=action
  scope=request value=Edit
html:submit
  bean:message key=button.save/
/html:submit
  /logic:equal
/td
td align=left
  logic:notEqual name=subscriptionForm
property=action
 scope=request value=Delete
html:reset
  bean:message key=button.reset/
/html:reset
  /logic:notEqual
  nbsp;
  html:cancel
bean:message key=button.cancel/
  /html:cancel
/td
  /tr

here instead of the save, reset, cancel buttons I
would like to user save.gif, reset.gif, cancel.gif etc
.How to set up struts to use this..

Any tips on how to do this is appreciated

KM



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

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




RE: Poolman query

2002-02-08 Thread Todd G. Nist

Hello Jerome,

Here is how we use poolman to obtain a connection to the datasource.

Hope this helps.

Regards,
Todd G. Nist

// Code from www.husted.com scaffold project

import java.sql.Connection;
import java.sql.SQLException;
import javax.sql.DataSource;

import com.codestudio.sql.PoolMan;


public final class ConnectionPool {

/**
 * An exception message to throw if datasource is null.
 */
public static final String DATASOURCE_ERROR = Connection pool  +
not available. Check your poolman.xml config, and be sure  +
you are using a valid dbname parameter (use dbname, not jndiName);

/**
 * Returns a JDBC connection from a connection pool or other
 * resource, to be used and closed promptly.
 * p
 * @returns JDBC connection from resource layer.
 * @exception SQLException on SQL or other errors. May wrap other
 * exceptions depending on implementation. Will not return null.
 */
public static final Connection getConnection(String dataSource) throws
SQLException {
DataSource ds = PoolMan.findDataSource(dataSource);
if (ds==null)
throw new SQLException(DATASOURCE_ERROR);
return(ds.getConnection());
}
}

Poolman.xml

!--?xml version=1.0 encoding=UTF-8?--
poolman
  management-modelocal/management-mode

   datasource
  dbnamesample/dbname
  jndiNamejndiSample/jndiName
  drivercom.sybase.jdbc2.jdbc.SybDriver/driver
  urljdbc:sybase:Tds:localhost:2638/url
  !--next 2 should be in code for production for security --
  usernamedba/username
  passwordsql/password

  minimumSize5/minimumSize
  maximumSize10/maximumSize
  connectionTimeout600/connectionTimeout
  shrinkBy5/shrinkBy
  logFiled:\poolman.log/logFile
  debuggingtrue/debugging
  /datasource
/poolman

// call to ConnectionPool.class to get a connection
connection = ConnectionPool.getConnection(jndiSample);

-Original Message-
From: Jerome Josephraj [mailto:[EMAIL PROTECTED]]
Sent: Friday, February 08, 2002 3:59 AM
To: Struts Users Mailing List
Subject: Poolman query


Hi,

Sorry about this out of topic query. But looks like this is the
only place where I can get some help on Poolman.

I am struggling in setting up poolman to run in silverstream
server.

All I try to do is, set up a simple poolman configuration just
to access a database in my local server. I am not   using   any JNDI
name.

Configuration Details :

Silver stream version : Silver Stream 3.7.3
Database: Sybase adaptive server
anywhere 6.0
Poolman version   : 2.1


My poolman.xml looks like this

  datasource

dbnameCBSData/dbname
driverjdbs:poolman://localhost:80/CBSData/driver


usernametest/username
passwordtest/password

minimumSize0/minimumSize
maximumSize10/maximumSize

logFile/home/poolman/logs/testdb.log/logFile

  /datasource


The following is the snippet of the code


try {
// load the PoolMan JDBC Driver
Class.forName(com.codestudio.sql.PoolMan).newInstance();
} catch (Exception ex) {
System.out.println(Could Not Find the PoolMan Driver. 
Is poolman.jar in your CLASSPATH?);
}

Connection con = null;
try {

// establish a Connection to the database with
con = DriverManager.getConnection(jdbc:poolman://CBSData);

// Use the Connection to create Statements and do JDBC work
Statement stm = con.createStatement();

} catch (SQLException sqle) { sqle.printStackTrace(); }
finally {
try { con.close(); } catch (SQLException csqle) {}
}


I get NullPointer exception asa I reach the point where I try to
load the JDBC driver.

Hope the provided information will do. Any help is greatly
appreciated.



TIA,

Jerome.
  _

This message contains confidential information and is intended only for
the individual named. If you are not the named addressee you should not
disseminate, distribute or copy this e-mail. 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 verification is required please
request a hard-copy version.

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




PropertyMessageResourcesFactory Question

2002-02-06 Thread Todd G. Nist
Title: PropertyMessageResourcesFactory Question






I have a few questions on the creation of a custom MessageResourcesFactory which I am hoping someone can help answer. We have a database which contains most of the translation string for our application, so I would like to create the MessageResources from here in addition to the standard ApplicationResource.properties file. I have written my own PropertyMessageResourcesFactory, modified my web.xml so that Struts would use this factory, and extended the ActionServlet to call a method to load the data from the database. I thought this would provide a simple yet elegant solution because nothing else would need to change for it to work.

My questions:


1. While it appears that my code is adding the content of the tables to the messages HashMap, when I go to reference them with a bean:message key=MLSBuyer.title I get the following exception:

 Missing message for key

 MLSBuyer.title' javax.servlet.jsp.JspException: Missing message for key

 MLSBuyer.title at

 org.apache.struts.taglib.bean.MessageTag.doStartTag(MessageTag.java:298) at

 org.apache.jsp.CompanyZoomBody$jsp._jspService(CompanyZoomBody$jsp.java:84) at ...


I have not implemented the getMessage(Locale locale, String key) method in my custom PropertyMessageResources class, I was hoping that the messages that I created would become part of the default bundle/messages hashmap and therefore would be available to the Struts frame work. This does no appear to be what is happening. Is there a specific Servlet context attribute or some other value which needs to be set for these messages to be included in the standard bundle? What is the difference between Action.MESSAGE_KEY and Action.MESSAGES_KEY?

2. What else needs to be done to make these available in the default bundle so that the Struts frame work can use them without us having to implement the getMessages() methods? Or can this be done?

3. Are there any major issues/drawbacks with using the database like this for building the messages HashMap? We will still use the ApplicationResources.properties file where appropriate, but since the database already has the other translation information in it, it seems logical to use it, but I am open for other views on this.

I have attached the MessageResourcesFactory, DBMessageResourcesFactory and the actual class which is created from within the factory, BasePropertyMessageResources. Below is the initApplication() method which we have added to the extended ActionServlet to invoke the method dbLoad() in the BasePropertyMessageResources class.

Thanks in advance.


Todd G. Nist 

Email: [EMAIL PROTECTED] 


// initApplicationn method of the extended ActionServlet


 public void initApplication() throws ServletException {

 super.initApplication();


 String dataSource = getServletConfig().getInitParameter(datasource);


 MessageResources mr =

 (MessageResources)getServletContext().getAttribute(Action.MESSAGES_KEY);


 if (mr == null) {

 System.out.println(Message Resource is invalid);

 return;

 }

  // load resources from the dataSource

 ((BasePropertyMessageResources)mr).dbLoad(dataSource);

 }






DBMessageResourcesFactory.java
Description: Binary data


BasePropertyMessageResources.java
Description: Binary data

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


RE: PropertyMessageResourcesFactory Question

2002-02-06 Thread Todd G. Nist

I would like to thank Erich Meier for his response and help in resolving
this.

The problem wound up being with how the locales had been stored in the
database.  Only the country code had been stored, and not the associate
language or variant, i.e. US, FR, AR,  Since the default getMessage()
uses the localeKey() method which, returns a string in the form of
language_country_variant, i.e. (en_US, fr_FR, es_AR, ...), and then appends
this to the key requested, the called failed since the values stored in the
messages HashMap as keys were in the form of country.key.  With a quick
change to the database, the default getMessage() works fine.

What a silly mistake.

Sorry for the wasted bandwidth but thought someone else may find this useful
in the future.

Again, thanks Erich for the assistance.

Regards,

Todd G. Nist

-Original Message-

From: Erich Meier

-Original Message-
From: Todd G. Nist [mailto:[EMAIL PROTECTED]]
Sent: mercredi 6 février 2002 09:02
To: [EMAIL PROTECTED]
Subject: PropertyMessageResourcesFactory Question



I have a few questions on the creation of a custom MessageResourcesFactory
which I am hoping someone can help answer.  We have a database which
contains most of the translation string for our application, so I would like
to create the MessageResources from here in addition to the standard
ApplicationResource.properties file.  I have written my own
PropertyMessageResourcesFactory, modified my web.xml so that Struts would
use this factory, and extended the ActionServlet to call a method to load
the data from the database.  I thought this would provide a simple yet
elegant solution because nothing else would need to change for it to work.

My questions:

1.  While it appears that my code is adding the content of the tables to
the messages HashMap, when I go to reference them with a bean:message
key=MLSBuyer.title I get the following exception:

Missing message for key
MLSBuyer.title' javax.servlet.jsp.JspException: Missing message for
key
MLSBuyer.title at

org.apache.struts.taglib.bean.MessageTag.doStartTag(MessageTag.java:298) at

org.apache.jsp.CompanyZoomBody$jsp._jspService(CompanyZoomBody$jsp.java:84)
at ...

I have not implemented the getMessage(Locale locale, String key) method in
my custom PropertyMessageResources class, I was hoping that the messages
that I created would become part of the default bundle/messages hashmap and
therefore would be available to the Struts frame work.  This does no appear
to be what is happening.  Is there a specific Servlet context attribute or
some other value which needs to be set for these messages to be included in
the standard bundle?  What is the difference between Action.MESSAGE_KEY and
Action.MESSAGES_KEY?

2.  What else needs to be done to make these available in the default
bundle so that the Struts frame work can use them without us having to
implement the getMessages() methods? Or can this be done?

3.  Are there any major issues/drawbacks with using the database like
this for building the messages HashMap?  We will still use the
ApplicationResources.properties file where appropriate, but since the
database already has the other translation information in it, it seems
logical to use it, but I am open for other views on this.

I have attached the MessageResourcesFactory, DBMessageResourcesFactory and
the actual class which is created from within the factory,
BasePropertyMessageResources.  Below is the initApplication() method which
we have added to the extended ActionServlet to invoke the method dbLoad()
in the BasePropertyMessageResources class.

Thanks in advance.

Todd G. Nist
Email:   [EMAIL PROTECTED]

// initApplicationn method of the extended ActionServlet

public void initApplication() throws ServletException {
super.initApplication();

String dataSource =
getServletConfig().getInitParameter(datasource);

MessageResources mr =

(MessageResources)getServletContext().getAttribute(Action.MESSAGES_KEY);

if (mr == null) {
System.out.println(Message Resource is invalid);
return;
}
  // load resources from the dataSource
((BasePropertyMessageResources)mr).dbLoad(dataSource);
}





MessageResources - Design question - loading resources from a DB by creating you own PropertyMessageResourcesFactory

2002-02-05 Thread Todd G. Nist
);

private static final String[] SELECT_TRANSLATIONS = { select * from
ApplicationResources left join Translations  +
  on
ApplicationResources.message = Translations.stringID  +
  where
Translations.Locale = ?,
  select * from
Field left join Translations  +
  on
Field.FieldLabel = Translations.stringID  +
  where
Translations.Locale = ? };

public BasePropertyMessageResources(MessageResourcesFactory factory,
String config){
super(factory, config);
}

public BasePropertyMessageResources(MessageResourcesFactory factory,
String config,
  boolean returnNull) {
super(factory, config, returnNull);
System.out.println(Completed BasePropertyMessageResources);
}


/**
 * Load the messages HashMap with information maintined in datasource
 *
 * @param dataSource - name of datasource to connect to via poolman
 */
public void dbLoad(String dataSource) {

Connection connection = null;
// hold locales supported on the system
Locale[] lArray = Locale.getAvailableLocales();
// variable to hold the resultset of the query
ResultSet result = null;
// variable to hold prepared statement for translations
PreparedStatement pstmt = null;

try {
connection = ConnectionPool.getConnection(dataSource);
for (int x = 0; x  SELECT_TRANSLATIONS.length; x++) {
pstmt = connection.prepareStatement(SELECT_TRANSLATIONS[x],
ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY);
for ( int i = 0 ; i  lArray.length ; i ++ ) {
pstmt.setString(1, lArray[i].getCountry());
result = pstmt.executeQuery();
synchronized (messages) {
while (result.next()) {
String key = x == 0 ?
result.getString(key):result.getString(FieldName);
System.out.println(loading the following key: 
+ messageKey(lArray[i].getCountry(), key) +
   with value  +
result.getString(TransValue));
messages.put(messageKey(lArray[i].getCountry(),
key), result.getString(TransValue));
}
}
// close result set to free resources
result.close();
} //  for i  lArray.length
} //  for x  SELECT_TRANSLATIONS


} catch(SQLException sqle) {
log.error(Exception reading translation db., sqle);
}
finally {
try {
System.out.println(===);
System.out.println(/* Closing Translation Connection);
System.out.println(===);
// close statement to free resources
pstmt.close();
if (connection != null)
connection.close();
} catch (SQLException sqle) {
log.error(Exception disconnecting form translation db.,
sqle);
}
}
/**
 * Debug
 *
 * Loop through messages to ensure the values were created
 *
 */
Set set = messages.keySet();
Iterator it = set.iterator();
  System.out.println(===);
  System.out.println(/* Iterate over messages);
while (it.hasNext()) {
String s = (String)it.next();
System.out.println(s + \t + messages.get(s));
}
  System.out.println(===);
return;
}

}

Finally, the factory, DBMessageResourcesFactory, looks like the following:

public class DBMessageResourcesFactory extends MessageResourcesFactory {


// - Public
Methods


/**
 * Create and return a newly instansiated codeMessageResources/code.
 * This method must be implemented by concrete subclasses.
 *
 * @param config Configuration parameter(s) for the requested bundle
 */
public MessageResources createResources(String config) {

System.out.println(===);
System.out.println(Config:  + config);
System.out.println(===);

return new BasePropertyMessageResources(this, config,
this.returnNull);

}

}



So what am I missing here?  Any ideas or suggestions are appreciated.

Thanks in advance.

Regards,
Todd G. Nist
Email:   [EMAIL PROTECTED]



Boost Struts with XSLT and XML - JavaWorld.com

2002-02-02 Thread Todd G. Nist

I have not seen this posted so, for those interested in using XSLT and XML
with Struts, thought the following article maybe of value.

Boost Struts with XSLT and XML
An introduction to Model 2X

Summary
Struts is an innovative server-side Java framework designed to build Web
applications. Hosted by the Apache Software Foundation's Jakarta Project,
Struts has recently gained wide acceptance in the Java community. In this
article, Julien Mercay and Gilbert Bouzeid introduce the processing model
underlying Struts, describe the Struts framework itself, and present Model
2X, which enhances Struts by replacing JSP (JavaServer Pages) with XML and
XSLT (Extensible Stylesheet Language Transformations) to better separate
logic and presentation. (2,600 words; February 1, 2002)

By Julien Mercay and Gilbert Bouzeid

URL:  http://www.javaworld.com/javaworld/jw-02-2002/jw-0201-strutsxslt.html?


Todd G. Nist



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




Iterator - determining that this is the first time through

2001-12-20 Thread Todd G. Nist

Hi folks,

If I have a two collections, one representing the rows, and one representing
the columns for a given row and I want to take some action based on the
first iteration of the columns collection (say make it a html:link and pass
a map for parameters), how can I determine that this is the first iteration?
Is there away to test to see if this is the first Iteration and if so take
some action?

Thanks in advance

Todd G. Nist



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




logic:iterator - how to determine if this is the first time through an iteration

2001-12-20 Thread Todd G. Nist

Hello,

Is there a way when iterating through a collection to determine if this is
the first time through the iteration when using the logic:iterator tag?

Thanks in advance,

Todd G. Nist



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




RE: Design Help

2001-12-13 Thread Todd G. Nist

James,

I was reading through the archives when I came across the below post.  If
one follow the design as you have shown below, dose the Delegate get stored
in the form?  If it does then does one reference the DAO via the delegate
with a nested type syntax in the view/JSP?

So if I have a Delegate, which in you example does a viewall, I first
create the delegate, create the DAO and populate it and then store the
Delegate in the form with some standard setter and getter method:

   FORM:

   public void setDelgate(Object d) {
   this.delgate = d;
   }

   public Object getDelgate() {
   return this.delgate;
   }

Then in the view how do I reference the values in the DAO?

Is it just something like:

bean:write name=ViewAllFrm property=delegate.dao.value/

Where dao is the Data access object, and value is a getter in that object.

Is this the correct flow or am I missing something?

Thanks in advance.

Regards,

Todd G. Nist

-Original Message-
From: Hicks, James [mailto:[EMAIL PROTECTED]]
Sent: Thursday, November 29, 2001 5:46 PM
To: Struts Users Mailing List
Subject: RE: Design Help


1) The relationship is a starting point.  Basically, I would not pass an
ActionForm to my business delegate (RentalBean).  Doing so ties that
delegate to the web interface.  If you were wanting to create a Swing client
in the future, you would have to create seperate business delegates for it.
Try to abstract your business delegates from your view ( see code below ).

2) Use a constructor that requires no params, but provide 'public void
init(...)' params to initialize the state of your bean.

3) Depends on the scope of the application.  I usually provide several
different applications, all depending on the business cases (admin app, web
user app, swing app, web services for b2b,...).

4) Start off with a base data access class that has general methods.  The
methods should provide a way to create jdbc connections and close
connections, statements, and result sets.  You can also have query builder
methods in this class that don't tie it to any single use case.


If you are wanting the application to scale upto EJB in the future, you are
best to use delegate objects like you are doing (RentalBean).

If you are wanting to use an Action class for every use case ( adding a
rental, editing a rental, viewing a rental, deleting a rental), then you
don't need to the action property .  If you are wanting to use one class,
then use the 'action' property in the request, this is how id did it below.

The data access object (RentalDAO) should be an interface.  You should use a
factory that uses a JNDI value to select the DAO object.  This allows you to
change databases by just modifing a value in the web.xml file and
redeploying your app.  I wont go into this, but check the java petstore app
(1.2.1) for examples.

With the following code, only the BaseAction, RentalForm, and RentalAction
are tied to the web client and struts.  The business delegate
(RentalDelegate) and the data access object(s) (BaseDAO and RentalDAO) can
now be used with other clients (web, wap, swing,...).

Lets rewrite some of the pseudo-code you sent:

-- Code for BaseAction.java --
public abstract class BaseAction extends Action {
   //Don't use class variables in Action objects.  These are not thread
safe.
   //protected String action=null;

   //provide this method just in case any of your subclassing actions want
to do some pre-initialization processing.
   public ActionForward prePerform(ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response)
   throws IOException, ServletException {

   //could do custom authentication or something else.

   //base implementation returns null.
   return null;
   }

   //this is good.  I do this on all of my projects.  Also got the idea from
Ted Husted and a few others on the list.
   public abstract ActionForward performAction(ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response)
   throws IOException, ServletException;


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

   //WE CANT DO THIS BECAUSE Action OBJECTS ARE NOT THREAD SAFE.
   //Find out what we are doing (Create,Edit,Save,Reset, Delete, etc.)
   //action=request.getParameter(action);
   //if (action == null)
   //  action=mapping.getParameter();


   //catch all uncaught exceptions.  Provide global