One of the problems I'm having with template:include/ and probably
more with the XML nature of JSP is that html:XXX form elements
have to be within html:form/html:form tags, and no in an include
used by template:include/.
I have common components that different forms use, but have to do
either
I decided to do the second option, it works quite well. I don't like the
idea of putting the while html:img/ tag into the template:put/ because
that'd make the template file confusing for someone trying to maintain it
(the image tag would never appear in the source for the included file, the
I've got a situation where I want to include a header file with
template:insert template=/share/inc_header.jsp
template:put name=header_image content=/media/h_modify.gif direct=true/
/template:insert
and then in the header file have
html:img page=/media/h_modify.gif width=315
try
html:link href=%= \/\ + name + \/index.jsp\ %
You need to have the %= % present the whole string, not just the single part.
At 10:56 AM 8/06/01 +0200, you wrote:
Hi!
I am evaluating struts for a new project. One problem I wasn't able to solve
was the integration of JSP
At 07:04 PM 1/06/01 +1200, you wrote:
Summary: Any known bugs and workarounds with Multiple Windows in IE5,
Servlet Sessions and Struts 1.0b1?
A few things to note. Have a look to see if the redirect is forcing :80 (port 80)
onto the end of the URL, this can cause the session get lost in the
In the case at hand, nothing stops your user from logging on (so your
security checks won't catch anything) and then hand typing a URL with
query string parameters that maliciously or accidentally try to change
things in the system. If the user is successful at doing this, it's shame
on
At 11:53 PM 30/05/01 -0700, you wrote:
A good way of removing the bucketloads :-} from your Action classes is to
subclass ActionServlet and implement processActionPerform to do the logon
check.
It's not just for login though, that was the example I used, every action that
generates a form needs
I made a sub-class of ActionServlet an overloaded the initXXX()
method that created the connecion pool. I did this because
my database manager beans needed access to the connection
pool parameters.
The other choice is to use something like a singleton or factory
bean pattery that generates the
George Craig wrote:
Yes you can. Here is how to do it:
%=
application.getInitParameter(SOME_KEY)
%
Does this actually work? I've had report that in Tomcat and JRUN,
it doesn't seem to return the values. Has anyone used it?
I`m building a site that uses a application form that spans over several
pages. How should I design this application?
1. With formBeans for every page
2. One formBean for the entire application form
What I find I am doing is building a separate form bean for each page
that just represents the
, and then forward to the .jsp page.
At the top of the .jsp page you can then put something like
(and this is from memory, so I'm not sure of the exact
syntax)
logic:notExists name=editSubscriptionForm
logic:forward forward=editSubscription/
/logic:notExists
JeanX wrote:
Jim Richards wrote at 2001
I had this problem, and worked out a solution that seemed workable.
The main thing to remember with the html:xxx/ tags is the
the name part should always be the name of the form bean, and
the property be relative to that, otherwise the BeanUtils won't
be able to repopulate the form.
I tend to
No.
What I do (antd I think it this is from the example app as well, maybe
subscription.jsp) is to put at the beginning of the .jsp file (this is
from memory, don't have the code handy)
logic:notPresent name=yourFormBean
logic:forward forward=editFormCode/
/logic:notPresent
Where
As a profession developer I have taken to learning how to use Struts
for several reasons (besides being Java, and thus way cool).
It's free. It doesn't cost me anything to develop or deploy.
Open Source. If the development team die in a freak accident
from caffeine overdose at something like
Try
forward name=success path=/viewCategory.do/
instead of
forward name=success path=/viewCategory/
--
Kumera - a new Open Source Content Management System
for small to medium web sites written in Perl and using XML
I need to confess I'm lost. The PetStore approach sounds cleaner in some
sence, but also sounds too repetite in other, and mostly, sounds way to
expensive (or it isn't?).
Struts uses a connection pool. So when you do a getConnection() you're
actually pulling one out from a pool of shared
Do you have multiple submit buttons, and your action treats the data differently?
You can use hidden fields, so that all the data is sent with the form
fields. Then your action can determine which fields to use based
on the valud of the submit button.
If you have the same input field name and
Because exceptions are slow, and can only handle one error
at a time. The design as it is, allows for multiple action
errors to be returned to a page for display.
Exceptions should be for catastrophic errors that cause
the system to barf. Having a blank password doesn't really
fit within that
Michael Mok wrote:
The servlet engine to use is Tomcat 3.1.
Tomcat 3.1 has lots of buggies in it, you're better off
using a 3.2.x version or go straight to a 4.0, although
I think 4.0 is still in beta.
In your code you can, I don't think there is a run-time parameter between them
because it would affect code quite drastically if you switched from forwards
to redirects.
At 08:40 AM 25/04/01 +0100, you wrote:
Can you switch between the two, i.e. make struts use redirect?
At 11:13 PM 24/04/01
At 11:13 PM 24/04/01 -0400, you wrote:
Anyone know why struts uses forward instead of redirect?
A redirect sends a request back to the browser, thus generating another
connection between the client and server. Forward keeps it internal
to the server, which also means you can re-use the request
Try
document.requisition['requisitionLines.requiredOnDate'].value = "the new
value";
Alex Colic wrote:
Hi, I have a text box mapped to a bean via:
html:text property="requisitionLines.requiredOnDate" size="10" /
My form is called requisition.
If I try to set the value of
"Young, Wayne" wrote:
Ok, that gets me closer. I created the servlet put the following code in
the init() method.
// Store the lookup service in the servlet context
LookupService lookupService = new LookupService();
What specific operation are you trying to do? Since you don't have autocommit
set to true, you may be having transaction problems.
I found it helpful to create a Test.java file with the same operations
as creating the datasource (with the same parameters), a connection and
doing a sample
I've now got the logic:iterate ... tag to work, but I'm confused about how it
works with the collection attribute. I've seen examples for people where they
have
logic:iterate id="bean" collection="%= someObject.getValues() %"
... do something with bean ...
What happens to javascript
validations? Where do we fit them in the comlete
picture?
They don't happen at the moment. Part of the Struts 1.1 plan is to look
at some forms of
autogeneration of JavaScript validation. A few people have implemented
their own system
for this.
Who takes care of
At 10:25 PM 20/03/01 -0800, you wrote:
Eric,
Have you looked into ASP.net vs ...?
The main problem there is that a lot of the development tools are
beta, and finding an ISP that will host it is also difficult. It will
be at least 12 months before it has settled down.
--
Kumera - a new Open
e were no .proerties file) and this rippled through the system
and broke init().
I've rebuilt my postgresql.jar file and the system loads, I can access the database
and we'll all live happily ever after.
At 11:30 PM 14/03/01 +1100, Jim Richards wrote:
At 01:28 PM 14/03/01 +0100, you wrote:
We
I'm still getting problems with PostgreSQL (documented previously several
times). Has anyone used it successfully as a database.
Yes, I've got the settings correct, the JDBC string correct, lots of other
things. I really need someone who actually has it working to put their
hand up and say
At 01:28 PM 14/03/01 +0100, you wrote:
We are currently using PostgreSQL as a database in a productive system together
with struts. We tried with Interbase before, but ran into many many
difficulties. So we switched to PostgreSQL and everything went well from then
on.
What specific kind of
At 01:51 PM 14/03/01 +0100, you wrote:
This does not sound at all like a PostgreSQL problem.
Doesn't the error also show up, when you remove the datasource section?
No. That's the catch, it loads and runs if there's no datasource
section in the struts-config.xml file (although you need to
My approach is to have:
JSP - Struts Form/Action - Business Rules - Database
The busines rules are set up as singleton object on servlet
startup. I've subclassed the ActionServlet and overloaded
the datasource init method, there I set up the four business
rule classes and
Has anyone got the database pooling code/DataSource to work or specifically
had it fail?
I've been having problems (documented previously) and I've read about a few others
who can't seem to get the pooling to work as well, and I want to get an idea
of specifically where the problem might lie in
for reference within each Action, to access
the database.
All is well. For now.
I think what might be useful for me now is getting some time together to
read all the new documentation again.
Jim Richards wrote:
I'm sure earlier today when I started with the new version I didn't get the load
error
EJBs come in two flavours (as opposed to flavors), session beans and entity
beans.
Session beans represent business logic and rules, entity beans represent a
row in the database.
The model that you'd use is to have Actions do the basic processing of form
elements into data beans (just regular
At 07:37 AM 23/02/01 -0500, you wrote:
Hi,
I wanted to have more than one form class for a one jsp file. Because in
my one jsp file, i have a information of 4 tables. So i want to transfer the
information to 4 formclasses? Is it possible?
If what I think you are doing is wanting
The usual thing to check for are: Are you using the
database conneciton pool? Are you closing your database
connection? Do use you transactions at all? Do you commit your
work? Do you have autocommit turned on?
Anand Raman wrote:
I am trying to implement a multi page form and in some scenario
I'm sure earlier today when I started with the new version I didn't get the load
error, and
something I've done has freaked it out. But as you'll see I haven't done that much to
freak it out.
I think I'm onto something now. I commented out the database connection
code I had:
I'm trying to do the same thing here, but I'm not sure on a few
of the details.
I've got a servlet called DatabaseContainer, which will handle all
the database connections and populating Beans to send back
to the Actions.
What I can't work out is, once I've get the DataSource, how does the
Sorry about not cutting out the previous messages, but the
discussion is sort-of relevant to what I'm having problems with.
I'm getting
javax.servlet.ServletException: Cannot find ActionMappings or
ActionFormBeans collection
I can run the example, and I can run a test page
You probably need to create a helper class that does all this work,
keeps the references as public variables and create it as a singleton in
the init of the servlet, and store it as an application wide variable
so you can access it easily and have references to all the session beans.
I can't
I'll be using ELB's for my application when I start building it
in a few weeks time (still in the design stage). I expect to
be using only EJBs from a action servlet, that are session
beans, and those session beans use entity beans. From previous
work I found there was too much overhead using
[big snip ...]
Is there another way to accomplish the same thing, without tacking the error
on to the redirect URL?
Probably not, no. I can't see where you'd store the errors. In the session
would cause problems with synchronisation, and on the redirect URL
could cause buffer problems (with
You can use java script. I posted a message about this
to the struts-dev mailing list a few days ago. I don't
have the email, but you can find it in the mail archives,
which I don't have a reference for either.
Nikolaus Rumm wrote:
Hello,
what I wanted to do is...
If you're prepared to be patient, I need both of these, and
can work on them but I won't be able to start unitl January
on the development of it.
The AutoBean idea (as an idea) is something I use already
in Cold Fusion, and have done before in PL/SQL.
The client side validator, as I posted
With JavaScript you can specify the form action, so you'd have
something like:
form name="aForm" action="defaultAction.do" onSubmit="return
checkSubmit(this);"
input type="submit" name="button1" value="use default action"
input type="submit" name="button2"
I'd prefer (and this is personal preference only) more on the development of
models and application frameworks then actual introduction code.
Coverage of PostgreSQL as well (it has transaction, which are quite
crucial to the EJBs, otherwise you get MySQL's serialised table locking
which is not
Then you've got the wrong .jar file in your classpath, or earlier
in your classpath.
You can either edit your CLASSPATH environment variable setting,
or remove the offending .jar file from your system. You'll then
need to include the correct .jar file (depends on your server
setup) that
It's really only for an example. It you want real
object persistence, you'll need to develop your
owne layer. Something like EJB's will make this much,
much easier. Or some direct JDBC code perhaps.
Vilavanh Messien wrote:
I analyzed the struts example in order to develop my own small
users. What I am asking is, will STRUTS gracefully support a 2 stage
approach to forms - 1 stage to construct and fill in values, and a second
one to gather responses and process ?
This is something I am looking at, have a look at the
simple JavaScript validation page I posted yesterday
In 1.0, the validation model for the server side has been significantly enhanced.
The
idea of auto-generating JavaScript validation code for the things you can check on
the
client side is attractive, but won't make Struts 1.0 (unless someone really hurries
and creates it :-).
Hmm ... I
(This has been cross posted to tomcat-user, as it seems to be a
tomcat issue rather then a struts issue.)
I have found that this behaviour is *not* replicated when using
Tomcat's built in HTTP server. I need to do some deep
experimentation, and install tomcat-3.2b8 as well.
I'll let you all
I'm getting weird behaviour with my struts code, and with the example
application.
Currently I've got Tomcat 3.2b6 running, with the latest nightly build of
struts (17-11-2000, that's the 17th November, 2000) and the examples,
documentation and test data all run. (Which I must say, took a very
53 matches
Mail list logo