fill combo box based onClick of previous combo box

2006-01-19 Thread R.Vijayaraghavan
Hello,

I have an application where I have 3-4 combo boxes. After selecting a
particular value from the first combo box, the second combo box should be
filled with values from the database. Likewise for other combo boxes. How
can this be implemented in Struts.

Will this be feasible:

Call form.submit on combo box's onClick, then get the value in Action, go to
the Model, get the corrosponding values, fill the form bean in Action class
and open the same page.

regards,
vijay.



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



Cannot create iterator for this collection

2006-01-19 Thread Tony Smith
Hi, I am using struts taglib. I have a object like

public class myObject{
List myList;

List getList(){
return myList;
} 

...
}

The myObject is send through aciton to the jsp. In my
jsp, I have:

...


...


But it complains that " Cannot create iterator for
this collection" which means myList is not reconginzed
as a list.

What is wrong?

Thanks,

qq


 

--- Paul Benedict <[EMAIL PROTECTED]> wrote:

> Hakan,
> 
> You need to store the error messages in the request
> or session after you retrieve them:
> 
> ActionErrors errors = form.validate();
> if ((errors != null) && !errors.isEmpty()) {
>   saveErrors(request, errors);
>   return mapping.getInputForward();
> }
> 
> Paul
> 
> 
> __
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam
> protection around 
> http://mail.yahoo.com 
> 
>
-
> To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> For additional commands, e-mail:
> [EMAIL PROTECTED]
> 
> 


__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

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



[OT?-ANN] Article on "Eclipse goes ServerSide - from RCP to RSP"

2006-01-19 Thread Wolfgang Gehner
I've just posted an article on a fairly new way to build web 
applications with Java (including Struts, in tandem with other 
technologies).

The article is at
http://www.infonoia.com/en/content.jsp?d=inf.05.07
It is also discussed at theserverside.com, and eclipsezone.com, since it 
also involves the Eclipse community.


Enjoy!

Wolfgang Gehner




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



Re: error messages doesn't appear if validate is called programatically

2006-01-19 Thread Paul Benedict
Hakan,

You need to store the error messages in the request or session after you 
retrieve them:

ActionErrors errors = form.validate();
if ((errors != null) && !errors.isEmpty()) {
  saveErrors(request, errors);
  return mapping.getInputForward();
}

Paul


__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

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



error messages doesn't appear if validate is called programatically

2006-01-19 Thread Hakan . Barisik

Hi,

I  have started using struts recently.

 I  don't want to use default  validation checking  so I changed 
struts-config.xml. 

.
.
0 )
  // forward to input page



In auto validation case ( validate="true") error messages I configured 
appears on Input JSP
but if  validate="false" as I configured above then messages soesn't 
appear on the Input JSP. 

Could  anyone point me to some documents or provide hint  about this 
problem?

Thanks and regards

Hakan









This email may contain privileged/confidential information. You may not copy or 
disclose this email to anyone without the written permission of the sender.  If 
you have received this email in error please kindly delete this message and 
notify the sender.  Opinions expressed in this email are those of the sender 
and not necessarily the opinions of the employer. 

This email and any attached files should be scanned to detect viruses.  No 
liability will be accepted by the employer for loss or damage (whether caused 
by negligence or not) as a result of email transmission.

Re: [shale] Simple Clay example

2006-01-19 Thread Richard Wallace

Gary VanMatre wrote:

I'll direct you to the shale usecase example instead of duplicating in this 
response but this is the minimum stack to use Clay.
 
Added jars:

  * JSF archives (myfaces or RI)
  * Common-chains.jar
  * shale-core.jar
  * shale-clay.jar
 
Web.xml
* Common Chains – Loads a couple clay preprocess commands 
* Clay common full XML configuration resources.

* (Optional) Clay common full XML configuration resources.
* Shale Application Controller Filter Mapping
* Common Chains Configuration Startup Listener
* Faces Servlet Mappings

  
The problem with the usecases is that there is one webapp that includes 
all the features of Shale. It is difficult to say, "Okay, I just want to 
play with Clay right now. What do I need to do?" At least for a new 
comer to Shale. For instance, my problem was that I stripped out 
everything I didn't think I needed. From what I understood 
commons-chains was mostly being used for the remoting support so I 
removed it from the web.xml and got rid of the configuration. It was 
only because of your description of the stack above that I dug a little 
deeper and found that commons-chain is needed by some core parts of 
Shale, and is especially important for Clay.


So, I now have a working simple Shale Clay setup with just a single file 
that I can start to explore with and find out what Shale Clay can do. 
I've attached the project for anyone else that is interested but finds 
the usecases as daunting as I did.


Thanks,
Rich



shale-clay-example.tar.gz
Description: GNU Zip compressed data
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

RE: [OT] Utility to create DDL from a database

2006-01-19 Thread Ashish Kulkarni
Hi
there is a export tool, but the problem it creates DDL
sorted by table names, and it does not take into
account any database relationships, i may have to go
in manually and creates script..
for example there may be a table ABC which has a
foreign key constraint with table XYZ.
This database utility created DDL for ABC first and
then for XYZ.
So i run these DDL statements it gives error saying
that table XYZ is not created.
So i need some utility which will create DDL
considering these constraints

Ashish


--- [EMAIL PROTECTED] wrote:

> Doesn't your database include such an export tool? 
> What database are
> you using?
> 
> Ashish Kulkarni inquired
> > Is there any open source utility which i can use
> to
> > create DDL from an existing database, so i can use
> it
> > to run to create tables on other database.
> > This utility should be smart enough to create DDL
> > statements for tables with primary key, before
> tables
> > with foreign key.
> > That way when i run the DDL to create tables on
> other
> > database there wont be referential integrity
> errors.
> > Is there some thing like this out in market.
> 
>
-
> To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> For additional commands, e-mail:
> [EMAIL PROTECTED]
> 
> 


__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

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



Re: URL parameters parsed into a Map

2006-01-19 Thread Keith Fetterman
Dah. I feel like such an idiot.  I didn't think to look in the servlet 
javadocs.  Thanks a bunch. I really *appreciate* it.


Michael Jouravlev wrote:

On 1/19/06, Keith Fetterman <[EMAIL PROTECTED]> wrote:


I need to parse the http parameters/values contained in a URL have them
placed into a Map.  I will then replace specific parameters and feed the
Map to an  tag.  Is there a utility class in Struts that
would do this?  Or some other open source third party library that can
do this?

This is not a hard class to write, but it seems like it would be a
common function that would be needed since the  and
 tags take a Map.

I googled for a solution and looked in the Struts documentation, but I
can't find anything.  Your help is appreciated it.



http://java.sun.com/j2ee/1.4/docs/api/javax/servlet/ServletRequest.html#getParameterMap()

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



--
-
Keith Fetterman  206-780-5670
Mariner Supply, Inc. [EMAIL PROTECTED]
http://www.go2marine.com

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



Re: URL parameters parsed into a Map

2006-01-19 Thread Michael Jouravlev
On 1/19/06, Keith Fetterman <[EMAIL PROTECTED]> wrote:
> I need to parse the http parameters/values contained in a URL have them
> placed into a Map.  I will then replace specific parameters and feed the
> Map to an  tag.  Is there a utility class in Struts that
> would do this?  Or some other open source third party library that can
> do this?
>
> This is not a hard class to write, but it seems like it would be a
> common function that would be needed since the  and
>  tags take a Map.
>
> I googled for a solution and looked in the Struts documentation, but I
> can't find anything.  Your help is appreciated it.

http://java.sun.com/j2ee/1.4/docs/api/javax/servlet/ServletRequest.html#getParameterMap()

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



Re: [shale] Simple Clay example

2006-01-19 Thread Gary VanMatre
>From: Richard Wallace <[EMAIL PROTECTED]> 
>
> Ok, let me try a simpler question. Does anyone have an example of a 
> simple one page webapp using clay and the HTML view? 

The shale usecases has several Clay examples.  The nightly is the most current. 
 You can find it here: http://svn.apache.org/builds/struts/nightly/struts-shale/

>It would be handy 
> to have that available in the source repo so that users can try and 
> consume different aspects of Shale a little at a time and come to grips 
> with features one at a time rather than have to look at gigantic web.xml 
> and faces-config.xml files. It's rather confusing, especially given the 
> current lack of documentation. 

:--)  Well, the Clay documentation aspect can only get better.  I've been 
holding out for one of  the best.  I talked to David Geary this afternoon, (we 
talked about java while having some java) and he's going to help us out here.  

Shale has allot of value added features for JSF.  The new AJAX remoting, 
registration of managed beans with annotations, commons validator 
(soon/maybe/possibly Ajax enabled), Clay's reusable view page composition 
options and tiles integration to name a few.

  
> 
> Thanks, 
> Rich 
> 

Gary

Re: [shale] Simple Clay example

2006-01-19 Thread Gary VanMatre
From: Richard Wallace <[EMAIL PROTECTED]> 
>
> Hello, 
> 
> I'm trying to get a simple clay example up and running so that I can use 
> the full html view (which is similar to facelets, correct?). 
> 

They are similar but the differences is that Clay is based on a JSF component 
and can be used in JSP, HTML, XML or a mix. Clay also allows meta-data 
inheritance like tiles so that you can define a single component or composition 
of components that can be extended. Both support tapestry like views. Clay also 
has a notion of full XML views which is similar to the tiles page definition.  
It also has symbol replacement which is similar to tiles.

> I looked at the use cases and copied the web.xml, faces-config.xml and 
> clay-config.xml and stripped out anything that I didn't need, like 
> Spring and dialog stuff (I'll play with that later). So, what I'm left 
> with is a pretty standard looking web.xml with the 
> ShaleApplicationFilter added, a context param for 
> org.apache.shale.clay.COMMON_CONFIG_FILES, and a servlet filter for the 
> FacesServletFilter to be mapped to *.html files. 
> 
> The clay-config.xml file is empty except for the root element 
> . The faces-config.xml is empty as well. 
> 
> I've got a simple default.html page with just a single element with 
> a jsfid="commandLink". 
> 
> 
> When I try and access http://localhost:8080/shale-test/default.jsf (I 
> changed the mapping for the servlet to be to .jsf instead of .faces), 
> the following shows up in the logs and I see a big 404: 
> 
> Jan 19, 2006 11:29:26 AM org.apache.shale.view.faces.ViewViewHandler 
> setupViewController 
> WARNING: No ViewController for viewId /default.jsp found under name default 
> 
> Clearly it's trying to access a .jsp instead of my .html. What do I 
> need to do to fix it? Do I need to set the view-handler in the 
> faces-config.xml to a Shale-Clay view handler? 
> 

Shale is comprised of layers that you can choose to use or not include but all 
require the core library.  Besides some shared code, the core includes shared 
services that are common.  The Shale Application filter is the most visible but 
there are other utilities that are registered as managed beans by just 
inclusion of the shale core java archive.

The Shale Application filter is a controller that allows Shale to add 
additional life cycle events to the vanilla JSF life cycle without actually 
depending on a specific JSF implementation (RI, MyFaces).  The JSF lifecycle is 
one of the few parts of JSF that is not an extension point – loosely coupled so 
that it is swappable in the XML configuration file.

I'll direct you to the shale usecase example instead of duplicating in this 
response but this is the minimum stack to use Clay.
 
Added jars:
  * JSF archives (myfaces or RI)
  * Common-chains.jar
  * shale-core.jar
  * shale-clay.jar
 
Web.xml
* Common Chains – Loads a couple clay preprocess commands 
* Clay common full XML configuration resources.
* (Optional) Clay common full XML configuration resources.
* Shale Application Controller Filter Mapping
* Common Chains Configuration Startup Listener
* Faces Servlet Mappings

The warning you are seeing has to do with the core ViewController in Shale. The 
view controller is a managed bean that receives callback events for the 
additional life cycle events. There is an association of the view id with the 
view controller. The view controller is a managed bean that is registered with 
a naming convention (another pluggable part). In Struts 1.x terms this would be 
like associating a path with a action and form bean at the same time. The 
warning message is generated to inform that the controller filter couldn't find 
a managed bean matching the naming criteria.

> Thanks, 
> Rich 
> 

Gary

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

URL parameters parsed into a Map

2006-01-19 Thread Keith Fetterman
I need to parse the http parameters/values contained in a URL have them 
placed into a Map.  I will then replace specific parameters and feed the 
Map to an  tag.  Is there a utility class in Struts that 
would do this?  Or some other open source third party library that can 
do this?


This is not a hard class to write, but it seems like it would be a 
common function that would be needed since the  and 
 tags take a Map.


I googled for a solution and looked in the Struts documentation, but I 
can't find anything.  Your help is appreciated it.


--Keith



--
-
Keith Fetterman  206-780-5670
Mariner Supply, Inc. [EMAIL PROTECTED]
http://www.go2marine.com

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



Re: Problem with Struts Validator on machines without internet access

2006-01-19 Thread Niall Pemberton
The DTD's are shipped in the Commons Validator jar - when the xml config
file(s) are parsed (using Digester) local copies of the DTD (i.e. the ones
in the jar) are registered and should be picked up and therefore it
shouldn't need to go over the net to get them. This problem usually occurs
when the DTD declaration in your validatior xml config files is incorrect.

