RE: Need some Multibox help.

2004-01-06 Thread Tim Lucia
You most-definitely need to instantiate a bean named feature.  The
reason it "Cannot find bean feature in any scope" is because there is no
bean named feature in any scope.  In a real-world application, you would
probably do this in an action via getSession().setAttribute("feature",
new Feature(...)) or request.setAttribute(...).

Tim

> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
> Sent: Tuesday, January 06, 2004 8:17 PM
> To: Struts Users Mailing List
> Subject: Need some Multibox help.
> 
> 
> Hi everyone. 
> 
> I need some simple multibox help here.
> 
> I've gone through the example in the O Reilly book, and have 
> thoroughly torn apart the example at 
> http://j2ee.lagnada.com/struts/multibox-> example1.htm and I 
> cannot get mine to work.
> 
> The problem 
> lies in the logic:iterate's id tag.
> 
> error:  [ServletException 
> in:/WEB-INF/pages/WFSConfigContent.jsp] Cannot find bean 
> feature in any scope'
> 
> Where id="feature"
> 
> Here's my code, which is mostly copied from the OReilly book.
> 
>  property="features"> 
>   
> 
>   
> 
> 
> Is there something I have to do to instantiate a bean named 
> 'feature'? in the above example link, I can't find '_bean' 
> referenced anywhere else.
> 
> Thanks!
> 
> Richard
> 
> 
> -
> 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: NullPointerException at ActionServlet.java:1003 using JRun4; work OK under Tomcat/JWSDP1.2

2004-01-06 Thread Tim Lucia
I have solved this myself.  It appears that JRun4 considers
"tim.web.xml" as part of "web.xml", and so it tried to load a config
file that did not exist.

(Any Struts developers reading?? -- Would it be possible in a future
release of Struts to actually say "resource not found:
/WEB-INF/module/struts-config-module.xml" rather then
NullPointerException?)

Tim


> -----Original Message-
> From: Tim Lucia [mailto:[EMAIL PROTECTED] 
> Sent: Tuesday, January 06, 2004 10:00 AM
> To: 'Struts Users Mailing List'
> Subject: NullPointerException at ActionServlet.java:1003 
> using JRun4; work OK under Tomcat/JWSDP1.2
> 
> 
> All,
> 
> I have a struts application using modules which deploys fine 
> under JWSDP1.2/Tomcat (5, I think), but when I deploy it 
> under (trial edition
> of) JRun4, I get 
> 
> java.lang.NullPointerException
>   at 
> org.apache.struts.action.ACtionServlet.parseModuleConfigFile(A
> ctionServl
> et.java:1003)
> .
> .
> .
> 
> Peeking at the source, it looks like it's trying to read a 
> config file, presumably for my module.
> 
> Anyone seen this before?  How did you overcome this problem?
> 
> Thanks,
> Tim
> 
> 
> private void parseModuleConfigFile(
> String prefix,
> String paths,
> ModuleConfig config,
> Digester digester,
> String path)
> throws UnavailableException {
> 
> InputStream input = null;
> try {
> URL url = getServletContext().getResource(path);
> InputSource is = new 
> InputSource(url.toExternalForm()); // ## 1003 ###
> input = getServletContext().getResourceAsStream(path);
> is.setByteStream(input);
> digester.parse(is);
> 
> getServletContext().setAttribute(Globals.MODULE_KEY + prefix, config);
> 
> } catch (MalformedURLException e) {
> handleConfigException(paths, e);
> } catch (IOException e) {
> handleConfigException(paths, e);
> } catch (SAXException e) {
> handleConfigException(paths, e);
> } finally {
> if (input != null) {
> try {
> input.close();
> } catch (IOException e) {
> throw new UnavailableException(e.getMessage());
> }
> }
> }
> }
> 
> 
> 
> -
> 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]



NullPointerException at ActionServlet.java:1003 using JRun4; work OK under Tomcat/JWSDP1.2

2004-01-06 Thread Tim Lucia
All,

I have a struts application using modules which deploys fine under
JWSDP1.2/Tomcat (5, I think), but when I deploy it under (trial edition
of) JRun4, I get 

java.lang.NullPointerException
at
org.apache.struts.action.ACtionServlet.parseModuleConfigFile(ActionServl
et.java:1003)
.
.
.

Peeking at the source, it looks like it's trying to read a config file,
presumably for my module.

Anyone seen this before?  How did you overcome this problem?

Thanks,
Tim