You should have something like the following at the top of your validator
xml files...

http://jakarta.apache.org/commons/dtds/validator_1_1_3.dtd";>

The above is for Version 1.1.3 of Commons Validator DTD - but the jar also
contains DTDs for 1.0, 1.0.1, and 1.1 - so declarations for them should also
work locally.

If your DTD declaration is correct, the other thing you might check is that
you have deployed the correct Commons Validator jar.

Niall

- Original Message - 
From: "Bart Busschots" <[EMAIL PROTECTED]>
To: 
Sent: Friday, January 20, 2006 12:06 AM
Subject: Problem with Struts Validator on machines without internet access


> Hi,
>
> I'm trying to develop a Struts application on my laptop which spends
> quite a lot of it's time without net access. This should not cause any
> problems because the app it self has  no need to access the net at all
> but it is. The problem occours when I try to start Tomcat while not
> connected to the network. When I do that the Struts Validator throws an
> exception while Tomcat is starting. If I connect to the net the app
> start fine. The stack trace is as follows:
>
> INFO: Processing Context configuration file URL
>
file:/usr/local/jakarta-tomcat-5.0.28/conf/Catalina/localhost/vtie_live.xml
> Jan 19, 2006 11:41:21 PM org.apache.struts.validator.ValidatorPlugIn
> initResources
> INFO: Loading validation rules file from '/WEB-INF/validator-rules.xml'
> Jan 19, 2006 11:41:21 PM org.apache.struts.validator.ValidatorPlugIn
> initResources
> INFO: Loading validation rules file from '/WEB-INF/validation.xml'
> Jan 19, 2006 11:41:22 PM org.apache.struts.validator.ValidatorPlugIn init
> SEVERE: jakarta.apache.org
> java.net.UnknownHostException: jakarta.apache.org
> at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:153)
> at java.net.Socket.connect(Socket.java:452)
> at java.net.Socket.connect(Socket.java:402)
> at sun.net.NetworkClient.doConnect(NetworkClient.java:139)
> at sun.net.www.http.HttpClient.openServer(HttpClient.java:402)
> at sun.net.www.http.HttpClient.openServer(HttpClient.java:618)
> at sun.net.www.http.HttpClient.(HttpClient.java:306)
> at sun.net.www.http.HttpClient.(HttpClient.java:267)
> at sun.net.www.http.HttpClient.New(HttpClient.java:339)
> at sun.net.www.http.HttpClient.New(HttpClient.java:320)
> at sun.net.www.http.HttpClient.New(HttpClient.java:315)
> at
>
sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.j
ava:521)
> at
>
sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:4
98)
> at
>
sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection
.java:626)
> at
> org.apache.xerces.impl.XMLEntityManager.setupCurrentEntity(Unknown Source)
> at org.apache.xerces.impl.XMLEntityManager.startEntity(Unknown
> Source)
> at
> org.apache.xerces.impl.XMLEntityManager.startDTDEntity(Unknown Source)
> at
> org.apache.xerces.impl.XMLDTDScannerImpl.setInputSource(Unknown Source)
> at
>
org.apache.xerces.impl.XMLDocumentScannerImpl$DTDDispatcher.dispatch(Unknown
> Source)
> at
> org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown
> Source)
> at org.apache.xerces.parsers.XML11Configuration.parse(Unknown
> Source)
> at org.apache.xerces.parsers.XML11Configuration.parse(Unknown
> Source)
> at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
> at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown
Source)
> at org.apache.commons.digester.Digester.parse(Digester.java:1591)
> at
>
org.apache.commons.validator.ValidatorResources.(ValidatorResources.ja
va:159)
> at
>
org.apache.struts.validator.ValidatorPlugIn.initResources(ValidatorPlugIn.ja
va:237)
> at
> org.apache.struts.validator.ValidatorPlugIn.init(ValidatorPlugIn.java:162)
> at
>
org.apache.struts.action.ActionServlet.initModulePlugIns(ActionServlet.java:
869)
> at
> org.apache.struts.action.ActionServlet.init(ActionServlet.java:336)
> at javax.servlet.GenericServlet.init(GenericServlet.java:211)
> at
>
org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:10
29)
> at
> org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:862)
> at
>
org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:
4013)
> at
> org.apache.catalina.core.StandardContext.start(StandardContext.java:4357)
> at
>
org.apache.catal

Re: [shale] Simple Clay example

2006-01-19 Thread Richard Wallace
Ok, let me try a simpler question.  Does anyone have an example of a 
simple one page webapp using clay and the HTML view?  It would be handy 
to have that available in the source repo so that users can try and 
consume different aspects of Shale a little at a time and come to grips 
with features one at a time rather than have to look at gigantic web.xml 
and faces-config.xml files.  It's rather confusing, especially given the 
current lack of  documentation.


Thanks,
Rich

Richard Wallace wrote:

Hello,

I'm trying to get a simple clay example up and running so that I can 
use the full html view (which is similar to facelets, correct?).


I looked at the use cases and copied the web.xml, faces-config.xml and 
clay-config.xml and stripped out anything that I didn't need, like 
Spring and dialog stuff (I'll play with that later).  So, what I'm 
left with is a pretty standard looking web.xml with the 
ShaleApplicationFilter added, a context param for 
org.apache.shale.clay.COMMON_CONFIG_FILES, and a servlet filter for 
the FacesServletFilter to be mapped to *.html files.


The clay-config.xml file is empty except for the root element 
.  The faces-config.xml is empty as well.


I've got a simple default.html page with just a single  element 
with a jsfid="commandLink".


When I deploy the webapp the logs are as follows:
Jan 19, 2006 11:27:50 AM org.apache.catalina.startup.HostConfig deployWAR
INFO: Deploying web application archive shale-test.war
Jan 19, 2006 11:27:51 AM 
org.apache.shale.clay.config.ClayConfigureListener contextInitialized

INFO: Begin loading config files.
Jan 19, 2006 11:27:51 AM 
org.apache.shale.clay.config.beans.ComponentConfigBean$WatchDog refresh
INFO: Loading file 
"file:/opt/apache-tomcat-5.5.12/webapps/shale-test/WEB-INF/lib/shale-clay-SNAPSHOT.jar!/META-INF/clay-config.xml". 

Jan 19, 2006 11:27:51 AM org.apache.shale.clay.config.ClayXmlParser 
configureRules

INFO: Loading digester rules.
Jan 19, 2006 11:27:51 AM 
org.apache.shale.clay.config.beans.ComponentConfigBean$WatchDog refresh

INFO: Loading file "/localhost/shale-test/WEB-INF/clay-config.xml".
Jan 19, 2006 11:27:51 AM 
org.apache.shale.clay.config.beans.ComponentConfigBean resolveInheritance

INFO: Begin resolving inheritance @:-<
Jan 19, 2006 11:27:51 AM 
org.apache.shale.clay.config.beans.ComponentConfigBean resolveInheritance

INFO: Finding parents ?:-[
Jan 19, 2006 11:27:51 AM 
org.apache.shale.clay.config.beans.ComponentConfigBean resolveInheritance

INFO: Checking for circular inheritance %:-{
Jan 19, 2006 11:27:51 AM 
org.apache.shale.clay.config.beans.ComponentConfigBean resolveInheritance

INFO: Realizing heritage $:-<
Jan 19, 2006 11:27:51 AM 
org.apache.shale.clay.config.beans.ComponentConfigBean resolveInheritance

INFO: Inheritance resolved @:-)
Jan 19, 2006 11:27:51 AM 
org.apache.shale.clay.config.ClayConfigureListener contextInitialized

INFO: Done loading config file(s).
Jan 19, 2006 11:27:51 AM org.apache.myfaces.config.FacesConfigurator 
feedStandardConfig
INFO: Reading standard config 
org/apache/myfaces/resource/standard-faces-config.xml
Jan 19, 2006 11:27:51 AM org.apache.myfaces.config.FacesConfigurator 
feedClassloaderConfigurations
INFO: Reading config 
jar:file:/opt/apache-tomcat-5.5.12/webapps/shale-test/WEB-INF/lib/shale-clay-SNAPSHOT.jar!/META-INF/faces-config.xml 

Jan 19, 2006 11:27:51 AM org.apache.myfaces.config.FacesConfigurator 
feedClassloaderConfigurations
INFO: Reading config 
jar:file:/opt/apache-tomcat-5.5.12/webapps/shale-test/WEB-INF/lib/shale-core-SNAPSHOT.jar!/META-INF/faces-config.xml 

Jan 19, 2006 11:27:51 AM org.apache.myfaces.config.FacesConfigurator 
feedWebAppConfig

INFO: Reading config /WEB-INF/faces-config.xml
Jan 19, 2006 11:27:51 AM org.apache.shale.clay.faces.ClayViewHandler 


INFO: Loading Clay View Handler
Jan 19, 2006 11:27:51 AM 
org.apache.myfaces.webapp.StartupServletContextListener initFaces
INFO: ServletContext '/opt/apache-tomcat-5.5.12/webapps/shale-test/' 
initialized.
Jan 19, 2006 11:27:51 AM org.apache.shale.faces.ShaleApplicationFilter 
init

INFO: Initializing Shale Application Filter

When I try and access http://localhost:8080/shale-test/default.jsf (I 
changed the mapping for the servlet to be to .jsf instead of .faces), 
the following shows up in the logs and I see a big 404:


Jan 19, 2006 11:29:26 AM org.apache.shale.view.faces.ViewViewHandler 
setupViewController
WARNING: No ViewController for viewId /default.jsp found under name 
default


Clearly it's trying to access a .jsp instead of my .html.  What do I 
need to do to fix it?  Do I need to set the view-handler in the 
faces-config.xml to a Shale-Clay view handler?


Thanks,
Rich

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




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

Re: struts javadocs?

2006-01-19 Thread Josh McDonald
Also of course, if you have the source, simply run javadoc and the docs
pertaining exactly to your version will be generated for you :)
 
-- 
 
"His comrades fought beside him, Van Owen and the rest...
   But of all the thompson gunners- Roland was the best."
 
Josh McDonald
Analyst Programmer
Information Technology
Ph: 61 7 3006 6460
Email: [EMAIL PROTECTED]


>>> [EMAIL PROTECTED] 20/01/2006 10:33:07 am >>>

On 1/19/06, David Thielen <[EMAIL PROTECTED]> wrote:

> Where is the war file found? I downloaded the lib & src .zip files
and they
> don't have it.

The example apps, including struts-documentation.war, are part of the
binary distribution, and are found in the 'webapps' directory.

You can get 'struts-1.2.8-bin.zip' here:  
http://struts.apache.org/download.cgi

--
Wendy

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








***
Messages included in this e-mail and any of its attachments are those
of the author unless specifically stated to represent WorkCover Queensland. The 
contents of this message are to be used for the intended purpose only and are 
to be kept confidential at all times.
This message may contain privileged information directed only to the intended 
addressee/s. Accidental receipt of this information should be deleted promptly 
and the sender notified.
This e-mail has been scanned by Sophos for known viruses.
However, no warranty nor liability is implied in this respect.




Re: struts javadocs?

2006-01-19 Thread Wendy Smoak
On 1/19/06, David Thielen <[EMAIL PROTECTED]> wrote:

> Where is the war file found? I downloaded the lib & src .zip files and they
> don't have it.

The example apps, including struts-documentation.war, are part of the
binary distribution, and are found in the 'webapps' directory.

You can get 'struts-1.2.8-bin.zip' here:   http://struts.apache.org/download.cgi

--
Wendy

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



RE: struts javadocs?

2006-01-19 Thread David Thielen
Where is the war file found? I downloaded the lib & src .zip files and they
don't have it.

??? - thanks - dave

 
David Thielen
www.windwardreports.com
303-499-2544

-Original Message-
From: Wendy Smoak [mailto:[EMAIL PROTECTED] 
Sent: Thursday, January 19, 2006 5:01 PM
To: Struts Users Mailing List
Subject: Re: struts javadocs?

On 1/19/06, David Thielen <[EMAIL PROTECTED]> wrote:

> I'm using 1.2.8 (latest release) and I can't find anywhere to download the
> javadocs. There are on the web at
> http://struts.apache.org/struts-doc-1.2.x/api/index.html so I'm covered
but
> I prefer local cause it's a bit faster.

Unzip (or deploy) the struts-documentation.war file.  The Javadocs are in
there.

--
Wendy

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



Problem with Struts Validator on machines without internet access

2006-01-19 Thread Bart Busschots

Hi,

I'm trying to develop a Struts application on my laptop which spends 
quite a lot of it's time without net access. This should not cause any 
problems because the app it self has  no need to access the net at all 
but it is. The problem occours when I try to start Tomcat while not 
connected to the network. When I do that the Struts Validator throws an 
exception while Tomcat is starting. If I connect to the net the app 
start fine. The stack trace is as follows:


INFO: Processing Context configuration file URL 
file:/usr/local/jakarta-tomcat-5.0.28/conf/Catalina/localhost/vtie_live.xml
Jan 19, 2006 11:41:21 PM org.apache.struts.validator.ValidatorPlugIn 
initResources

INFO: Loading validation rules file from '/WEB-INF/validator-rules.xml'
Jan 19, 2006 11:41:21 PM org.apache.struts.validator.ValidatorPlugIn 
initResources

INFO: Loading validation rules file from '/WEB-INF/validation.xml'
Jan 19, 2006 11:41:22 PM org.apache.struts.validator.ValidatorPlugIn init
SEVERE: jakarta.apache.org
java.net.UnknownHostException: jakarta.apache.org
   at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:153)
   at java.net.Socket.connect(Socket.java:452)
   at java.net.Socket.connect(Socket.java:402)
   at sun.net.NetworkClient.doConnect(NetworkClient.java:139)
   at sun.net.www.http.HttpClient.openServer(HttpClient.java:402)
   at sun.net.www.http.HttpClient.openServer(HttpClient.java:618)
   at sun.net.www.http.HttpClient.(HttpClient.java:306)
   at sun.net.www.http.HttpClient.(HttpClient.java:267)
   at sun.net.www.http.HttpClient.New(HttpClient.java:339)
   at sun.net.www.http.HttpClient.New(HttpClient.java:320)
   at sun.net.www.http.HttpClient.New(HttpClient.java:315)
   at 
sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:521)
   at 
sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:498)
   at 
sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:626)
   at 
org.apache.xerces.impl.XMLEntityManager.setupCurrentEntity(Unknown Source)
   at org.apache.xerces.impl.XMLEntityManager.startEntity(Unknown 
Source)
   at 
org.apache.xerces.impl.XMLEntityManager.startDTDEntity(Unknown Source)
   at 
org.apache.xerces.impl.XMLDTDScannerImpl.setInputSource(Unknown Source)
   at 
org.apache.xerces.impl.XMLDocumentScannerImpl$DTDDispatcher.dispatch(Unknown 
Source)
   at 
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown 
Source)
   at org.apache.xerces.parsers.XML11Configuration.parse(Unknown 
Source)
   at org.apache.xerces.parsers.XML11Configuration.parse(Unknown 
Source)

   at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
   at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
   at org.apache.commons.digester.Digester.parse(Digester.java:1591)
   at 
org.apache.commons.validator.ValidatorResources.(ValidatorResources.java:159)
   at 
org.apache.struts.validator.ValidatorPlugIn.initResources(ValidatorPlugIn.java:237)
   at 
org.apache.struts.validator.ValidatorPlugIn.init(ValidatorPlugIn.java:162)
   at 
org.apache.struts.action.ActionServlet.initModulePlugIns(ActionServlet.java:869)
   at 
org.apache.struts.action.ActionServlet.init(ActionServlet.java:336)

   at javax.servlet.GenericServlet.init(GenericServlet.java:211)
   at 
org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1029)
   at 
org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:862)
   at 
org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4013)
   at 
org.apache.catalina.core.StandardContext.start(StandardContext.java:4357)
   at 
org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:823)
   at 
org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:807)
   at 
org.apache.catalina.core.StandardHost.addChild(StandardHost.java:595)
   at 
org.apache.catalina.core.StandardHostDeployer.addChild(StandardHostDeployer.java:903)

   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
   at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

   at java.lang.reflect.Method.invoke(Method.java:324)
   at 
org.apache.commons.beanutils.MethodUtils.invokeMethod(MethodUtils.java:216)

   at org.apache.commons.digester.SetNextRule.end(SetNextRule.java:256)
   at org.apache.commons.digester.Rule.end(Rule.java:276)
   at 
org.apache.commons.digester.Digester.endElement(Digester.java:1058)
   at 
org.apache.catalina.util.CatalinaDigester.endElement(CatalinaDigester.java:76)
   at 
org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source)
   at 
org.apache.xerces.impl.XMLDocumentFragmentScannerIm

Re: struts javadocs?

2006-01-19 Thread Wendy Smoak
On 1/19/06, David Thielen <[EMAIL PROTECTED]> wrote:

> I'm using 1.2.8 (latest release) and I can't find anywhere to download the
> javadocs. There are on the web at
> http://struts.apache.org/struts-doc-1.2.x/api/index.html so I'm covered but
> I prefer local cause it's a bit faster.

Unzip (or deploy) the struts-documentation.war file.  The Javadocs are in there.

--
Wendy

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



RE: struts javadocs?

2006-01-19 Thread David Thielen
Hi;

I'm using 1.2.8 (latest release) and I can't find anywhere to download the
javadocs. There are on the web at
http://struts.apache.org/struts-doc-1.2.x/api/index.html so I'm covered but
I prefer local cause it's a bit faster.

Thanks - dave

 
David Thielen
www.windwardreports.com
303-499-2544

-Original Message-
From: Wendy Smoak [mailto:[EMAIL PROTECTED] 
Sent: Thursday, January 19, 2006 4:52 PM
To: Struts Users Mailing List
Subject: Re: struts javadocs?

On 1/19/06, David Thielen <[EMAIL PROTECTED]> wrote:

> Are there javadocs for struts anywhere? All I can find is in the source
.zip
> it has a bunch of xml files - but no html. I'm using my old struts
javadocs
> from 18 months ago.

What version are you using?  The latest Javadoc for Struts Action 1.3
and Shale is here:
   http://struts.apache.org/javadoc.html

If you're using the nightly builds, the binary distributions should
include the HTML version of the website, including the Javadocs.

--
Wendy

-
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 javadocs?

2006-01-19 Thread Wendy Smoak
On 1/19/06, David Thielen <[EMAIL PROTECTED]> wrote:

> Are there javadocs for struts anywhere? All I can find is in the source .zip
> it has a bunch of xml files - but no html. I'm using my old struts javadocs
> from 18 months ago.

What version are you using?  The latest Javadoc for Struts Action 1.3
and Shale is here:
   http://struts.apache.org/javadoc.html

If you're using the nightly builds, the binary distributions should
include the HTML version of the website, including the Javadocs.

--
Wendy

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



Re: struts javadocs?

2006-01-19 Thread Dave Newton
David Thielen wrote:
> Are there javadocs for struts anywhere? 
http://struts.apache.org/struts-doc-1.2.x/api/index.html
> All I can find is in the source .zip it has a bunch of xml files - but no 
> html.
That's because it's the source.

Als0-Dave



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



Re: struts/jsp security/access question

2006-01-19 Thread Dave Newton
Leon Rosenberg wrote:
> 4. put all jsps under WEB-INF so they are NOT accessable via url.
> always link urls to actions and forward to jsps. Make a simply forward
> action (the only line: return mapping.findForward("success"); ) for
> jsp which do not need any preprocessing
>   
Or use the action mapping 'forward' property and avoid writing the
action at all ;)

Dave



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



struts javadocs?

2006-01-19 Thread David Thielen
Hi;

 

Are there javadocs for struts anywhere? All I can find is in the source .zip
it has a bunch of xml files - but no html. I'm using my old struts javadocs
from 18 months ago.

 

Thanks - dave

 

 

David Thielen

www.windwardreports.com

303-499-2544

 



b-di messages and dir="RTL"?

2006-01-19 Thread David Thielen
Hi;

 

Ok, I use a resource file for all text and then put it in the html page
using c:out, etc. But, what about Hebrew & Arabic? They need to be marked
with dir="RTL". I can make the message hi there but
then I can't escape any text and have to make sure I have escaped things in
my messages.

 

And I have a feeling this could get weird where some of the text on my page
I am pulling from a database and have no idea what it's direction is.

 

Is there a better way?

 

Thanks - dave

 

 

David Thielen

www.windwardreports.com

303-499-2544

 



RE: struts/jsp security/access question

2006-01-19 Thread David Thielen
Because none of the books and articles I have seen mention it???

Thank you - that is a very clean solution.

Thanks - dave

 
David Thielen
www.windwardreports.com
303-499-2544

-Original Message-
From: Leon Rosenberg [mailto:[EMAIL PROTECTED] 
Sent: Thursday, January 19, 2006 3:36 PM
To: Struts Users Mailing List
Subject: Re: struts/jsp security/access question

4. put all jsps under WEB-INF so they are NOT accessable via url.
always link urls to actions and forward to jsps. Make a simply forward
action (the only line: return mapping.findForward("success"); ) for
jsp which do not need any preprocessing

regards
Leon

On 1/19/06, David Thielen <[EMAIL PROTECTED]> wrote:
> Hi;
>
>
>
> I have a page admin.jsp that if a user is not an admin, they should never
> see. I can make the standard way to get there be admin.do but that just
> invites a hacker to type in admin.jsp, so I still have to insure that
> requests for admin.jsp are redirected for non admin users.
>
>
>
> Each page (jsp) and it's Action class know who is allowed in. So I would
> like to handle this in one of these two places. But the only two solutions
I
> have come up with are:
>
> 1.  A filter with all pages and who can access them in that one class
-
> dangerous because a new page can get added and the developer forgets to
add
> it to the authorization class.
> 2.  We have jsp pages that just do a check and redirect if the user is
> not authorized. We then include the appropiate one at the top of each jsp
> page. This works great if there are a small set of authorizations (this is
> what I used before - every user was one of 3 types). However, it breaks
down
> for more than a couple of pre-defined authorization groups.
> 3.  All pages are accessed via preAction -> jsp -> submitAction. The
> preAction sets a session attribute to the name of the jsp. The jsp page at
> the top checks this attribute and if it is not it's name, it redirects to
> the home page. As a session attribute, as soon as the user goes to another
> preAction, they can't go back to the previous jsp. So it forces the
> pre/jsp/submit ordering. The downside to this is the back button will be
> limited to the jsp page that the global attribute is set to, not going
back
> further.
>
>
>
> Any other approaches?
>
>
>
> Thanks - dave
>
>
>
>
>
> David Thielen
>
> www.windwardreports.com
>
> 303-499-2544
>
>
>
>
>

-
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 JSTL & EL

2006-01-19 Thread Josh McDonald
Cheers guys, much appreciated - sorry bout all the (possibly quite dumb)
q's :)

-Josh
 
-- 
 
"His comrades fought beside him, Van Owen and the rest...
   But of all the thompson gunners- Roland was the best."
 
Josh McDonald
Analyst Programmer
Information Technology
Ph: 61 7 3006 6460
Email: [EMAIL PROTECTED]


>>> [EMAIL PROTECTED] 20/01/2006 8:34:04 am >>>

On 1/19/06, Josh McDonald <[EMAIL PROTECTED]> wrote:
>
> What I mean is, can you use it inside third party (and your own)
tags?


By "it" do you mean EL expressions?  If so, the answer is yes.  The
tags
don't have to know anything about this, because the JSP page compiler
generates the code to evaluate the expression before calling the setter
on
your tag handler.

This is unlike the case prior to JSP 2.0, where the page compiler knew
nothing about expressions, so you could only use them in tag attributes
of
tags that had special logic to do the evaluations themselves.

Also, can you use it to get the result of a method that's not really a
> GETTER? Such as size() on a collection, even though there's no
getSize()
> method?


There is EL syntax for calling static methods, but not instance methods
like
List.size().

Cheers,
> -Josh


Craig







***
Messages included in this e-mail and any of its attachments are those
of the author unless specifically stated to represent WorkCover Queensland. The 
contents of this message are to be used for the intended purpose only and are 
to be kept confidential at all times.
This message may contain privileged information directed only to the intended 
addressee/s. Accidental receipt of this information should be deleted promptly 
and the sender notified.
This e-mail has been scanned by Sophos for known viruses.
However, no warranty nor liability is implied in this respect.




Re: Be Careful though: was Re: Struts JSTL & EL

2006-01-19 Thread Rahul Akolkar
On 1/19/06, Rick Reumann <[EMAIL PROTECTED]> wrote:
> Rahul Akolkar wrote the following on 1/19/2006 3:30 PM:
>
> > For such concerns ...
> >
> > ${fn:escapeXml(test)}
> >
> > is an option.
> >
> >  is overrated in JSP >= 2.0, IMO.
>
> Just curious why is ${fn:escapeXml(test)} any better than  value='${test}'/> ?
>


Lets lay out all the options:

1) ${test}
2) ${fn:escapeXml(test)}
3) 
4) 

And the scenarios:

a) "test" must be escaped
b) "test" cannot contain characters that need to be escaped
c) "test" must not be escaped

Then, keeping aside jspx/tagx files:

i) For (b) and (c), (1) wins, the criteria being:
  * Verbosity
  * Need for JSP tag invocation.
ii) For (a), (2) wins because I'm already doing (i).

Ofcourse, to each their own.

-Rahul



> --
> Rick
>

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



RE: struts/jsp security/access question

2006-01-19 Thread George.Dinwiddie
Why isn't your jsp page under WEB-INF?

 - George
   http://www.idiacomputing.com