private void parseModuleConfigFile(
String prefix,
String paths,
ModuleConfig config,
Digester digester,
String path)
throws UnavailableException {

InputStream input = null;
try {
URL url = getServletContext().getResource(path);
InputSource is = new InputSource(url.toExternalForm()); //
## 1003 ###
input = getServletContext().getResourceAsStream(path);
is.setByteStream(input);
digester.parse(is);
getServletContext().setAttribute(Globals.MODULE_KEY +
prefix, config);

} catch (MalformedURLException e) {
handleConfigException(paths, e);
} catch (IOException e) {
handleConfigException(paths, e);
} catch (SAXException e) {
handleConfigException(paths, e);
} finally {
if (input != null) {
try {
input.close();
} catch (IOException e) {
throw new UnavailableException(e.getMessage());
}
}
}
}



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



RE: Problem with action chaining

2004-01-02 Thread Tim Lucia
Ted,

I'm not sure how scripting will help.  The page designers (or
customizers in some cases) will have to know some scripting language,
and someone (probably me) will have to support some additional
mechanisms for the scripts to do the DAO work (design, develop, test,
...)

I dug out your book, and carefully read section 8.4 "Chaining Actions".
It says basically what you've said in this thread (good thing, eh? ;-) )
and in general I agree.  However, I still have a case where I think the
chaining is valid, and that comes when using the validator, and the
input parameter points to an Action.  Suppose I have a list of objects
in the view, and I click the edit button next to one of them.  The
resulting URI becomes something like /EditObject.do?ID=102.  The mapping
for /EditObject.do points to com.mycompany.actions.ObjectAction,
parameter="load", and the forward goes to /ObjectEditor.do, which has
validation=true, forwards to a tile, and has input="/ObjectEditor.do".
This way, the initial load of the object to be edited comes from the
DAO, and if validation fails, the validator points back to the editor
page, leaving the "incorrect" input in the form to be corrected, rather
then starting with the DAO value of the data (this way, the error
messages make more sense.)

I think my original posting may have been misleading to a degree.  I was
suggesting writing new (additional) ActionMappings to reuse existing
Action classes to create new views. 

Thanks again,
Tim