> -Original Message-
> From: David Thielen [mailto:[EMAIL PROTECTED] 
> Sent: Thursday, January 19, 2006 5:14 PM
> To: user@struts.apache.org
> Subject: struts/jsp security/access question
> 
> 
> Hi;
> 
>  
> 
> I have a page admin.jsp that if a user is not an admin, they 
> should never see. I can make the standard way to get there be 
> admin.do but that just invites a hacker to type in admin.jsp, 
> so I still have to insure that requests for admin.jsp are 
> redirected for non admin users.
> 
>  
> 
> Each page (jsp) and it's Action class know who is allowed in. 
> So I would like to handle this in one of these two places. 
> But the only two solutions I have come up with are:
> 
> 1.A filter with all pages and who can access them in that 
> one class -
> dangerous because a new page can get added and the developer 
> forgets to add it to the authorization class.
> 2.We have jsp pages that just do a check and redirect if 
> the user is
> not authorized. We then include the appropiate one at the top 
> of each jsp page. This works great if there are a small set 
> of authorizations (this is what I used before - every user 
> was one of 3 types). However, it breaks down for more than a 
> couple of pre-defined authorization groups.
> 3.All pages are accessed via preAction -> jsp -> submitAction. The
> preAction sets a session attribute to the name of the jsp. 
> The jsp page at the top checks this attribute and if it is 
> not it's name, it redirects to the home page. As a session 
> attribute, as soon as the user goes to another preAction, 
> they can't go back to the previous jsp. So it forces the 
> pre/jsp/submit ordering. The downside to this is the back 
> button will be limited to the jsp page that the global 
> attribute is set to, not going back further.
> 
>  
> 
> Any other approaches?
> 
>  
> 
> Thanks - dave
> 
>  
> 
>  
> 
> David Thielen
> 
www.windwardreports.com

303-499-2544

 


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



Re: struts/jsp security/access question

2006-01-19 Thread Leon Rosenberg
4. put all jsps under WEB-INF so they are NOT accessable via url.
always link urls to actions and forward to jsps. Make a simply forward
action (the only line: return mapping.findForward("success"); ) for
jsp which do not need any preprocessing

regards
Leon

On 1/19/06, David Thielen <[EMAIL PROTECTED]> wrote:
> Hi;
>
>
>
> I have a page admin.jsp that if a user is not an admin, they should never
> see. I can make the standard way to get there be admin.do but that just
> invites a hacker to type in admin.jsp, so I still have to insure that
> requests for admin.jsp are redirected for non admin users.
>
>
>
> Each page (jsp) and it's Action class know who is allowed in. So I would
> like to handle this in one of these two places. But the only two solutions I
> have come up with are:
>
> 1.  A filter with all pages and who can access them in that one class -
> dangerous because a new page can get added and the developer forgets to add
> it to the authorization class.
> 2.  We have jsp pages that just do a check and redirect if the user is
> not authorized. We then include the appropiate one at the top of each jsp
> page. This works great if there are a small set of authorizations (this is
> what I used before - every user was one of 3 types). However, it breaks down
> for more than a couple of pre-defined authorization groups.
> 3.  All pages are accessed via preAction -> jsp -> submitAction. The
> preAction sets a session attribute to the name of the jsp. The jsp page at
> the top checks this attribute and if it is not it's name, it redirects to
> the home page. As a session attribute, as soon as the user goes to another
> preAction, they can't go back to the previous jsp. So it forces the
> pre/jsp/submit ordering. The downside to this is the back button will be
> limited to the jsp page that the global attribute is set to, not going back
> further.
>
>
>
> Any other approaches?
>
>
>
> Thanks - dave
>
>
>
>
>
> David Thielen
>
> www.windwardreports.com
>
> 303-499-2544
>
>
>
>
>

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



Re: Struts JSTL & EL

2006-01-19 Thread Craig McClanahan
On 1/19/06, Josh McDonald <[EMAIL PROTECTED]> wrote:
>
> What I mean is, can you use it inside third party (and your own) tags?


By "it" do you mean EL expressions?  If so, the answer is yes.  The tags
don't have to know anything about this, because the JSP page compiler
generates the code to evaluate the expression before calling the setter on
your tag handler.

This is unlike the case prior to JSP 2.0, where the page compiler knew
nothing about expressions, so you could only use them in tag attributes of
tags that had special logic to do the evaluations themselves.

Also, can you use it to get the result of a method that's not really a
> GETTER? Such as size() on a collection, even though there's no getSize()
> method?


There is EL syntax for calling static methods, but not instance methods like
List.size().

Cheers,
> -Josh


Craig


Re: Struts JSTL & EL

2006-01-19 Thread Michael Jouravlev
On 1/19/06, Josh McDonald <[EMAIL PROTECTED]> wrote:
> What I mean is, can you use it inside third party (and your own) tags?

Yes.

> Also, can you use it to get the result of a method that's not really a
> GETTER? Such as size() on a collection, even though there's no getSize()
> method?

No.

Michael.

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



struts/jsp security/access question

2006-01-19 Thread David Thielen
Hi;

 

I have a page admin.jsp that if a user is not an admin, they should never
see. I can make the standard way to get there be admin.do but that just
invites a hacker to type in admin.jsp, so I still have to insure that
requests for admin.jsp are redirected for non admin users.

 

Each page (jsp) and it's Action class know who is allowed in. So I would
like to handle this in one of these two places. But the only two solutions I
have come up with are:

1.  A filter with all pages and who can access them in that one class -
dangerous because a new page can get added and the developer forgets to add
it to the authorization class.
2.  We have jsp pages that just do a check and redirect if the user is
not authorized. We then include the appropiate one at the top of each jsp
page. This works great if there are a small set of authorizations (this is
what I used before - every user was one of 3 types). However, it breaks down
for more than a couple of pre-defined authorization groups.
3.  All pages are accessed via preAction -> jsp -> submitAction. The
preAction sets a session attribute to the name of the jsp. The jsp page at
the top checks this attribute and if it is not it's name, it redirects to
the home page. As a session attribute, as soon as the user goes to another
preAction, they can't go back to the previous jsp. So it forces the
pre/jsp/submit ordering. The downside to this is the back button will be
limited to the jsp page that the global attribute is set to, not going back
further.

 

Any other approaches?

 

Thanks - dave

 

 

David Thielen

www.windwardreports.com

303-499-2544

 



Re: Struts JSTL & EL

2006-01-19 Thread Josh McDonald
What I mean is, can you use it inside third party (and your own) tags?
Also, can you use it to get the result of a method that's not really a
GETTER? Such as size() on a collection, even though there's no getSize()
method?
 
Cheers,
-Josh
 
-- 
 
"His comrades fought beside him, Van Owen and the rest...
   But of all the thompson gunners- Roland was the best."
 
Josh McDonald
Analyst Programmer
Information Technology
Ph: 61 7 3006 6460
Email: [EMAIL PROTECTED]


>>> [EMAIL PROTECTED] 20/01/2006 12:12:53 am >>>

Josh McDonald wrote:
> Servlet 2.4 lets you use EL all over the place in JSPs? That rocks
me,
> can someone please send me a link to some good examples of just how
> out-there you can get?
>   
${scopedVar}

or even...

${scopedVar.propertyName}

I think I might be misunderstanding your question.

Dave



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








***
Messages included in this e-mail and any of its attachments are those
of the author unless specifically stated to represent WorkCover Queensland. The 
contents of this message are to be used for the intended purpose only and are 
to be kept confidential at all times.
This message may contain privileged information directed only to the intended 
addressee/s. Accidental receipt of this information should be deleted promptly 
and the sender notified.
This e-mail has been scanned by Sophos for known viruses.
However, no warranty nor liability is implied in this respect.




Re: Forward After response.getOutputStream

2006-01-19 Thread Mike Darretta
I think your answer suffices for this time, but my original objective 
was to:


(1) Execute a download of an output stream for a file built on the fly
(2) Forward to another page indicating the download succeded.

Mike

P.S. Thanks for the posting advice...I thought I was posting to the 
entire list.


Laurie Harper wrote:


Mike Darretta wrote:


I posted a similar question yesterday...thought I'd try again.



Perhaps you posted that one in the middle of another thread as well? 
Make sure you post new threads as fresh messages, not replies to 
unrelated messages, to make sure they get seen by as many people as 
possible.


Is there a good way to forward a response after calling 
response.getOutputStream()? I've done a lot of web searching, and find 
the question asked many times. Yet, I've been unsuccessful (or simply 
dense) in finding a suitable answer. Any assistance is appreciated.



No, that's prohibited. Iff the response is buffered you *might* be able 
to reset the output stream and do a forward, but really the solution is 
not to write to the output stream until you know you don't need to do a 
forward.


What are you trying to achieve that's requiring this?

L.


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




--

Mike Darretta
Computer Sciences Corporation (CSC)
Sr. Software Engineer
(o) 831.656.4324
(c) 209.814.2774
[EMAIL PROTECTED]


This is a PRIVATE message. If you are not the intended recipient, please 
delete without copying and kindly advise us by e-mail of the mistake in 
delivery. NOTE: Regardless of content, this e-mail shall not operate to 
bind CSC to any order or other contract unless pursuant to explicit 
written agreement or government initiative expressly permitting the use 
of e-mail for such purpose.



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

Re: Call method before index.jsp is built?

2006-01-19 Thread Wendy Smoak
On 1/19/06, David Thielen <[EMAIL PROTECTED]> wrote:

> I thought there was a way to have an action class get called before a page
> was rendered as well as when the form was submitted. Or something like that
> - but it could be clearly tied to each jsp page.

That will happen automatically if you link to (for example) welcome.do
rather than index.jsp.  Most people force all requests to go through
an Action, either by adding a security constraint on jsp pages or
putting them under WEB-INF where the container is forbidden to serve
them directly.

Rather than try to control access to individual pages, though, I'd do
it at the Action level.  Is a user allowed to update, or only to view
the information?

> Is my memory off? (I know I had a system in some old code where each page
> did a security check when it was going to be rendered and if the user was
> not authorized, forwarded them to the home page.)

Sounds reasonable to me.

--
Wendy

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



RE: Call method before index.jsp is built?

2006-01-19 Thread David Thielen
Hi;

I thought there was a way to have an action class get called before a page
was rendered as well as when the form was submitted. Or something like that
- but it could be clearly tied to each jsp page. 

Is my memory off? (I know I had a system in some old code where each page
did a security check when it was going to be rendered and if the user was
not authorized, forwarded them to the home page.)

Thanks - dave

 
David Thielen
www.windwardreports.com
303-499-2544
-Original Message-
From: Wendy Smoak [mailto:[EMAIL PROTECTED] 
Sent: Thursday, January 19, 2006 1:42 PM
To: Struts Users Mailing List
Subject: Re: Call method before index.jsp is built?

On 1/19/06, David Thielen <[EMAIL PROTECTED]> wrote:

> I am 99% positive this is doable, but I can't find it anywhere. How do I
get
> a method called before a page is built - and very specifically before the
> very first page (index.jsp) is displayed to a user? I want to see if we
have
> a cookie that identifies them and if so, put their name in index.jsp.

You can use a Filter.
   http://java.sun.com/products/servlet/Filters.html

--
Wendy

-
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: Call method before index.jsp is built?

2006-01-19 Thread Wendy Smoak
On 1/19/06, David Thielen <[EMAIL PROTECTED]> wrote:

> I am 99% positive this is doable, but I can't find it anywhere. How do I get
> a method called before a page is built - and very specifically before the
> very first page (index.jsp) is displayed to a user? I want to see if we have
> a cookie that identifies them and if so, put their name in index.jsp.

You can use a Filter.
   http://java.sun.com/products/servlet/Filters.html

--
Wendy

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



Call method before index.jsp is built?

2006-01-19 Thread David Thielen
Hi;

 

I am 99% positive this is doable, but I can't find it anywhere. How do I get
a method called before a page is built - and very specifically before the
very first page (index.jsp) is displayed to a user? I want to see if we have
a cookie that identifies them and if so, put their name in index.jsp.

 

Thanks - dave

 

 

 

David Thielen

www.windwardreports.com

303-499-2544

 



Re: Be Careful though: was Re: Struts JSTL & EL

2006-01-19 Thread Rick Reumann

Rahul Akolkar wrote the following on 1/19/2006 3:30 PM:


For such concerns ...

${fn:escapeXml(test)}

is an option.

 is overrated in JSP >= 2.0, IMO.


Just curious why is ${fn:escapeXml(test)} any better than value='${test}'/> ?


--
Rick

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



Re: Generating dropdown lists using html tag

2006-01-19 Thread Rick Reumann

Garner, Shawn wrote the following on 1/19/2006 1:38 PM:

Isn't there an options tag that takes in a collection?


Yes there is html:options and there is also html:optionsCollection


Wouldn't that be more optimized and easier?


It's just saves a little extra typing (I doubt any more 'optimized'), 
but I just never liked either tag that much. To me neither tag seemed 
that intuitive (html:optionsCollection is easier imo) so I just code two 
extra lines to make my forEach loop and build the options myself.


Here are the docs on the tags:

http://struts.apache.org/struts-taglib/tagreference-struts-html.html#html:options 



http://struts.apache.org/struts-taglib/tagreference-struts-html.html#html:optionsCollection

--
Rick

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



Re: FW: Indexed properties

2006-01-19 Thread Laurie Harper

Vidya (Suvarna) Mahavadi wrote:

Hi,

I am currently working on an application which uses Indexed properties.
And I am not able to update the indexed bean properties properly. I have
included some code snippets here.. The problem is when the check box on
the jsp is checked it update correctly, but when the check box is uncked
and saved it fails to update the bean property. Any help on this much
appreciated.


Are you clearing the bean properties for the checkboxes to 'false' in 
your form's reset() method?


http://struts.apache.org/struts-doc-1.2.x/userGuide/struts-html.html#checkbox

L.



 


Thanks,

Vidya

 


Action form has a Collection of bean objects like this.

 


public class NotificationsActionForm extends ActionForm {

 


private List notifications = new ArrayList();

 


//get and set methods are included in the code

 


public NotificationBean getNotification(int index) {

return (NotificationBean) notifications.get(index);

}

}

 


And the bean class looks like this..

 


public class NotificationBean {

private String name;

private int notificationId;

private boolean print;

private boolean email;

private boolean sms;

 

// get and set methods included in the code 


}

 


In my jsp I am using check boxes for the Boolean variables. JSP code
looks like this..

 




  



  Id

  Name

  Email

  Print

  SMS





  



  





  





  





  





  



  





  



  




This message and any attachments are confidential and intended solely for the 
addressee. If you have received this message in error, please notify Discovery 
immediately, telephone number +27 11 529 2888. Any unauthorised use; alteration 
or dissemination of the contents of this email is strictly prohibited. In no 
event will Discovery or the sender be liable in any manner whatsoever to any 
person for any loss or any direct, indirect, special or consequential damages 
arising from use of this email or any linked website, including, without 
limitation, from any lost profits, business interruption, loss of programmes or 
other data that may be stored on any information handling system or otherwise 
from any assurance that this email is virus free even if Discovery is expressly 
advised of the possibility of such damages. Discovery is an Authorised 
Financial Services Provider.




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



Re: Be Careful though: was Re: Struts JSTL & EL

2006-01-19 Thread Rahul Akolkar
On 1/19/06, Rick Reumann <[EMAIL PROTECTED]> wrote:
> Josh McDonald wrote the following on 1/18/2006 5:29 PM:
> > Servlet 2.4 lets you use EL all over the place in JSPs? That rocks me,
> > can someone please send me a link to some good examples of just how
> > out-there you can get?
>
> Just remember to consider using c:out vs just the straight EL ${}...
>


For such concerns ...

${fn:escapeXml(test)}

is an option.

 is overrated in JSP >= 2.0, IMO.

The one place it is useful is to ensure well-formedness in jspx files.
jspx/tagx files are revolutionary in concept, and a step in the right
direction, though I doubt many folks use them extensively.

-Rahul


> Craig brought this up a while ago and I wasn't even aware of the
> concerns. For outputting text you should be careful of just using
> ${someVar} vsBy default c:out will escape
> the characters so that what is inputted for someVal will show up. Just
> using ${} does not escape the characters, so if you aren't careful with
> what you do on the backend, someone possibly could enter in a javascript
> string which will get persisted to the db, and then on a display page if
> you simply display this field using the built in EL support, you'll end
> up with Javascript executing on the page:)
>
> Try it out, do this on your page:
>
>  value="this.location='http://www.espn.com';"/>
> 
> stuf
> stuff
> ${test}
> 
>
> Then try it with
>
>  value="this.location='http://www.espn.com';"/>
> 
> stuf
> stuff
> 
> 
>
>
> --
> Rick
>

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



RE: [OT] Utility to create DDL from a database

2006-01-19 Thread George.Dinwiddie
Doesn't your database include such an export tool?  What database are
you using?

Ashish Kulkarni inquired
> Is there any open source utility which i can use to
> create DDL from an existing database, so i can use it
> to run to create tables on other database.
> This utility should be smart enough to create DDL
> statements for tables with primary key, before tables
> with foreign key.
> That way when i run the DDL to create tables on other
> database there wont be referential integrity errors.
> Is there some thing like this out in market.

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



Re: good practice in creating form beans

2006-01-19 Thread Laurie Harper

fea jabi wrote:
When creating form beans does it have to have only, which the user can 
enter information to?


In my JSP, there are fields

order date:   present order date input field (user can update 
the order date here)


Like this the JSP has about 20 fields.

Does the form bean should contain only the input fields?

so, the present order in this case should it be kept in request?


Until now I was putting all the information needed by JSP in the form 
bean itself.


After reading this
http://www.learntechnology.net/validate-manually.do

I am not sure if I was doing  the right thing.

So, would like to know the better way of doing the same.


It's a matter of choice whether you include read-only data in your form 
bean. Either approach will work. Some prefer to reserve the form bean 
for marshaling input data, others like to keep all data in one 
'container' and use the form bean for both.


L.


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



Re: Forward After response.getOutputStream

2006-01-19 Thread Laurie Harper

Mike Darretta wrote:

I posted a similar question yesterday...thought I'd try again.


Perhaps you posted that one in the middle of another thread as well? 
Make sure you post new threads as fresh messages, not replies to 
unrelated messages, to make sure they get seen by as many people as 
possible.


Is there a good way to forward a response after calling 
response.getOutputStream()? I've done a lot of web searching, and find 
the question asked many times. Yet, I've been unsuccessful (or simply 
dense) in finding a suitable answer. Any assistance is appreciated.


No, that's prohibited. Iff the response is buffered you *might* be able 
to reset the output stream and do a forward, but really the solution is 
not to write to the output stream until you know you don't need to do a 
forward.


What are you trying to achieve that's requiring this?

L.


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



Re: html:select default value in the action

2006-01-19 Thread Laurie Harper

Thibaut wrote:

Thank you for your quick reply.

I use dyna form. Therefore i have to create a new instance of the dynaform.


You should never have to do this manually. Struts will create the form 
for you provided your action mapping specifies the form name via the 
'name' attribute.



//get the parameter I want to put by default
String secteurDefault = request.getParameter("secteur");
if(secteurDefault!=null)
{
 if(form == null)
 {
   FormBeanConfig cfg = 
mapping.getModuleConfig().findFormBeanConfig("CorrespondanceForm");
   form = (CorrespondanceForm) 
DynaActionFormClass.createDynaActionFormClass(cfg).newInstance();

 }
//form = (DynaActionForm)form;
 form.set("partner_id",secteurDefault);
}

But the "form.set ..." doesn't work. Why ?


Because you've created a form object Struts knows nothing about. As I 
said above, you shouldn't need to do this. If for some reason you really 
want to, you need to put the resulting form into request or session 
scope so it's accessible from the JSP:


Second question : how do i put the form in a scope to be taken into 
account by the jsp ?


request.setAttribute("myform", form);

L.


Thibaut wrote the following on 1/19/2006 1:09 PM:


Hi,

I'd like to choose the default value of my html:select in the action 
class. What is the parameter to set ?



Set the value of the form bean property in your Action before you go 
to the form and that will be the default. Or, you could even set the 
value in the formBean itself if you know it's always going to be the 
same default value.


ie in Action:

MyForm myForm = (MyForm)form;
myForm.setPartner_id( defaultId );

in ActionForm:

int partner_id = 20; //or whatever you want it to be




Action :

   request.setAttribute("partnerslist", 
getPartnerListFromDataBase(dataSource));



JSP:

   
   labelProperty="label"/>

   






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



[OT] Utility to create DDL from a database

2006-01-19 Thread Ashish Kulkarni
Hi
Is there any open source utility which i can use to
create DDL from an existing database, so i can use it
to run to create tables on other database.
This utility should be smart enough to create DDL
statements for tables with primary key, before tables
with foreign key.
That way when i run the DDL to create tables on other
database there wont be referential integrity errors.
Is there some thing like this out in market.

Also is there a open source utility to run SQL
statemens againts database 

Ashish

__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

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



Re: [shale] ViewHandler registration

2006-01-19 Thread Laurie Harper

Craig McClanahan wrote:

On 1/19/06, Laurie Harper <[EMAIL PROTECTED]> wrote:

I have a custom ViewControllerMapper which depends on resources set up
by my ViewHandler implementation. Unfortunately, in some circumstances,
ShaleViewHandler calls the mapper before my view handler has done its
work. I think the problem is that ShaleViewHandler gets installed as a
wrapper around my view handler, rather than the other way round.

Is there anyway to control that? I'm pretty sure JSF doesn't provide a
way to do so, but was hoping this might be something Shale could help
with...


You are correct that there's no current way to control the order of view
handler initialization. For the specific case of choosing a
ViewControllerMapper instance, however, use the context init parameter
ShaleApplicationFilter.VIEW_CONTROLLER_MAPPER (the literal value is "
org.apache.shale.view.VIEW_CONTROLLER_MAPPER") to specify the fully
qualified class name.  Shale's view handler will then use your
implementation.


Yeah, the mapper registration is working fine, it's just that it needs 
resources that are initialized by the view handler, so I need my view 
handler to be the outer-most one.


I guess I'll have to work around it by accessing that data via a static 
helper method on the view handler that'll lazy-init the required 
resources if necessary.


L.


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



Forward After response.getOutputStream

2006-01-19 Thread Mike Darretta

Hi again.

I posted a similar question yesterday...thought I'd try again.

Is there a good way to forward a response after calling 
response.getOutputStream()? I've done a lot of web searching, and find 
the question asked many times. Yet, I've been unsuccessful (or simply 
dense) in finding a suitable answer. Any assistance is appreciated.


Thanks in advance!
Mike


This is a PRIVATE message. If you are not the intended recipient, please 
delete without copying and kindly advise us by e-mail of the mistake in 
delivery. NOTE: Regardless of content, this e-mail shall not operate to 
bind CSC to any order or other contract unless pursuant to explicit 
written agreement or government initiative expressly permitting the use 
of e-mail for such purpose.



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

Re: [shale] ViewHandler registration

2006-01-19 Thread Craig McClanahan
On 1/19/06, Laurie Harper <[EMAIL PROTECTED]> wrote:
>
> I have a custom ViewControllerMapper which depends on resources set up
> by my ViewHandler implementation. Unfortunately, in some circumstances,
> ShaleViewHandler calls the mapper before my view handler has done its
> work. I think the problem is that ShaleViewHandler gets installed as a
> wrapper around my view handler, rather than the other way round.
>
> Is there anyway to control that? I'm pretty sure JSF doesn't provide a
> way to do so, but was hoping this might be something Shale could help
> with...