> -Original Message-
> From: Ted Husted [mailto:[EMAIL PROTECTED] 
> Sent: Thursday, January 01, 2004 2:35 PM
> To: Struts Users Mailing List
> Subject: RE: Problem with action chaining
> 
> 
> In your case, something to consider might be to use BSF 
> scripts instead of Java Actions. 
> 
> <http://struts.sourceforge.net/struts-bsf/index.html>
> 
> Another idea would be to reduce the business classes to 
> Commands (using the Command Chain of Command package) 
> <http://jakarta.apache.org/commons/sandbox/chain/>. A 
> standard Action could then be used to run one or more 
> business Commands.
> 
> Something else that has been mentioned is the idea of using 
> JSPs for Actions, but I don't know that anyone has 
> implemented anything yet. 
> 
> -Ted.
> 
> 
> On Thu, 01 Jan 2004 10:49:46 -0500, Tim Lucia wrote:
> > Ted,
> >
> >
> > Thanks for the reply.
> >
> >
> > Putting methods in the base action(s) works (since the actions are 
> > related by what attributes they add to the request or session.) The 
> > down side is that the page designer who is ignorant of Java (or may 
> > not have access to the code) can't make changes this way. 
> If I have an 
> > action to retrieve each business object and put it in the request 
> > (session) under a known key, then the page designer can chain these 
> > together to produce the objects necessary for the view.  I 
> hesitate to 
> > say that the actions are "doing actual work", other then the bare 
> > minimum - access the DAO to get a (list of) object(s) and place it 
> > (them) in a request (session) attribute.
> >
> > (Background note -- I have a requirement where there will be 
> > customizations done by field engineers at various customer 
> sites. They 
> > need to know how to move tiles around (new layouts), and understand 
> > basic struts tag libraries, and HTML [which they already know].  By 
> > chaining actions, they can use the existing .class files without us 
> > shipping the java sources and having them modified in the field.)
> >
> > Happy New Year,
> > Tim
> >
> >
> >> -Original Message-
> >> From: Ted Husted [mailto:[EMAIL PROTECTED]
> >> Sent: Wednesday, December 31, 2003 4:10 PM
> >> To: Struts Users Mailing List
> >> Subject: RE: Problem with action chaining
> >>
> >>
> >> On Wed, 31 Dec 2003 12:36:33 -0500, Tim Lucia wrote:
> >>
> >>> So is it a bad design if you have
> >>>
> >>>
> >>> Action1 -> add CollectionOfObject1 to request
> >>> Action2 -> add Object2 request
> >>>
> >>>
> >>> And then chain them together to produce two request 
> attributes?  I 
> >>> have some pages which display a list of Object1, and other
> >>>
> >> pages which
> >>> require the Collection to populate a select.  So I define
> >>>
> >> action path
> >>> 1 to be action 1 and forward to the display for the Collection of 
> >>> Object1, and define action path 2 to be action 1 forward to
> >

RE: Problem with action chaining

2004-01-01 Thread Tim Lucia
Ted,

Thanks for the reply.

Putting methods in the base action(s) works (since the actions are
related by what attributes they add to the request or session.)  The
down side is that the page designer who is ignorant of Java (or may not
have access to the code) can't make changes this way. If I have an
action to retrieve each business object and put it in the request
(session) under a known key, then the page designer can chain these
together to produce the objects necessary for the view.  I hesitate to
say that the actions are "doing actual work", other then the bare
minimum - access the DAO to get a (list of) object(s) and place it
(them) in a request (session) attribute.

(Background note -- I have a requirement where there will be
customizations done by field engineers at various customer sites.  They
need to know how to move tiles around (new layouts), and understand
basic struts tag libraries, and HTML [which they already know].  By
chaining actions, they can use the existing .class files without us
shipping the java sources and having them modified in the field.)

Happy New Year,
Tim

> -Original Message-
> From: Ted Husted [mailto:[EMAIL PROTECTED] 
> Sent: Wednesday, December 31, 2003 4:10 PM
> To: Struts Users Mailing List
> Subject: RE: Problem with action chaining
> 
> 
> On Wed, 31 Dec 2003 12:36:33 -0500, Tim Lucia wrote:
> > So is it a bad design if you have
> >
> >
> > Action1 -> add CollectionOfObject1 to request
> > Action2 -> add Object2 request
> >
> >
> > And then chain them together to produce two request attributes?  I 
> > have some pages which display a list of Object1, and other 
> pages which 
> > require the Collection to populate a select.  So I define 
> action path 
> > 1 to be action 1 and forward to the display for the Collection of 
> > Object1, and define action path 2 to be action 1 forward to 
> action 2 
> > forward to editor page which has a select of collection of 
> object 1, 
> > while editing Object2.
> 
> One common strategy is to use one action as a "page 
> controller" and another as 
> the "business transaction controller". 
> 
> The "business" action works as a go between with the business 
> API and DAO 
> objects. The Action class extracts any needed input from the 
> ActionForm and 
> packages for the API/DAO objects. If appropriate, it also 
> bundles any output and 
> places it in a servlet context, sometimes by populating an 
> ActionForm, other 
> times by creating some other bean.
> 
> The "page" action ensures that whatever assets the page needs 
> are available. 
> These may be lists for drop-down boxes and so forth. This may 
> also mean 
> interacting with the API/DAO objects, but the interaction is 
> static and driven 
> by the page display requirements, rather than what the user input..  
> 
> As mentioned, each of these actions should represent a single 
> "unit of work". 
> The business Action is an adapter for the user input. The 
> page Action is an 
> adapter for the page output. 
> 
> The core idea is that Actions are Adapters -- not the actual 
> working classes. 
> When people start chaining several actions together, it is 
> usually a signal that 
> the Actions classes are doing actual work, rather than just 
> acting as a 
> go-between with the business classes. 
> 
> The problem with Actions doing the work is that these classes 
> are bound to 
> Struts and to the HttpServlet platform. Struts Actions are 
> not easy to reuse 
> outside of Struts and are more difficult to test than POJO 
> business classes. 
> 
> Creating your own set of business API or DAO classes isn't 
> difficult. You can 
> use a PlugIn to create a instance of your classes in 
> application scope under a 
> known name and then have the Actions call them there. Just be 
> sure they are 
> thread-safe, like Actions. 
> 
> Or, depending on your circumstances, Actions can create new 
> instances of 
> business classes so you don't have to worry about 
> thread-safety. Object creates 
> are a lot cheaper than they used to be. 
> 
> If several of the page or business Action classes need to do 
> the same thing that 
> isn't business-related (create some presentation collection 
> or what-not), you 
> can put that code in a base Action that any subclass can 
> call. In that way, you 
> get code-reuse the old-fashioned way, instead of by making 
> multiple trips 
> through the HTTP layer.
> 
> HTH, Ted.
> 
> 
> 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 



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



RE: Problem with action chaining

2003-12-31 Thread Tim Lucia
So is it a bad design if you have

Action1 -> add CollectionOfObject1 to request
Action2 -> add Object2 request

And then chain them together to produce two request attributes?  I have
some pages which display a list of Object1, and other pages which
require the Collection to populate a select.  So I define action path 1
to be action 1 and forward to the display for the Collection of Object1,
and define action path 2 to be action 1 forward to action 2 forward to
editor page which has a select of collection of object 1, while editing
Object2.

Thanks,
Tim

> -Original Message-
> From: [EMAIL PROTECTED] 
> [mailto:[EMAIL PROTECTED] 
> Sent: Wednesday, December 31, 2003 4:04 AM
> To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
> Subject: RE: Problem with action chaining
> 
> 
> Hi ,
> As pointed out by Mohan, Action chainning is not a good 
> design practice... You can forward from one action to another 
> but they should eb performing completely independent units of 
> work.If two actions are used to complete only bits of work to 
> complete one logical response, then it is a bad design. There 
> is a discussion thread about action chainning in mail archive.



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



RE: Boolean checkbox in session form

2003-12-29 Thread Tim Lucia
Care to share?  This would be a very, very useful extension.

Is there any plan(s) for future Struts release(s) to support some
attribute of this sort?  Something like "forceFalse='true'" or
"forceValue='true'".

Tim

> -Original Message-
> From: Guillermo Meyer [mailto:[EMAIL PROTECTED] 
> Sent: Monday, December 29, 2003 4:40 PM
> To: 'Struts Users Mailing List'
> Subject: RE: Boolean checkbox in session form
> 
> 
> To solve this problem, i created a new taglib for checkbox 
> (extending BaseFieldTag), that creates a hidden input with a 
> value of true|false and an auxiliary checkbox (named as 
>  + _chk) with a javascript handler that checks 
> on checkbox value to set true or false to the hidden field, 
> so always is posted a true or a false value from UI and set 
> to the appropiate form attribute, and this way you can avoid 
> reseting value in reset form.
> 
> -Original Message-
> From: Franck [mailto:[EMAIL PROTECTED] 
> Sent: Lunes, 29 de Diciembre de 2003 06:13 p.m.
> To: 'Struts Users Mailing List'
> Subject: Boolean checkbox in session form
> 
> 
> Hi,
> 
> I'm becoming mad ...
> 
> Explain : to handle ActionForm boolean properties with HTML 
> checkbox, we "need" To initialize the property as "false" in 
> the reset() method of the ActionForm .. Ok
> 
> Now, if the Action form is defined in the session scope in 
> the struts-config file The first time the action is called, 
> the bean is put in session scope.
> 
> The next time (eg submit of another form on the same page), 
> the bean is readed from session scope 
> (RequestProcessor.processActionForm) ... ok After that, the 
> reset() method is called
> (RequestProcessor.processPopulate)
> 
> So it's impossible to keep the boolean property as "true" 
> 
> How can I store the form bean in the session scope with a 
> "true" boolean property ? Or maybe is there a way to not 
> initialize the boolean properties as "false" (and update them 
> with checkboxes )
> 
> Is my problem understandable ??
> 
> Thanks ...
> 
> Franck Lefebure
> equipe web http://www.orangecaraibe.com
> collaborateur http://www.synaxis-partner.com 
mailto:[EMAIL PROTECTED]
 


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



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



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



RE: Struts test cases

2003-12-19 Thread Tim Lucia
I am using it with Eclipse...  I had to do some things in setUp() to
make it work:

/*
 * @see TestCase#setUp()
 */
public void setUp() throws Exception {
super.setUp();
// STC2.0 requires the file context to be set, at least from
// Eclipse.  STC2.1.0 is supposed to fix this.
setContextDirectory(new File("ILT/"));
// Set the module to "ilt"; load ilt's config file
this.setConfigFile("ilt", "/WEB-INF/ilt/struts-config-ilt.xml");
setRequestPathInfo("ilt", "/Welcome"); // login
actionPerform();
}

Tim Lucia

> -Original Message-
> From: Ovidiu EFTIMIE [mailto:[EMAIL PROTECTED] 
> Sent: Thursday, December 18, 2003 12:05 PM
> To: Struts Users Mailing List
> Subject: Struts test cases
> 
> 
> Hi,
> Has anyone used WSAD 5.0 with StrutsTestCase 2.0 ?
> I've only succeded to make it work after several operation 
> which don't inspire me much confidence, or maybe is just me  
> taking  the hard way. Is there anyone there who used this and 
> can give me some hints?
> 
> Thanx,
> Ovidiu
> 
> PS: For anyone interested here are the steps I took to make 
> it work the way it does
> 
> [1]. in setUp() add
> setContextDirectory(new File("D:\\workspace\\strutsJunit\\jsp"));
> setConfigFile("/WEB-INF/struts-config.xml");
> [2.]Replace the  servletunit.ServletContextSimulator 
> getRessource() method content with try {
>return this.getClass().getResource(path);
>  } catch (Exception e) {
>   return null;
>  }
> [3.]execute ant to build a new strutstest-2.0.0.jar (the new 
> one has 42K) [4.]replace in the /WEB-INF/lib/ 
> strutstest-2.0.0.jar (38K) with the new one [5.]In your 
> /WEB-INF/classes/ create a directory called /WEB-INF/ and 
> copy struts-config.xml and web.xml there Run your tests
> 
> 
> -
> 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] reload servlet without restarting the application

2003-12-16 Thread Tim Lucia
You can make a simple servlet that reads the properties file and sets
the log level.  Then simply reference your simple servlet (heck, make it
an action if you want) via its URL and it will re-read and reset the
logger.

If you want to get fancy, you can event export all the properties you
find and make a form out of them, so you can enable various loggers on
the fly.

Tim


> -Original Message-
> From: Ashish Kulkarni [mailto:[EMAIL PROTECTED] 
> Sent: Tuesday, December 16, 2003 4:08 PM
> To: [EMAIL PROTECTED]
> Subject: [OT] reload servlet without restarting the application
> 
> 
> Hi
> 
> Is it possible to reload the servlet without having to
> restart the application,
> For example i have defined settings for log level in
> xml file, and i set them to show only error messages,
> suppose if i have to change it to debug, i have to
> restart my application, since the applications reads
> this log file only once when starting the application.
> I would prefer not to read the xml file after 10 sec
> or some thing like that to avoid unncessary operation,
> but rather force to read it
> Any suggestions 
> 
> Ashish
> 
> __
> Do you Yahoo!?
> New Yahoo! Photos - easier uploading and sharing. 
http://photos.yahoo.com/

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



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



RE: URLs & Parameters

2003-12-15 Thread Tim Lucia





.
.
.


I will assume you know you do not wish to use forms.

Tim Lucia

> -Original Message-
> From: Steven Nakhla [mailto:[EMAIL PROTECTED] 
> Sent: Monday, December 15, 2003 10:22 AM
> To: Struts
> Subject: URLs & Parameters
> 
> 
> I'm writing a simple web app, and am rather new to Struts.  
> What I would like to do is have several HTML links in my page 
> to perform different types of searches.  For example,
>  
> Name 
> search Age 
> search  href="/search.jsp?type=gender">Gender search
>  
> In my search.jsp page, I'd like to be able to display form 
> fields based on the type of search being performed.  Is there 
> any way to use, for example, one of the logic tags to get the 
> value of "type" from the URL?  Is there another way to 
> accomplish this?  Thanks very much in advance!
>  
> Steve Nakhla
>  
>  
> 
> 
> -
> Do you Yahoo!?
> New Yahoo! Photos - easier uploading and sharing
> 



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



RE: [OT] Log4J and Pre-Processor

2003-12-09 Thread Tim Lucia
Would you rather have that 5ns, or the ace-in-the-hole where you can
debug your app in an installed production environment by turning on
(assuming you don't use the final static boolean method) the appropriate
logger?  This has been extremely helpful in debugging.  It also catches
lots of things you wouldn't ordinarily see, like when you add this to an
ActionListener more then once and you see your actionPerformed() get
called more then once.  It's also useful for profiling.

The biggest savings with if (logger.isDebugEnabled()) { } comes when the
logger generates lots of StringBuffer objects, costing memory and
garbage collection, which will significantly impact performance more
then the if () to check whether to do it or not.

Tim Lucia

> -Original Message-
> From: Kirk Wylie [mailto:[EMAIL PROTECTED] 
> Sent: Tuesday, December 09, 2003 7:20 PM
> To: Struts Users Mailing List
> Subject: Re: [OT] Log4J and Pre-Processor
>
> [snip]
> But do you really care that much about 5ns? Are you SURE you 
> care that 
> much about 5ns?
> 



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



RE: Tiles setup question

2003-12-09 Thread Tim Lucia
What does /myapp.index map to?  Typically, a global forward maps to
/someaction.do.  The action does its controller thing and forwards to a
tile (or other) for the view (or next action).

The example lines (Your-*) below were snipped from my working struts
webapp, so I'm pretty certain they work.

Tim Lucia


> -Original Message-
> From: Richard Hill [mailto:[EMAIL PROTECTED] 
> Sent: Tuesday, December 09, 2003 5:41 PM
> To: 'Struts Users Mailing List'
> Subject: RE: Tiles setup question
> 
> 
> Tim, 
> I tried what suggested, but still get the "The requested resource
> (/myapp/myapp.index) is not available." error. 
> 
> Somethings missing...the Factory gets initialized from file 
> '/WEB-INF/tiles-defs.xml' but it looks like the strut-config 
> can't find or map to the tiles definitions. 
> 
> Any other suggestions? Do I need to specify a controller, or 
> am I missing something in my config files?
> 
> Thanks,
> Richard
> 
> -Original Message-
> From: Tim Lucia [mailto:[EMAIL PROTECTED]
> Sent: Monday, December 08, 2003 5:42 PM
> To: 'Struts Users Mailing List'
> Subject: RE: Tiles setup question
> 
> 
> The global forwards work for struts taglib tags, generally as 
> the value of the name="" attribute.  They do not export to 
> the web server (servlet mapping, *.jsp, etc.) level.  Thus, 
> to access the forward you defined:
> 
>
>
>
> 
> You would say:
> 
> [Return to main menu]
> 
> However, the target of path cannot be a tile, it must be an 
> action which forwards to the tile. [Is this true?  I have 
> never seen a tile as a global forward target]
> 
> Here is an example:
> 
> Your.jsp:
> <%@ taglib uri="/tags/struts-html" prefix="html" %>
> [return to main menu]
> 
> Your-struts-config.xml:
>   
>   
>  type="org.apache.struts.actions.ForwardAction"
>   parameter=".tileTest"/>
> 
> Your-tiles-def.xml:
>   
> 
> 
> Tim Lucia
> 
> > -Original Message-
> > From: Richard Hill [mailto:[EMAIL PROTECTED]
> > Sent: Monday, December 08, 2003 7:59 PM
> > To: '[EMAIL PROTECTED]'
> > Subject: Tiles setup question
> > 
> > 
> > I'm setting up tiles with an example application and I'm
> > getting blocked when trying to use Tiles layout names instead 
> > of the JSP filenames in the struts-config.xml. I'm hoping 
> > that someone on this list can point out what I'm doing wrong.
> > 
> > I can access the application by explicitly typing in
> > "index.jsp" in the url, but when I try a page with a link 
> > defined in my struts-config.xml global-forwards name="index" 
> > I get an error message: The requested resource
> > (/myapp/myapp.index) is not available.
> > 
> > My tomcat localhost.log file show that the Tiles definition
> > factory gets loaded...what am I missing?
> > 
> > Thanks,
> > Richard
> >
> 
> ---
> localhost.log
> ---
> action: Tiles definition factory loaded for processor ''. 
> factory loaded : {myapp.default={name=myapp.default,
> path=/layouts/myappLayout.jsp, role=null, controller=null, 
> controllerType=null, controllerInstance=null, 
> attributes={header=/tiles/common/header.jsp,
> footer=/tiles/common/footer.jsp}}
> , myapp.index={name=myapp.index, 
> path=/layouts/myappLayout.jsp, role=null, controller=null, 
> controllerType=null, controllerInstance=null, 
> attributes={body=/introduction.jsp, 
> navbar=/tiles/tempNavBar.jsp, title=Myapp > Index, 
> footer=/tiles/common/footer.jsp, 
> header=/tiles/common/header.jsp}} } Factory initialized from 
> file '/WEB-INF/tiles-defs.xml'.
> 
> 
> --
> html source with link
> --
> [Return to main menu]
> 
> 
> --
>   Error message when link is used
> --
> type Status report
> 
> message /myapp/myapp.index
> 
> description The requested resource (/myapp/myapp.index) is 
> not available.
> 
> --
> index.jsp
> --
> <%@ page language="java" %>
> <%@ taglib uri="/WEB-INF/tlds/struts-tiles.tld" prefix="tiles" %>
> 
> 
> 
> --
> tiles-defs.xml
> ---

RE: Tiles setup question

2003-12-08 Thread Tim Lucia
The global forwards work for struts taglib tags, generally as the value
of the name="" attribute.  They do not export to the web server (servlet
mapping, *.jsp, etc.) level.  Thus, to access the forward you defined:

   
   
   

You would say:

[Return to main menu]

However, the target of path cannot be a tile, it must be an action which
forwards to the tile. [Is this true?  I have never seen a tile as a
global forward target]

Here is an example:

Your.jsp:
<%@ taglib uri="/tags/struts-html" prefix="html" %>
[return to main menu]

Your-struts-config.xml:


        

Your-tiles-def.xml:
  


Tim Lucia

> -Original Message-
> From: Richard Hill [mailto:[EMAIL PROTECTED] 
> Sent: Monday, December 08, 2003 7:59 PM
> To: '[EMAIL PROTECTED]'
> Subject: Tiles setup question
> 
> 
> I'm setting up tiles with an example application and I'm 
> getting blocked when trying to use Tiles layout names instead 
> of the JSP filenames in the struts-config.xml. I'm hoping 
> that someone on this list can point out what I'm doing wrong.
> 
> I can access the application by explicitly typing in 
> "index.jsp" in the url, but when I try a page with a link 
> defined in my struts-config.xml global-forwards name="index" 
> I get an error message: The requested resource
> (/myapp/myapp.index) is not available.
> 
> My tomcat localhost.log file show that the Tiles definition 
> factory gets loaded...what am I missing?
> 
> Thanks,
> Richard
>



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



RE: how to submit form using

2003-12-08 Thread Tim Lucia
This works for me:

Done

Put whatever javascript you want in the onclick handler.

Tim Lucia

> -Original Message-
> From: Nisith Dash [mailto:[EMAIL PROTECTED] 
> Sent: Monday, December 08, 2003 7:51 AM
> To: Struts Users Mailing List
> Subject: Re: how to submit form using  
> 
> in case   is specified , you have to give either a 
> forward, or a href or a page attribute. onclick will not work 
> here..the error is:
> 
>  Cannot create rewrite URL: java.net.MalformedURLException: 
> You must specify exactly one of "forward", "href",
> 
> how can i specify the forward attribute so that my purpose is 
> achieved.
> 
> - Original Message -
> From: "Tim Lucia" <[EMAIL PROTECTED]>
> To: "'Struts Users Mailing List'" <[EMAIL PROTECTED]>
> Sent: Monday, December 08, 2003 6:13 PM
> Subject: RE: how to submit form using  
> 
> > 
> >
> > Tim Lucia
> >
> > -Original Message-
> > From: Nisith Dash [mailto:[EMAIL PROTECTED]
> > Sent: Monday, December 08, 2003 7:28 AM
> > To: Struts Users Mailing List
> > Subject: how to submit form using  >
> >
> > Hi,
> >
> > Can anyone of you help me with this..i have a hyperlink in 
> my JSP on 
> > clicking which i want to submit an action form with some request 
> > parameters along with the form.Clicking the hyperlink in the JSP 
> > should ideally perform the following task which is done by this 
> > javascript
> > below:
> >
> > function x ( arg1)
> > {
> >  document.ActionFormName.action = 
> > 
> "../../someAction.do?method=subMethodName&newSearch=true&key="
>  + arg1;  
> > document.ActionFormName.submit(); }
> >
> > I have tried using the ,  > page="" , but though the action is being called, the 
> > Action Form is not being submitted to the action class. I 
> am not quite 
> > sure whether  will help 
> as i don't 
> > know how to use it in the present scenario.
> >
> > Thanks in advance for any suggestion to the above.
> >
> > Nisith
> >
> >
> >
> > 
> -
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> 
> 



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



RE: how to submit form using

2003-12-08 Thread Tim Lucia


Tim Lucia

-Original Message-
From: Nisith Dash [mailto:[EMAIL PROTECTED] 
Sent: Monday, December 08, 2003 7:28 AM
To: Struts Users Mailing List
Subject: how to submit form using , , but though the action is being called, the Action
Form is not being submitted to the
action class. I am not quite sure whether  will help as i don't know how to use it in the present
scenario.

Thanks in advance for any suggestion to the above.

Nisith



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



RE: How to detect that session has expired ?

2003-12-07 Thread Tim Lucia
You ought not to refer directly to any jsp pages anyway.  Always refer
to an action which forwards to your jsp.  Then you can put your JSPs
inside WEB-INF if you want (insures they can never be directly accessed)
and you never have to add any tag(s) to check for valid user.

As Ed points out, Inheritance is your friend.  Get to know him, and his
cousin, Poly.  Poly Morphism.

Tim Lucia

> -Original Message-
> From: Ashish Kulkarni [mailto:[EMAIL PROTECTED] 
> Sent: Sunday, December 07, 2003 10:45 AM
> To: Struts Users Mailing List
> Subject: Re: How to detect that session has expired ?
> 
> 
> HI
> if u are using servelt 2.3 , then u can use servelt
> filter, in this filter u can have logic to check
> session before each request so u dont need to add any
> code in jsp or action class
> 
> Ashish
> --- Ed Dowgiallo <[EMAIL PROTECTED]> wrote:
> > Inheritance is your friend.  If you need processing
> > common to all your
> > Action classes, extend the Struts Action class.
> > 
> > Ed
> > - Original Message -
> > From: "Baljinder Singh" <[EMAIL PROTECTED]>
> > To: "Struts Users Mailing List"
> > <[EMAIL PROTECTED]>
> > Sent: Sunday, December 07, 2003 5:41 AM
> > Subject: RE: How to detect that session has expired
> > ?
> > 
> > 
> > > Thomas,
> > >
> > > You mean to say that I should put this logic in
> > ActionClass. But then I
> > > would need to put it in all my Action Classes.
> > Can't I do something
> > similar
> > > in JSP because then I would do it in a common JSP
> > which is included in all
> > > other JSPs of mine. Or is there a common solution
> > which can take care all
> > > Action Classes.
> > >
> > > Thanks,
> > > BS
> > >
> > > -Original Message-
> > > From: Thomas Cornet [mailto:[EMAIL PROTECTED]
> > > Sent: Sunday, December 07, 2003 2:17 PM
> > > To: Struts Users Mailing List
> > > Subject: Re: How to detect that session has
> > expired ?
> > >
> > >
> > >
> > >
> > >When a session restarts, its context is empty,
> > so all objects stored in
> > > the session context have disappeared. To detect if
> > a session has
> > restarted,
> > > you need first to store an object in the session
> > context, then each time
> > > you need to know if the session has restarted, you
> > test its presence in
> > the
> > > context. If it is not there anymore, then the
> > session has restarted.
> > >
> > > At 08:09 07/12/2003, you wrote:
> > > >Hi All,
> > > >
> > > >How can I detect that session has expired and so
> > throw the user out of
> > > >system after showing him a message that "Your
> > session has expired. Please
> > > >login again."
> > > >
> > > >Thanks,
> > > >BS
> > > >
> > > >
> > >
> >
> >-
> > > >To unsubscribe, e-mail:
> > [EMAIL PROTECTED]
> > > >For additional commands, e-mail:
> > [EMAIL PROTECTED]
> > >
> > >
> > >
> > >
> >
> -
> > > To unsubscribe, e-mail:
> > [EMAIL PROTECTED]
> > > For additional commands, e-mail:
> > [EMAIL PROTECTED]
> > >
> > >
> > >
> >
> -
> > > To unsubscribe, e-mail:
> > [EMAIL PROTECTED]
> > > For additional commands, e-mail:
> > [EMAIL PROTECTED]
> > >
> > >
> > 
> > 
> >
> -
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail:
> > [EMAIL PROTECTED]
> > 
> 
> 
> __
> Do you Yahoo!?
> New Yahoo! Photos - easier uploading and sharing. 
http://photos.yahoo.com/

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



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



RE: from Action to Facade: simple attributes or Business Objects

2003-12-07 Thread Tim Lucia
The philosphy is that the Actions ("controller") move bean properties
from form bean(s) into business beans, and pass the business bean into a
business object to perform an operation.  I.e., the action should
contain all of (and only) the web-specific portion of the application.
I.e., the latter case in your example.  Think about what happens if you
add a property?  How many places do you need to change it?  One less (at
least) in the patter case.  You can (typically) use BeanUtils.populate()
do move all properties in one fell swoop.

Tim Lucia


> -Original Message-
> From: Felipe Nascimento [mailto:[EMAIL PROTECTED] 
> Sent: Saturday, December 06, 2003 10:15 PM
> To: [EMAIL PROTECTED]
> Subject: from Action to Facade: simple attributes or Business Objects
> 
> 
> Hi,
> 
> I was wondering what do experts recommend:
> 
> inside Action´s execute method we should pass the attributes 
> to the Facade or create the business objects in the Action 
> and pass them on?
> 
> 1)
> execute(){
>  Facade.addUser(name, surname, login, birth, );
> }
> 
> or
> 
> 2)
> execute(){
>  User u = new User();
>  u.setName(name);
>  u.setSurname(surname);
>  ..others setters.
>  Facade.addUser(u);
> }
> 
> Tks
> Felipe
> 
> 
> 
> -
> 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]



Deploying a struts application (WAR) under ColdFusionMX

2003-12-03 Thread Tim Lucia
Hello all,

I am looking to build an add-on web application to a legacy coldfusion
application.  I have got a prototype working under tomcat and now I want
to "deploy" it to the cf server.  It appears that I cannot simply load a
war file, nor can I unpack it under cfusionmx\wwwroot.  Both apps need
to be in the same application server so I can share session data (for
single sign-on, database resources, etc.)

Has anyone done this?  Are there any resources available?  The
MacroMedia web site suggests (which I also discovered on my own) that
you include the struts action servlet definition in the
cfusionmx\wwwroot\WEB-INF\web.xml file, but I am concerned about
install/uninstall-ability of this web app (there will eventually be as
many as 8 of them, and we want to add/remove/upgrade them at will).
Eventually, the legacy app may move away from cf in which case we can
easily use any app server that suits us.

The choices I think I have so far are:

1. Do what a reasonable container would do and manually "merge" the
add-on to the main (cf) application, adding the ActionServlet mapping to
the cf web.xml.
2. Drop cf as the web application server and use tomcat, moving the cf
servlet pieces into their own web.xml (putting the cf part in its own
context/web app).  This is effectively the reverse of #1.
3. Figure out a way to make cfusionmx accept the .war or some archive or
hierarchy like tomcat would.
4. Figure out a way to make a .car (coldfusion archive) out of my .war

I'm looking for help with option #3 (preferred) or #4.

Thanks for any pointers, tips, or help,
Tim Lucia

Ref:
http://www.macromedia.com/devnet/mx/coldfusion/articles/struts05.html



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