You are correct that there's no current way to control the order of view
handler initialization. For the specific case of choosing a
ViewControllerMapper instance, however, use the context init parameter
ShaleApplicationFilter.VIEW_CONTROLLER_MAPPER (the literal value is "
org.apache.shale.view.VIEW_CONTROLLER_MAPPER") to specify the fully
qualified class name.  Shale's view handler will then use your
implementation.

L.


Craig


good practice in creating form beans

2006-01-19 Thread fea jabi
When creating form beans does it have to have only, which the user can enter 
information to?


In my JSP, there are fields

order date:   present order date input field (user can update the 
order date here)


Like this the JSP has about 20 fields.

Does the form bean should contain only the input fields?

so, the present order in this case should it be kept in request?


Until now I was putting all the information needed by JSP in the form bean 
itself.


After reading this
http://www.learntechnology.net/validate-manually.do

I am not sure if I was doing  the right thing.

So, would like to know the better way of doing the same.

Thanks.

_
Express yourself instantly with MSN Messenger! Download today - it's FREE! 
http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/



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



[shale] ViewHandler registration

2006-01-19 Thread Laurie Harper
I have a custom ViewControllerMapper which depends on resources set up 
by my ViewHandler implementation. Unfortunately, in some circumstances, 
ShaleViewHandler calls the mapper before my view handler has done its 
work. I think the problem is that ShaleViewHandler gets installed as a 
wrapper around my view handler, rather than the other way round.


Is there anyway to control that? I'm pretty sure JSF doesn't provide a 
way to do so, but was hoping this might be something Shale could help 
with...


L.


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



Re: html:select default value in the action

2006-01-19 Thread Thibaut

Thank you for your quick reply.

I use dyna form. Therefore i have to create a new instance of the dynaform.



//get the parameter I want to put by default
String secteurDefault = request.getParameter("secteur");
if(secteurDefault!=null)
{
 if(form == null)
 {
   FormBeanConfig cfg = 
mapping.getModuleConfig().findFormBeanConfig("CorrespondanceForm");
   form = (CorrespondanceForm) 
DynaActionFormClass.createDynaActionFormClass(cfg).newInstance();

 }
//form = (DynaActionForm)form;
 form.set("partner_id",secteurDefault);
}


But the "form.set ..." doesn't work. Why ?

Second question : how do i put the form in a scope to be taken into 
account by the jsp ?




Thibaut wrote the following on 1/19/2006 1:09 PM:


Hi,

I'd like to choose the default value of my html:select in the action 
class. What is the parameter to set ?



Set the value of the form bean property in your Action before you go 
to the form and that will be the default. Or, you could even set the 
value in the formBean itself if you know it's always going to be the 
same default value.


ie in Action:

MyForm myForm = (MyForm)form;
myForm.setPartner_id( defaultId );

in ActionForm:

int partner_id = 20; //or whatever you want it to be




Action :

   request.setAttribute("partnerslist", 
getPartnerListFromDataBase(dataSource));



JSP:

   
   labelProperty="label"/>

   






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



RE: Generating dropdown lists using html tag

2006-01-19 Thread Garner, Shawn
Isn't there an options tag that takes in a collection?
Wouldn't that be more optimized and easier?

Shawn

-Original Message-
From: Rick Reumann [mailto:[EMAIL PROTECTED] 
Sent: Thursday, January 19, 2006 10:16 AM
To: Struts Users Mailing List
Subject: Re: Generating dropdown lists using html tag

Gündüz Can Topal wrote the following on 1/19/2006 11:11 AM:

> 
> I got the values in a vector consists of hashmap holding id name pairs, 
> and put the vector in session in a setup action.
> 
> But couldn't manage to generate dropdown list using html tag.  How can 
> it be done?

You can probably use the html:options tag but I like JSTL with 
html:select and html:option (I'm assuming you wanted Struts select tag?)









The above assumes your key in your Map is the value you want to use and 
the value in your Map is what you want to display for the option.

-- 
Rick

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 
This email may contain confidential material. 
If you were not an intended recipient, 
Please notify the sender and delete all copies. 
We may monitor email to and from our network. 


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



[shale] Simple Clay example

2006-01-19 Thread Richard Wallace

Hello,

I'm trying to get a simple clay example up and running so that I can use 
the full html view (which is similar to facelets, correct?).


I looked at the use cases and copied the web.xml, faces-config.xml and 
clay-config.xml and stripped out anything that I didn't need, like 
Spring and dialog stuff (I'll play with that later).  So, what I'm left 
with is a pretty standard looking web.xml with the 
ShaleApplicationFilter added, a context param for 
org.apache.shale.clay.COMMON_CONFIG_FILES, and a servlet filter for the 
FacesServletFilter to be mapped to *.html files.


The clay-config.xml file is empty except for the root element 
.  The faces-config.xml is empty as well.


I've got a simple default.html page with just a single  element with 
a jsfid="commandLink".


When I deploy the webapp the logs are as follows:
Jan 19, 2006 11:27:50 AM org.apache.catalina.startup.HostConfig deployWAR
INFO: Deploying web application archive shale-test.war
Jan 19, 2006 11:27:51 AM 
org.apache.shale.clay.config.ClayConfigureListener contextInitialized

INFO: Begin loading config files.
Jan 19, 2006 11:27:51 AM 
org.apache.shale.clay.config.beans.ComponentConfigBean$WatchDog refresh
INFO: Loading file 
"file:/opt/apache-tomcat-5.5.12/webapps/shale-test/WEB-INF/lib/shale-clay-SNAPSHOT.jar!/META-INF/clay-config.xml".
Jan 19, 2006 11:27:51 AM org.apache.shale.clay.config.ClayXmlParser 
configureRules

INFO: Loading digester rules.
Jan 19, 2006 11:27:51 AM 
org.apache.shale.clay.config.beans.ComponentConfigBean$WatchDog refresh

INFO: Loading file "/localhost/shale-test/WEB-INF/clay-config.xml".
Jan 19, 2006 11:27:51 AM 
org.apache.shale.clay.config.beans.ComponentConfigBean resolveInheritance

INFO: Begin resolving inheritance @:-<
Jan 19, 2006 11:27:51 AM 
org.apache.shale.clay.config.beans.ComponentConfigBean resolveInheritance

INFO: Finding parents ?:-[
Jan 19, 2006 11:27:51 AM 
org.apache.shale.clay.config.beans.ComponentConfigBean resolveInheritance

INFO: Checking for circular inheritance %:-{
Jan 19, 2006 11:27:51 AM 
org.apache.shale.clay.config.beans.ComponentConfigBean resolveInheritance

INFO: Realizing heritage $:-<
Jan 19, 2006 11:27:51 AM 
org.apache.shale.clay.config.beans.ComponentConfigBean resolveInheritance

INFO: Inheritance resolved @:-)
Jan 19, 2006 11:27:51 AM 
org.apache.shale.clay.config.ClayConfigureListener contextInitialized

INFO: Done loading config file(s).
Jan 19, 2006 11:27:51 AM org.apache.myfaces.config.FacesConfigurator 
feedStandardConfig
INFO: Reading standard config 
org/apache/myfaces/resource/standard-faces-config.xml
Jan 19, 2006 11:27:51 AM org.apache.myfaces.config.FacesConfigurator 
feedClassloaderConfigurations
INFO: Reading config 
jar:file:/opt/apache-tomcat-5.5.12/webapps/shale-test/WEB-INF/lib/shale-clay-SNAPSHOT.jar!/META-INF/faces-config.xml
Jan 19, 2006 11:27:51 AM org.apache.myfaces.config.FacesConfigurator 
feedClassloaderConfigurations
INFO: Reading config 
jar:file:/opt/apache-tomcat-5.5.12/webapps/shale-test/WEB-INF/lib/shale-core-SNAPSHOT.jar!/META-INF/faces-config.xml
Jan 19, 2006 11:27:51 AM org.apache.myfaces.config.FacesConfigurator 
feedWebAppConfig

INFO: Reading config /WEB-INF/faces-config.xml
Jan 19, 2006 11:27:51 AM org.apache.shale.clay.faces.ClayViewHandler 
INFO: Loading Clay View Handler
Jan 19, 2006 11:27:51 AM 
org.apache.myfaces.webapp.StartupServletContextListener initFaces
INFO: ServletContext '/opt/apache-tomcat-5.5.12/webapps/shale-test/' 
initialized.

Jan 19, 2006 11:27:51 AM org.apache.shale.faces.ShaleApplicationFilter init
INFO: Initializing Shale Application Filter

When I try and access http://localhost:8080/shale-test/default.jsf (I 
changed the mapping for the servlet to be to .jsf instead of .faces), 
the following shows up in the logs and I see a big 404:


Jan 19, 2006 11:29:26 AM org.apache.shale.view.faces.ViewViewHandler 
setupViewController

WARNING: No ViewController for viewId /default.jsp found under name default

Clearly it's trying to access a .jsp instead of my .html.  What do I 
need to do to fix it?  Do I need to set the view-handler in the 
faces-config.xml to a Shale-Clay view handler?


Thanks,
Rich

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



Re: OT: Is there a very simple "MVC" for ASP 2005 w/ a tutorial? Something to show my poor friend about taking SQL out of ASP but very simple.

2006-01-19 Thread Ted Husted
http://opensource2.atlassian.com/confluence/oss/display/IBATIS/Quick+Start+Guide

-T.

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



Re: html:select default value in the action

2006-01-19 Thread Rick Reumann

Thibaut wrote the following on 1/19/2006 1:09 PM:

Hi,

I'd like to choose the default value of my html:select in the action 
class. What is the parameter to set ?


Set the value of the form bean property in your Action before you go to 
the form and that will be the default. Or, you could even set the value 
in the formBean itself if you know it's always going to be the same 
default value.


ie in Action:

MyForm myForm = (MyForm)form;
myForm.setPartner_id( defaultId );

in ActionForm:

int partner_id = 20; //or whatever you want it to be




Action :

   request.setAttribute("partnerslist", 
getPartnerListFromDataBase(dataSource));



JSP:

   
   labelProperty="label"/>

   




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



html:select default value in the action

2006-01-19 Thread Thibaut

Hi,

I'd like to choose the default value of my html:select in the action 
class. What is the parameter to set ?



Action :

   request.setAttribute("partnerslist", 
getPartnerListFromDataBase(dataSource));



JSP:

   
   labelProperty="label"/>

   



Thanks.

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



Re: Be Careful though: was Re: Struts JSTL & EL

2006-01-19 Thread Craig McClanahan
On 1/19/06, Rick Reumann <[EMAIL PROTECTED]> wrote:
>
> Josh McDonald wrote the following on 1/18/2006 5:29 PM:
> > Servlet 2.4 lets you use EL all over the place in JSPs? That rocks me,
> > can someone please send me a link to some good examples of just how
> > out-there you can get?
>
> Just remember to consider using c:out vs just the straight EL ${}...


This is definitely a valid concern.  But using JSP 2.0 lets you use EL
expressions for the attributes of *any* JSP custom tag, not just the tags
that know about them.  And this is still quite valuable.

Craig

Craig brought this up a while ago and I wasn't even aware of the
> concerns. For outputting text you should be careful of just using
> ${someVar} vsBy default c:out will escape
> the characters so that what is inputted for someVal will show up. Just
> using ${} does not escape the characters, so if you aren't careful with
> what you do on the backend, someone possibly could enter in a javascript
> string which will get persisted to the db, and then on a display page if
> you simply display this field using the built in EL support, you'll end
> up with Javascript executing on the page:)
>
> Try it out, do this on your page:
>
>  value="this.location='http://www.espn.com';"/>
> 
> stuf
> stuff
> ${test}
> 
>
> Then try it with
>
>  value="this.location='http://www.espn.com';"/>
> 
> stuf
> stuff
> 
> 
>
>
> --
> Rick
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


Re: Struts creates its own session object?

2006-01-19 Thread Craig McClanahan
On 1/19/06, Martin Morawetz <[EMAIL PROTECTED]> wrote:
>
> Hi,
>
> We have two web applications, a Struts-application
> and a strutsless application.
>
> Both web applications have to use the same session.


This is not possible, either with or without Struts.  The servlet
specification requires that the sessions for each web application be
independent of each other.

When you think about this a little, it is easy to understand the reasons for
this restriction.  The most important one is that the classes visible to
each application are different, because each app loads its own
WEB-INF/classes and WEB-INF/lib directories.  Therefore, even if the session
object were shared, a session attribute stored by webapp A might not be
usable by webapp B, simply because webapp B cannot see the class for that
object since it exists only in webapp A.

You will need to use a strategy other than sharing sessions to share
information between these two apps.

Craig


Re: Database Access

2006-01-19 Thread Larry Meadors
Interesting note: iBATIS was in the top 3 for JDJ's "Best Java
Persistence Architecture".

http://jdj.sys-con.com/read/171303_3.htm

Larry


On 1/19/06, Rick Reumann <[EMAIL PROTECTED]> wrote:
> Asad Habib wrote the following on 1/19/2006 10:10 AM:
> > What are the different ways in designing the persistence layer so that
> > it works with a Struts application?
>
> Most either recommend Hibernate or iBATIS. I like iBATIS. I have a
> lesson on it using it with Struts that should be pretty easy to follow:
> http://www.learntechnology.net/struts-spring-ibatis.do
>
> > I am looking for a simple way to
> > access a database. Should I use hibernate?
>
> I think iBATIS is easier to get setup with. Give it a try.
>
> --
> Rick
>
> -
> 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] Re: Database Access

2006-01-19 Thread Frank W. Zammetti
I third the suggestion  :)  But, I would look at the Spring JDBC package. 
If your going to do naked JDBC, they can make your life a lot easier.  I
would be using it now myself, except...

I have over the course of a few projects developed four classes that I've
used often when I couldn't really justify Hibernate or even iBatis.  One
is a database connection manager class that all JDBC classes go through. 
It deals with getting a connection (either created on-the-fly or from
JNDI), errors, transactions, etc.  I've also developed two other classes
that allow the ability to externalize all my queries... I do a simple
getQuery(queryID) call and I get back the query, which I can then do
parameter replacements on (just like a prepared statement, but it's not),
and send it off to the manager to execute. The fourth class is a
disconnected ResultSet object that is very handy (and tends to make the
application more efficient overall).

The reason I'm mentioning these things is that they are not that big a
deal for most people to develop, and if you wrote them they would evolve
over time and really make your life easier (probably 90% of them were
written over the course of two days during one project, then they got
tweaked sligthly during a few other projects).  I usually wouldn't
recommend doing something like this yourself, but it is a great learning
experience, and you wind up getting exactly what you need in the end, so
it may well be worth it.

In any case, don't dismiss JDBC out-of-hand, as many people seem to do
these days.  You *do* want to look at the alternatives of course, but done
correctly, JDBC can be a very good friend.

-- 
Frank W. Zammetti
Founder and Chief Software Architect
Omnytex Technologies
http://www.omnytex.com
AIM: fzammetti
Yahoo: fzammetti
MSN: [EMAIL PROTECTED]

On Thu, January 19, 2006 12:12 pm, [EMAIL PROTECTED] said:
> I second the suggestion to start with JDBC.  I've written a simple
> JdbcReader and JdbcWriter that I use within a DAO for accessing the
> database.  You can find it at
> http://idiacomputing.com/moin/JdbcPersistence
>
>  - George
>
>> -Original Message-
>> From: [EMAIL PROTECTED]
>> [mailto:[EMAIL PROTECTED]
>> Sent: Thursday, January 19, 2006 10:17 AM
>> To: Struts Users Mailing List
>> Subject: [OT] Re: Database Access
>>
>>
>> It appears that you're still a student and you've asked for a
>> "...simple
>> way to access a database."
>>
>> My suggestion, start with JDBC.  From there, you can
>> investigate other
>> options including, but not limited to, DbUtils, iBatis,
>> Hibernate, EJB
>> entity beans, etc.
>>
>> Scott Ambler has a nice article you might be interested in:
>> http://www.ambysoft.com/essays/persistenceLayer.html
>>
>> -Dennis
>>
>>
>>
>>
>> Asad Habib <[EMAIL PROTECTED]>
>> 01/19/2006 10:10 AM
>> Please respond to
>> "Struts Users Mailing List" 
>>
>>
>> To
>> user@struts.apache.org
>> cc
>>
>> Subject
>> Database Access
>>
>>
>>
>>
>>
>>
>> What are the different ways in designing the persistence
>> layer so that it
>> works with a Struts application? I am looking for a simple
>> way to access a
>>
>> database. Should I use hibernate? Are there any articles online that
>> discuss these alternatives and their tradeoffs? Thanks.
>>
>> - Asad
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


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



OT: Is there a very simple "MVC" for ASP 2005 w/ a tutorial? Something to show my poor friend about taking SQL out of ASP but very simple.

2006-01-19 Thread netsql

tia,
.V


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



RE: [OT] Re: Database Access

2006-01-19 Thread George.Dinwiddie
I second the suggestion to start with JDBC.  I've written a simple
JdbcReader and JdbcWriter that I use within a DAO for accessing the
database.  You can find it at
http://idiacomputing.com/moin/JdbcPersistence

 - George

> -Original Message-
> From: [EMAIL PROTECTED] 
> [mailto:[EMAIL PROTECTED] 
> Sent: Thursday, January 19, 2006 10:17 AM
> To: Struts Users Mailing List
> Subject: [OT] Re: Database Access
> 
> 
> It appears that you're still a student and you've asked for a 
> "...simple 
> way to access a database."
> 
> My suggestion, start with JDBC.  From there, you can 
> investigate other 
> options including, but not limited to, DbUtils, iBatis, 
> Hibernate, EJB 
> entity beans, etc.
> 
> Scott Ambler has a nice article you might be interested in: 
> http://www.ambysoft.com/essays/persistenceLayer.html
> 
> -Dennis
> 
> 
> 
> 
> Asad Habib <[EMAIL PROTECTED]> 
> 01/19/2006 10:10 AM
> Please respond to
> "Struts Users Mailing List" 
> 
> 
> To
> user@struts.apache.org
> cc
> 
> Subject
> Database Access
> 
> 
> 
> 
> 
> 
> What are the different ways in designing the persistence 
> layer so that it 
> works with a Struts application? I am looking for a simple 
> way to access a 
> 
> database. Should I use hibernate? Are there any articles online that 
> discuss these alternatives and their tradeoffs? Thanks.
> 
> - Asad

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



Thread on JSF.... and a podcast, in case you like to try a pod cast

2006-01-19 Thread netsql

For those that are not tired of framework wars:
http://www.theserverside.com/news/thread.tss?thread_id=38601


I think Shale can be used w/ different view layer, ex: Wicket. I also 
think Shale WAR can be done in Groovy (it makes class files). That would 
be a good combo for the "old" browser tech. (I do only RiA now, I am no 
longer a webmaster.)



OT: Is there a very simple "MVC" for ASP w/ a tutorial? Something to 
show my poor friend about taking SQL out of ASP.


.V


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



Re: Generating dropdown lists using html tag

2006-01-19 Thread Rick Reumann

Gündüz Can Topal wrote the following on 1/19/2006 11:11 AM:



I got the values in a vector consists of hashmap holding id name pairs, 
and put the vector in session in a setup action.


But couldn't manage to generate dropdown list using html tag.  How can 
it be done?


You can probably use the html:options tag but I like JSTL with 
html:select and html:option (I'm assuming you wanted Struts select tag?)










The above assumes your key in your Map is the value you want to use and 
the value in your Map is what you want to display for the option.


--
Rick

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



Generating dropdown lists using html tag

2006-01-19 Thread Gündüz Can Topal

Hi,

I want to generate a dropdown list of cities holding their ids in value 
atrribute.


html should look like


   city a
   .
   .
  .


I got the values in a vector consists of hashmap holding id name pairs, 
and put the vector in session in a setup action.


But couldn't manage to generate dropdown list using html tag.  How can 
it be done?


Do you have a better design pattern in mind?




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



[OT] Re: Database Access

2006-01-19 Thread DGraham
It appears that you're still a student and you've asked for a "...simple 
way to access a database."

My suggestion, start with JDBC.  From there, you can investigate other 
options including, but not limited to, DbUtils, iBatis, Hibernate, EJB 
entity beans, etc.

Scott Ambler has a nice article you might be interested in: 
http://www.ambysoft.com/essays/persistenceLayer.html

-Dennis




Asad Habib <[EMAIL PROTECTED]> 
01/19/2006 10:10 AM
Please respond to
"Struts Users Mailing List" 


To
user@struts.apache.org
cc

Subject
Database Access






What are the different ways in designing the persistence layer so that it 
works with a Struts application? I am looking for a simple way to access a 

database. Should I use hibernate? Are there any articles online that 
discuss these alternatives and their tradeoffs? Thanks.

- Asad

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




Re: Database Access

2006-01-19 Thread Rick Reumann

Asad Habib wrote the following on 1/19/2006 10:10 AM:
What are the different ways in designing the persistence layer so that 
it works with a Struts application? 


Most either recommend Hibernate or iBATIS. I like iBATIS. I have a 
lesson on it using it with Struts that should be pretty easy to follow:

http://www.learntechnology.net/struts-spring-ibatis.do

I am looking for a simple way to 
access a database. Should I use hibernate? 


I think iBATIS is easier to get setup with. Give it a try.

--
Rick

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



Database Access

2006-01-19 Thread Asad Habib
What are the different ways in designing the persistence layer so that it 
works with a Struts application? I am looking for a simple way to access a 
database. Should I use hibernate? Are there any articles online that 
discuss these alternatives and their tradeoffs? Thanks.


- Asad

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



Be Careful though: was Re: Struts JSTL & EL

2006-01-19 Thread Rick Reumann

Josh McDonald wrote the following on 1/18/2006 5:29 PM:

Servlet 2.4 lets you use EL all over the place in JSPs? That rocks me,
can someone please send me a link to some good examples of just how
out-there you can get?


Just remember to consider using c:out vs just the straight EL ${}...

Craig brought this up a while ago and I wasn't even aware of the 
concerns. For outputting text you should be careful of just using 
${someVar} vsBy default c:out will escape 
the characters so that what is inputted for someVal will show up. Just 
using ${} does not escape the characters, so if you aren't careful with 
what you do on the backend, someone possibly could enter in a javascript 
string which will get persisted to the db, and then on a display page if 
you simply display this field using the built in EL support, you'll end 
up with Javascript executing on the page:)


Try it out, do this on your page:

value="this.location='http://www.espn.com';"/>


stuf
stuff
${test}


Then try it with

value="this.location='http://www.espn.com';"/>


stuf
stuff




--
Rick

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



Struts creates its own session object?

2006-01-19 Thread Martin Morawetz

Hi,

We have two web applications, a Struts-application
and a strutsless application.

Both web applications have to use the same session.

It appears that both apps do have a session with
the same id, but the session-objects are different
and so all the attributes the two session-objects
contain.
These session-objects exist at the same time.

Does Struts provide it's own session object? And
if so how can I share the session between the
two apps? I depend on the objects stored in the
session of the strutsless app.

As it may be important to the problem:
These two web applications run on two different
subdomains of our domain. To be able to use the same
session for both applications we specified a cookie
domain (Feature of the Resin Servlet-Engine).
This feature works fine except for the strutspowered
app.

--
Regards

Martin

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



[OT] Re: No action instance for path /userRegistration could be created ?

2006-01-19 Thread Dave Newton
Harish Pathak wrote:
> java.lang.ClassNotFoundException: multipleform.UserRegistrationForm
Where are you deploying your class files to? They should be in either
/WEB-INF/classes (in standard package/directory hierarchy) or in a JAR
in /WEB-INF/lib.

Dave



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



Re: Struts JSTL & EL

2006-01-19 Thread Dave Newton
Josh McDonald wrote:
> Servlet 2.4 lets you use EL all over the place in JSPs? That rocks me,
> can someone please send me a link to some good examples of just how
> out-there you can get?
>   
${scopedVar}

or even...

${scopedVar.propertyName}

I think I might be misunderstanding your question.

Dave



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



Re: Urgent help needed

2006-01-19 Thread Ganesh K
Hi,
 You can use this attribute in  the  tag

**


Thanks,
K.Ganesh


RE: menu system in front of a J2EE application

2006-01-19 Thread Marco Mistroni
Hello
Not sure if you could..
An idea would be to use AOP and instead of loading the menu from
The menu-config.xml you could load it from your database

That could be a possibility, since afaik the menu is always
Contained within MenuLoader (or something like that),so it's not read
>From menu-config.xml all the time

I guess the author (Matt Raible) would know better

Regards
marco


-Original Message-
From: news [mailto:[EMAIL PROTECTED] On Behalf Of Danny Lee
Sent: 19 January 2006 11:09
To: user@struts.apache.org
Subject: Re: menu system in front of a J2EE application

You can use Struts-Menu, it's sure is a good thing.
The only issue is, that you can't generate the first menu level 
dynamically (or it's not easy).

So if you wan't to have something like:

Group 1
   - Project 1
   - Project 2
   - Project 3
Group 2
   - Project 1
   - Project 2
 - subproject 1
   - Project 3

You have in mind, that you have to put the Groups in JSP, but
you can build the rest of the structure dynamically using DB or
some other information source.

Or if you don't need any automation, you just use XML, like described in 
the S-Menu docs. That's real easy.

BTW Guys if someone of you knows how to build the first menu level
from the DB too, please write me!!! :)))

Cheers,

Danny


-
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: menu system in front of a J2EE application

2006-01-19 Thread Danny Lee

You can use Struts-Menu, it's sure is a good thing.
The only issue is, that you can't generate the first menu level 
dynamically (or it's not easy).


So if you wan't to have something like:

Group 1
  - Project 1
  - Project 2
  - Project 3
Group 2
  - Project 1
  - Project 2
- subproject 1
  - Project 3

You have in mind, that you have to put the Groups in JSP, but
you can build the rest of the structure dynamically using DB or
some other information source.

Or if you don't need any automation, you just use XML, like described in 
the S-Menu docs. That's real easy.


BTW Guys if someone of you knows how to build the first menu level
from the DB too, please write me!!! :)))

Cheers,

Danny


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



AW: Urgent help needed

2006-01-19 Thread Eickvonder Bjoern
Hi,

as you are posting this on struts list I suppose you want to do something on 
the server If the user closes its browser, something like storing his logout 
time?
Though you might be able to do some cleaning operation on the client (via 
onunload and such methods) for some browsers, it might be even more difficult 
to send a message to the server during this cleanup. 
So what can you do? You could catch the invalidation of the session after its 
timeout (see HttpSession*Listener interfaces). But obviously if you for example 
have a login-mechanism that prevents a user to login twice and a user closes 
its browser he can't login til his session has reached timeout.

Bjoern

> -Ursprüngliche Nachricht-
> Von: Meenakshi Singh [mailto:[EMAIL PROTECTED] 
> Gesendet: Donnerstag, 19. Januar 2006 07:12
> An: Struts Users Mailing List (E-mail)
> Betreff: Urgent help needed
> 
> Hi,
> 
> 
> Can anybody tell me how can I detect the browser's close 
> button. & which works across all browsers.
> I have a requirement wherein I have to perform some steps if 
> the browser window is closed.
> 
> Some code example would be appreciated.
> 
> Please help me it's urgent.
> Thanks & Regards,
> Meenakshi.
> 
> 

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



Re: Re: file download problem

2006-01-19 Thread Dakota Jack
I'll have to look at this more closely later.  I have no trouble with
microsoft docs.

On 1/18/06, temp temp <[EMAIL PROTECTED]> wrote:
>
> I tried   content type as application/msword   but it did not help .Any
> other  ways to solve this problem?
> thanks & regards
>
>
> Note: forwarded message attached.
>
> --
> Yahoo! Photos
> Got holiday prints? See all the 
> waysto
>  get quality prints in your hands ASAP.
>
>
>
> -- Forwarded message --
> From: Dakota Jack <[EMAIL PROTECTED]>
> To: Struts Users Mailing List 
> Date: Wed, 18 Jan 2006 07:35:39 -0800
> Subject: Re: file download problem
> Just a thought.  Isn't there a specific content type for .doc
> documents?  That might solve your problem.I looked it up.  .doc
> documents are "application/msword".  Try that and see what happens.  I
> am actually building a list of all the extensions and their content
> types.  Hope this helps.
>
> On 1/18/06, temp temp <[EMAIL PROTECTED]> wrote:
> >  I am using struts action class to download a file .
> >
> >
> >   Here is the action class
> >
> >   public ActionForward execute(ActionMapping aActionMapping,
> ActionForm aActionForm,
> >HttpServletRequest aHttpServletRequest,
> HttpServletResponse  aHttpServletResponse)
> >   throws Exception {
> >
> >   aHttpServletResponse.setContentType
> ("application/octet-stream");
> >   aHttpServletResponse.setHeader("pragma", "no-cache");
> >   aHttpServletResponse.setHeader("Cache-Control","cache");
> >   aHttpServletResponse.setHeader
> ("Cache-Control","must-revalidate");
> >
> >   Integer aSysAttachId = new Integer(
> aHttpServletRequest.getParameter(IWeb.SYS_ATTACH_ID));
> >aHttpServletResponse.setHeader("Content-Disposition",
> "attachment;  filename=\"" +aHttpServletRequest.getParameter(
> IWeb.FILE_NAME)+ "\"");
> >download(
> aApplicationInfoDelegate.getApplicationAttachemntFile
> (aSysAttachId),aHttpServletResponse);
> >   return null;
> >   }
> >
> >   private void download(byte[] byteArray, HttpServletResponse
> httpServletResponse)
> >   throws IOException, SQLException {
> >   try {
> >BufferedOutputStream aBufferedOutputStream =new
>  BufferedOutputStream(httpServletResponse.getOutputStream());
> >   aBufferedOutputStream.write(byteArray,0,byteArray.length);
> >   aBufferedOutputStream.close();
> >   } catch (Exception e) {
> >   throw new IllegalArgumentException(e.getMessage());
> >   }
> >   }
> >
> >   My problem is  with all ".doc "files and some  ".pdf" files  .When
>  user clicks on the link , the browser opens a dialog box  with the option
> to save or open the file   .Suppose he has  choosen a ".doc"  file  to open
> , the browser opens micorsoft  word with an error message
> >
> >   Word experienced an error tying open the file.
> >   Try these suggestions.
> >   * Chaeck the file permissions for the document or drive.
> >   * Make sure there is sufficient free memory and disk space
> >   * Open the file with the text Recovery converter.
> >
> >
> >   I also had other files  like .xls and lot of .pdf and there is no
> problem with these files  but with all .doc files.
> >   Can Somebody guide with this issue.
> >   Thanks & Regards
> >
> >
> >
> >
> >
> > -
> > Yahoo! Photos
> >  Ring in the New Year with Photo Calendars. Add photos, events,
> holidays, whatever.
> >
>
>
> --
> "You can lead a horse to water but you cannot make it float on its back."
> ~Dakota Jack~
>
> -
> 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]
>
>


--
"You can lead a horse to water but you cannot make it float on its back."
~Dakota Jack~


No action instance for path /userRegistration could be created ?

2006-01-19 Thread Harish Pathak
Hi,
   
  Well I am getting the following error while running my first struts 
application..
   
  url is :
   
  http://localhost/userRegistration.do
   
  ---
  No action instance for path /userRegistration could be created ?
  ---
   
stack trace is as:
  
  Jan 19, 2006 2:31:18 PM org.apache.struts.util.RequestUtils createActionForm
SEVERE: Error creating form bean of class multipleform.UserRegistrationForm
java.lang.ClassNotFoundException: multipleform.UserRegistrationForm
at com.evermind._as.findClass(.:417)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at com.evermind._ib.loadClass(.:19)
at java.lang.ClassLoader.loadClass(Unknown Source)
at org.apache.struts.util.RequestUtils.applicationClass(RequestUtils.ja
a:207)
at org.apache.struts.util.RequestUtils.applicationInstance(RequestUtils
java:231)
at org.apache.struts.util.RequestUtils.createActionForm(RequestUtils.ja
a:837)
at org.apache.struts.action.RequestProcessor.processActionForm(RequestP
ocessor.java:364)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.j
va:253)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:14
2)
at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:507)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:195)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:309)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:336)
at com.evermind._cub._pod(.:521)
at com.evermind._cub._bmc(.:177)
at com.evermind._ax._ltc(.:666)
at com.evermind._ax._uab(.:191)
at com.evermind._bf.run(.:62)
Jan 19, 2006 2:31:18 PM org.apache.struts.action.RequestProcessor processAction
reate
SEVERE: No action instance for path /userRegistration could be created
java.lang.ClassNotFoundException: multipleform.UserRegistrationAction
at com.evermind._as.findClass(.:417)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at com.evermind._ib.loadClass(.:19)
at java.lang.ClassLoader.loadClass(Unknown Source)
at org.apache.struts.util.RequestUtils.applicationClass(RequestUtils.ja
a:207)
at org.apache.struts.util.RequestUtils.applicationInstance(RequestUtils
java:231)
at org.apache.struts.action.RequestProcessor.processActionCreate(Reques
Processor.java:326)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.j
va:268)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:14
2)
at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:507)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:195)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:309)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:336)
at com.evermind._cub._pod(.:521)
at com.evermind._cub._bmc(.:177)
at com.evermind._ax._ltc(.:666)
at com.evermind._ax._uab(.:191)
at com.evermind._bf.run(.:62)
   
  
   
  following are my files and configuration..
   
  struts-config.xml is as:
  --

  http://jakarta.apache.org/struts/dtds/struts-config_1_1.dtd";>
   
   
  
   
  
  
  
   
   
  
  
  
   
  
   
  
   

  --
  jsp is as:
  --
   
   
  <%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%>


User Registration


User Registration





*






*






*







*























*







*

















   
  --
   
  ActionForm and ActionServlet (java file) is placed inside "multipleform" 
directory
   
  Please look into the code and answer please.
   
  Where I am doing wrong ?
   
  Thanks
   
  Harish Pathak
   
   

   


-
Yahoo! Photos
 Got holiday prints? See all the ways to get quality prints in your hands ASAP.

Re: Urgent help needed

2006-01-19 Thread Aldo Vadillo Batista
I tried to do this many times but I couldn't. I look for information
in the web but I think there's no possible solution.

2006/1/19, [EMAIL PROTECTED] <[EMAIL PROTECTED]>:
> Hi
> Window.onclose works with only IE. However, you can try unload  event.
>
> Refer the code snippet below
> function onClose()
> {
>
> alert("Warning. You are closing the app!")
> //do cleanup operations
>
> }
>
> window.onunload=onClose
>
>
> Kind regards,
>
> Rakesh Bhat
> PrimeSourcing(tm)
> The Global IT Services  business from i-flex - "Add Value Reduce Risk"
> www.iflexsolutions.com/services/services.asp
> i-flex solutions limited - Bangalore
> Phone : +91(080) 5759-6873
> Email :  Rakesh.Bhat@ iflexsolutions.com
>
>
> -Original Message-
> From: Meenakshi Singh [mailto:[EMAIL PROTECTED]
> Sent: Thursday, January 19, 2006 11:42 AM
> To: Struts Users Mailing List (E-mail)
> Subject: Urgent help needed
>
> Hi,
>
>
> Can anybody tell me how can I detect the browser's close button. & which
> works across all browsers.
> I have a requirement wherein I have to perform some steps if the browser
> window is closed.
>
> Some code example would be appreciated.
>
> Please help me it's urgent.
> Thanks & Regards,
> Meenakshi.
>
>
> -
> 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: Modal window

2006-01-19 Thread Aldo Vadillo Batista
There's another problem related to the modal window: it not permits
submitting there.
You have to create an artifact to make this (put a frame inside the
modal window and put the original page to display inside the frame).

2006/1/18, Frank W. Zammetti <[EMAIL PROTECTED]>:
> FYI, there are some important details about this, should you decide to use
> it...
>
> * This is different than using window.open() in that the child window has
> no relationship to the parent, i.e., you can't script from one to the
> other in either direction.  The only exception is that you can do
> window.returnValue in the child, and this value will be the return value
> of the call to showModalDialog().
>
> * You can pass parameters to the child via the second parameter to
> showModalDialog().  It can a string, array, etc.  Actually, I suppose you
> could pass window to it and be able to script against that and get around
> that first rule, but I'm not sure about that.  In any case, the parameters
> will be exposed in the child via window.dialogArguments.
>
> * The third parameter are various feature settings of the window.  They
> include center (yes}no), dialogheight, dialogLeft, dialogTop, dialogWidth,
> edge (raised|sunken), help (yes|no), resizable (yes|no) and status
> (yes|no).
>
> * There is a corresponding showModelessDialog() method, just for
> completeness.
>
> --
> Frank W. Zammetti
> Founder and Chief Software Architect
> Omnytex Technologies
> http://www.omnytex.com
> AIM: fzammetti
> Yahoo: fzammetti
> MSN: [EMAIL PROTECTED]
>
> On Wed, January 18, 2006 12:18 pm, Frank W. Zammetti said:
> > Hi Rafael,
> >
> > You can do this via scripting, but it is unfortunately AFAIK an IE-only
> > trick...
> >
> > window.showModalDialog("http://www.google.com","","dialogWidth:500px;dialogHeight:500px";);
> >
> > --
> > Frank W. Zammetti
> > Founder and Chief Software Architect
> > Omnytex Technologies
> > http://www.omnytex.com
> > AIM: fzammetti
> > Yahoo: fzammetti
> > MSN: [EMAIL PROTECTED]
> >
> > On Wed, January 18, 2006 12:05 pm, Rafael Taboada said:
> >> Hi folks. I have my app where a jsp calls another jsp.. "mother" jsp
> >> calls
> >> a
> >> "son" jsp where the user can modify some settings..
> >>
> >> I need the user can't use "mother" jsp till "son" jsp is closed...
> >> Something
> >> like modal and nomodal window..
> >>
> >> Could u know kow I can do that?.. any code?
> >>
> >> Thanks in advance
> >>
> >> --
> >> Rafael Taboada
> >> Software Engineer
> >>
> >> Cell : +511-97753290
> >>
> >> "No creo en el destino pues no me gusta tener la idea de controlar mi
> >> vida"
> >>
> >
> >
> > -
> > 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: file upload via struts

2006-01-19 Thread Vikrama Sanjeeva
Hi,

 Good and complete example is here:

http://www.roseindia.net/struts/strutsfileupload.shtml

and check this too:
http://saloon.javaranch.com/cgi-bin/ubb/ultimatebb.cgi?ubb=next_topic&f=58&t=006647&go=older

At the end of the day, you need to code Java I/O for file (s) manipulation.
If you read the 1st link, then can use this piece of code for saving file.

***
   public void saveFile(InputStream in, File dst)throws IOException {

   // dst: is a destination variable; where u r going to write file
which is lready created on server.
// in: is an inputStream of the source file that is, file from
where u will copy the contents to dst. InputStream will be open on clients
file on his machine.

OutputStream out = new FileOutputStream(dst);

// Transfer bytes from in to out
byte[] buf = new byte[1024];
int len;
while ((len = in.read(buf)) > 0) {
System.out.println("writing to file and len = "+ len);
out.write(buf, 0, len);
}
in.close();
out.close();
}

***

Hope it helps.

Bye,
Viki.


On 1/19/06, Niall Pemberton <[EMAIL PROTECTED]> wrote:
>
> http://wiki.apache.org/struts/StrutsFileUpload
>
> Niall
>
> - Original Message -
> From: "David Thielen" <[EMAIL PROTECTED]>
> Sent: Thursday, January 19, 2006 1:32 AM
>
>
> > Hi;
> >
> > Is the best way to do this still FormFile and anyone have a url to a
> > good/correct example? (I've written tons of enterprise level java code,
> but
> > never a file upload or browse button.)
> >
> > Thanks - dave
>
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


menu system in front of a J2EE application

2006-01-19 Thread Rivka Shisman
Hi friends,

 

I need your advice about this:

 

I have a J2EE application that runs on Websphere application server.

The application contains a several web projects (WARs).

I need to implement a menu page that will be the front for all that web
projects.

 

1. Should that menu be a separate web project (WAR) in my application
and contain references to the other web projects? Or is there another
way?

2. Is struts-menu suitable for this purpose? Is it mature enough?

 

Thanks

Rivka

 


RE: Urgent help needed

2006-01-19 Thread Rakesh.Bhat
Hi 
Window.onclose works with only IE. However, you can try unload  event.

Refer the code snippet below
function onClose()
{

alert("Warning. You are closing the app!")
//do cleanup operations

}

window.onunload=onClose

 
Kind regards,
 
Rakesh Bhat 
PrimeSourcing(tm) 
The Global IT Services  business from i-flex - "Add Value Reduce Risk"
www.iflexsolutions.com/services/services.asp
i-flex solutions limited - Bangalore
Phone : +91(080) 5759-6873
Email :  Rakesh.Bhat@ iflexsolutions.com
 

-Original Message-
From: Meenakshi Singh [mailto:[EMAIL PROTECTED] 
Sent: Thursday, January 19, 2006 11:42 AM
To: Struts Users Mailing List (E-mail)
Subject: Urgent help needed

Hi,


Can anybody tell me how can I detect the browser's close button. & which
works across all browsers.
I have a requirement wherein I have to perform some steps if the browser
window is closed.

Some code example would be appreciated.

Please help me it's urgent.
Thanks & Regards,
Meenakshi.


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