Per Jørgen Walstrøm ha scritto:
>
>
Try with: flush="false"
;-)
Antonio Petrelli
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
Gary Feidt ha scritto:
> If you are extending mainLayout you must have itemcount and pagecount
> defined in mainLayout, and so on.
It is not necessary if you don't use a definition directly but only its
extended versions.
Regards
Antonio Petrelli
-
pc leung ha scritto:
>
>
>
>public class UserSystemForm extends ActionForm implements Serializable {
>
> // - Instance
Variables
>private String systemHref;
>private String messageKey;
>private String method;
pc leung ha scritto:
>Where does the error come from?
>
>...
>in struts-config.xml
>...
>
What about the element in struts-config.xml regarding the
"userSystemForm" form-bean? Please post it because I'm supposing that you
declared it with the wrong class.
Ciao
Antonio Petrelli
>
>
>DoFirst.java:
>
>package edu.msu.kate.struts.action;
>
>
>
>import org.apache.struts.action.*;
>
>import javax.servlet.http.*;
>
>
>
>public class DoFirst extends Action {
>
>public ActionForward perform(
>
>ActionMapping aMapping,
>
>
How about your "home.do" action mapping and the connected action? Maybe
you return a wrong ActionForward...
Ciao
Antonio Petrelli
Buntin, Seth - KATE ha scritto:
>I am having an issue getting Tiles to work. I am totally new to Struts
>so bear with me. The issue is I don't see anything. I got t
Mark Benussi wrote:
> I would create a Manager class to do any business logic,
> that sits between your Action and EJB
It is a Business Delegate pattern ;-)
http://java.sun.com/blueprints/patterns/BusinessDelegate.html
Anyway I agree with Mark, no business logic in your action, only calls to
the
Simple answer:
You have to put a definition inside another definition. You can see a
definition as a "filled layout page". Since your main.jsp is not complete
by itself (you have to "put" pages inside its attributes), you cannot use
it as a simple tile (well you can but you get an error ;-)
I think this "problem" resides in the rewrite of the URL that Struts
makes.
Each time an URL is encountered (or an action path, or something similar)
an URL rewrite happens.
Now, if there is no session cookie activated (I mean in the HTTP-request),
or cookies are disabled, then it appends the SID a
I wish to tell you a story, to show because I changed my mind about DTOs.
Once upon a time I used to write GUIs (i.e. Swing GUIs). I have to tell
that I used to mix controller code with model. But when I think about that
"era" I noticed that it was pretty easy to write code. Why now is it so
diffic
I'm not a guru but...
Once I thought that DTOs are a nice way to separate the webapp's layers,
just because they are simply data containers and have no logic.
But now I think they are completely useless, because they have no logic! I
know it is stupid to use the same answer for two opposite points
Ciao
Antonio
Michael Jouravlev wrote:
>How do you refresh the page?
>
>On 4/28/05, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>
>>Yes, this solution is simple, but beware that it is dangerous,
especially
>>when a client opens different pages, within the same session: forms will
>
Yes, this solution is simple, but beware that it is dangerous, especially
when a client opens different pages, within the same session: forms will
interfere!
What I usually do is to put the data collected in the previous step into
hidden fields, so that they are re-posted in the next step. This way
I think the best thing is to make a custom tag library. The "formatting"
part of your project should be in the "view" part of MVC. You can also use
scriptlets, maybe just to test some code, but the most elegant way is
making a custom tag library.
Ciao
Antonio Petrelli
Rutger Heijmerikx wrote:
>He
Hi
> I was afraid that would be the answer :-( I really wanted to avoid
having files with page fragments that weren't well formed like that...
I'll have to dig into the Tiles code and see how ameanable the rendering
model is to being 'masaged' into supporting what I want it to do :-)
I was a begi
Errr No... Let's start from the beginning.
1. Don't give to Tiles definitions names starting with "/".
2. You can put a Tiles definitions inside another tiles definition. For
example:
I hope this clears your doubts.
Ciao
Antonio Petrelli
Laurie Harper wrote:
In struts-config.xml change the element this way:
Ciao
Antonio Petrelli
rmanchu wrote:
> Dave Newton wrote:
>
>> In the struts configuration file. Instead of using a path to the JSP
you use the name of the tile. You must also be using the Tiles plugin, as
detailed in:
>
>
> i had defined it a
I used it only for its treeview tag. It is pretty interesting. For the
rest I think it's best to use Struts Menu.
Beware of the license! It is somewhat complicated. Its source is
available, you can use it freely if your project is GPL, but you have to
ask for permission (I don't know if it involves
I don't know it this is the case, but I think you missed the
"tiles-defs.xml" file.
I think the best place to start is Cedric Dumoulin's tutorial:
http://www.lifl.fr/~dumoulin/tiles/doc/tutorial.html
And I think you should start directly from chapter 6.
>
> 1) have a page with classic 4 tile layou
This is real strange, AFAIK Tomcat 5.0 and 4.1 differ only in JSP and
servlet version support, and other performance thingies, and anyway it's
ActionServlet that populates ActionForms. Why don't you post the JSP page
(especially the part with the form) and the ActionForm code?
Ciao
Antonio Petrelli
Probably the problem is in your ActionForm. It seems that a submitted form
field does not match with the corresponding ActionForm property (e.g. you
submit a alphanumeric string while in the ActionForm the property is
"int").
Hope it helps.
Ciao
Antonio Petrelli
Rodolfo García Esteban/CYII wrote:
First of all, forget about MySQL, since they don't have a long history in
stored procedure (its support is still release-candidate state).
Why don't you try Firebird? It's easy, it has a long history (since it was
born from Borland's Interbase), it supports views, stored procedures and
so on. Oh, a
OK Understood, I think. So you have a Tiles definition and, when the form
is submitted and the Action made its work, you want to forward to a page
where only one portion of the Tiles definition changes.
The solution is simple: make another definition! ;-)
You know, as I said a lot of times before,
In Tiles, you can put attributes only into layout pages. In short terms
you should modify your tiles-defs.xml this way:
Ciao
Antonio Petrelli
Neil Aggarwal wrote:
>Hello:
>
>I am a newbie to struts and am trying to get a handle on
>tiles:getAsString
NetBeans (www.netbeans.org) has a support for multiple-language properties
file. It displays them in the same window.
Ciao
Antonio Petrelli
Ashish Kulkarni wrote:
>Hi
>is there a tool which will compare properties file and
>highlight missing keys.
>I have a situtation where i have properties file
>... but the the problem i'm facing is how to point to a particular
region in tiles framework from struts config.
>
What do you exactly mean? Please expose your problem with more details.
-
To unsubscribe, e-mail: [EMAIL PROT
Check out the element of your struts-config.xml. It must be:
Otherwise you won't be able to forward to a tile definition.
Ciao
Antonio Petrelli
haim wrote:
> The project is growing and we need few developers to work on it.
> I am trying to deploy the application using the struts modules.
> We a
You forgot to extend "Action" class in your own action. Here is why you
got a ClassCastException.
public class AnzeigenAction extends Action
{
..
}
Ciao
Antonio
Wolfgang Rinnert wrote:
> Hi all,
> I am expanding the Struts Upload example.
> Right now I work on a step to display the data that
I think your only way to make it work is using a plain tag or using
only one tile.
Or maybe you should design better your application (hey I'm joking!!!)
Ciao
Antonio Petrelli
Matt Hughes wrote:
> I have designed a basic layout file that looks something like this:
>
>
>
>
>
>
>Correct me if I'm wrong, but Tiles is, in essence, just the JSP include
>extended a bit. So, if I have a page with 3 tiles (or 3 JSP includes
>alternatively), what gets returned to the browser is still a single HTML
>document that is the result of inserting the 3 tiles in the main page.
>
Absolu
I don't know if it is correct or not, but it is the way the internal
datasource manager in Struts behaves.
Anyway I wrote a plugin that "should" behave better:
http://sdsmanager.sourceforge.net/
I must say that using DataSource as part of a web application is not a
good practice (though I don't thi
You can use Jakarta Taglibs' "String". In particular, the
tag:
http://jakarta.apache.org/taglibs/doc/string-doc/string-1.1.0/index.html#replace
Ciao
Antonio Petrelli
Ole Hildebrandt wrote:
>Hi,
>
>I know this is a stupid question, but I couldn't find any solution. Is
there
>any documentation ava
If you mean HTTP request parameters, then they are accessible from all JSP
pages included in a Tiles definition, since they share the same HTTP
request.
But remember that it is not a good practice. It is better to use an Action
that, eventually, puts some beans in the request scope and then you acc
Take a look at this:
http://www.lifl.fr/~dumoulin/tiles/doc/tutorial.html#_Toc521292375
And remember that a definitions-config MUST BE an XML that follows the
Tiles configuration DTD.
Ciao
Antonio Petrelli
Jonathan M Z wrote:
>I am a bit baffled by creating tiles definitions in
>jsp(not XML)
>her
I had a similar problem with jdk 5.0, but with tomcat 5.0.28. In that case
I was using Apache Forrest (as a webapp). Under my Struts webapp I put
Apache Xerces (the latest version) under WEB-INF/lib, because it seems
that the parser under jdk 5.0 is buggy (it should be an old version of
Xerces...)
Frames are a recurrent question here. When you forward to a frameset, you
forward only to the frameset itself and not to each frame.
This means that:
1) attributes put in request scope appear ONLY in the first request, i.e.
in the frameset (then NOT in the frames);
2) request parameters are present
In struts-config.xml:
..
Ciao
Antonio Petrelli
Hauschel Fred wrote:
>Hey all,
>i've wrote a little framework, that handles it's own definition.
>So I have wrote my own definition Factory.
>
>But know there are some cases where I want to use the standard
>DefinitionFactory.
>
>Is ther
> Lets face it, those of us who actually try to do things right will just
> get labelled as 'perfectionists' and not 'people who get things done',
> and the time we have to spend wading through the code the got-doners
> left so we can add feature Y makes us look like a hopeless bottleneck
> when co
I'd like to share with you a small experience with bad programming
practices I had just yesterday.
I made a Struts-based application a while ago, when my experience with
J2EE application was at its beginning. I wrote a "Business Delegate" (the
quotes are intentional) that had an HttpServletRequest
You have to use some J2EE design patterns to achieve this:
http://java.sun.com/blueprints/patterns/catalog.html
1) Put all of your business logic in a Business Delegate, i.e. the code
that accesses to XML files (I am supposing that you know everything about
XML manipulation, otherwise it will be of
For storing user info, using sessions is the best way. Think about not
using sessions: you should someway propagate an "ID" of the user between
requests. Luckily, J2EE applications store a session ID as a cookie or (if
cookies are not enabled) propagates it in URLs.
But be cautious using session, d
There is the MAC address, but only if you are connected to the same
switch/hub. Otherwise, it will fail because the MAC address is usually the
one of the default gateway.
The big big problem is that almost everything can be spoofed. IP address
can be spoofed (well at least the response never arrive
The tlds are not in struts.jar, check the Struts distribution, it is
there, but I don't remember where it is :-P
Anyway I had a similar problem when I used Apache Forrest as a webapp
under the same Tomcat instance, it seems that Forrest changes the default
XML parser, so that Struts TLDs are not pa
I hope you don't mind if I announce a new release of a package in which I
contribute with my work.
Dimensions 0.6 has been released. Download at:
http://mutidimensions.sourceforge.net/
Dimensions extends the Tiles Document Assembly Framework of Struts 1.1/1.2
to become a multi-channel display frame
Struts does not have a specific support for XML, but you can use inside a
webapp all the libraries that you normally use under classic applications.
For example, if you want to load a DOM for an XML file inside an action
(not very elegant...), you can use DOM4J (or similar libraries).
If you want t
I am going to modify the code of a Tiles-based library and I want to
remove some deprecations (from Struts 1.1 to 1.2.4).
In particular, I want to remove the "DefinitionsUtil" class. In fact it is
only used to refer to the "DefinitionsUtils.userDebugLevel" and
"DefinitionsUtils.NO_DEBUG". What is t
In fact there could be another solution. You could extend the
tag, by adding an attribute that propagates the request parameters.
In fact can use a java.util.Map to create the URL query
parameters but it cannot use the "current" parameters.
Normally you have to do this way:
where "nameOfTheMap
> I am using the JSTL:core tag libs ar a replacement of the "struts-bean"
tag.
>
> Thus, is the following equivalent?
>
> JSP:
>
Uh... I don't know, I never used JSTL. Sorry but you have to try and test
:-P
Just remember that "request.setAttribute" sets a bean at request scope.
--
>
> Thus, if I set an attribute using the HttpServletRequest.setAttribute,
> how can I retrieve it my JSP page?
> I know that all these can be very easy using an ActionForm, but I do
> not want to create an ActionForm for just a plain String attribute.
>
Supposing in the Java code:
String myThin
> how can I add a request parameter inside an action execute method? Do
> I have to use an ActionForm or it is an easiest way to do it?
>
You cannot set a new parameter once a http request has been submitted, but
you can get parameters directly via the object "request", passed in the
"execute" me
It seems that a bug report connected to this problem has been posted. Take
a look to:
http://issues.apache.org/bugzilla/show_bug.cgi?id=32134
I think the way to work around to it is to put in the tag the
attribute:
contextRelative="true"
Or maybe you could download the CVS version of Struts (ok ok
How many times should I say it? TILES ARE NOT FRAMES! It is only a way to
share common code in different pages. PAGES NOT FRAMESETS!!!
Uh, sorry for this yell.
Anyway, you cannot display a word document as a tile. If you want to do
it, you surely have to transform it into HTML, but I think it is no
Ashish Kulkarni wrote:
>Hi
>I am working on a webproject where i have designed a
>applet which communicates with the database using
>applet-servlet communication,
>The applet opens a URL connection to a servlet.
>My Servlet reads the data from applet calls the
>appropriate business classes, get da
>I am new to Tiles. Is it possible to present a link in one tile and have
>it fire an action that updates another tile without having to reload the
>whole page? FAQ seems to not have a lot of tiles related stuff.
Tiles are not frames. With HTML frames, if you decide to reload only a
frame you can
Found on SourceForge:
http://valuelist.sourceforge.net/
It has nothing to do with Struts, it is usable in simple JSP pages.
Ciao
Antonio Petrelli
Shabada, Gnaneshwer wrote:
>Hello All,
>
>I am planning to implement a Page Navigation functionality to navigate
>through search results in my project.
"getDataSource" is a protected method inside the class Action, so you
cannot use it directly. Anyway I suggest to copy the code from the source
of Action, because it simply takes an object (i.e. the DataSource) from
the application scope.
Ciao
Antonio Petrelli
Shailender Jain wrote:
>Hello,
>
>I
For the tag html:form, the attribute "name", "type" and "scope" have been
removed from Struts 1.2, they were deprecated in 1.1.
They have been used to override the action mapping in the
struts-config.xml file between an action and its form-bean.
The name of the element in the resulting HTML page w
The problem is that a Tiles definition is not a valid URL but an
identifier that only Tiles can understand.
The simplest thing you can do is making a simple JSP page with this code:
(obviously include the "struts-tiles.tld" tag library)
and include this REAL page (with a valid URL I mean) in you
For my experience, usually this is due to some problem in Struts
application loading, even things that have nothing to do with Tiles, such
as a wrong DataSource configuration. If something goes wrong in the
struts-config.xml, the Tiles definitions would not be loaded at all.
Take a look at the log
When you declare that a form-bean connected to an action is used with
scope "session" means that an instance of that form bean will be put
inside the session space, i.e. the one you take calling:
request.getSession()
Then, the form bean is put inside the session scope of the web server that
interac
Are you going to get an external HTML page and putting your own code to
it?
In this case you can do that very easily using a wrapping JSP page and a
tag library from the Jakarta Taglibs project:
http://jakarta.apache.org/taglibs/doc/io-doc/intro.html
Take a look to the "io:request" and "io:http" ta
Tiles are not frames! The runtime part of Tiles composes pages according
to your Tiles definition. That means that if you define an extended tile
definition, is just like defining another page! (obviously I am talking
about tile definitions of pages, not sub-tiles).
It is a normal behaviour.
If you
Use an Action as you use a servlet. That is, in the "execute" method there
is the parameter "HttpServletResponse response". Use it and render you
HTML page. You can then "return null;" (it means "forward to nowhere") so
your HTTP response will be made only of your text built inside the Action.
But
>Before do I need to write Frameset tag? Ratnakar
>
Obiously yes. Remember that almost every HTML Struts tag (and this is the
case) is transformed into a real HTML tag. So this will be transformed
into "" tag that must be contained inside a "" tag.
Ciao
Antonio Petrelli
---
Did you try using the "forward" attribute?
Try making a tile definition in your tiles-defs.xml for each of your
frames (attention, not each for your frameset, but every little frame you
have in your pages) and then:
Ciao
Antonio Petrelli
Ratnakar Parakala wrote:
>Hi,
>
>I'm using tiles. I have
> Obviously, you can implement a "datasource management" sub-system (with
> a web front-end) in your application!
> But, why do you have to re-invent the wheel?
With a metaphore, I can say that the wheel invented by Tomcat is square
and I have to "round" it a bit. (The DataSource management in Str
In fact I need to do something more.
Suppose that I want to distribute my application, and the destination has
a different DBMS (well at least he/she has a different username and
password...).
I think that configuring the context.xml file for a non-technical person
is a bit difficult, and I wish to
WHOOPS!!!
sorry wrong submit.
Thank you, I will check it out.
Ciao
Antonio
> org.apache.struts.config.DataSourceConfig holds a getKey() method that
> returns you the DataSource key underwhich the Datasource object is
stored
> in the servlet Context...just find it out and try making use of it...
>
org.apache.struts.config.DataSourceConfig holds a getKey() method that
> returns you the DataSource key underwhich the Datasource object is
stored
> in the servlet Context...just find it out and try making use of it...
>
> Thanks,
> Jitender Kumar C.V.
>
>
---
A common practice is to use the J2EE design pattern "Business Delegate",
that provides a clean separation between the technology used to store data
and all the rest of the application.
The Business Delegate will expose some "APIs", but it does not show how it
is really implemented (JDBC, EJB,etc.)
> you can use JNDI to get a DataSource (if you use tomcat see tomcat
> documentation in order to set the datasource).
> Here an example code to use inside the singleton object:
>
> //Get DB from JNDI
> try {
> Context initCtx = new InitialContext();
> Context envCtx = (Context) initCtx.
Hello there,
is there a way I can assign a DataSource to a singleton object (i.e. a
Business Delegate) on startup?
I know there is the "getDataSource" protected method in Action, but I have
to pass the DataSource itself on each call of the delegate, or I have to
check whether it has been already pa
Sorry I made a mistake. I should have written this way:
---
Wrong, you can ALSO (besides a Tiles definition) forward to a JSP page or
to a servlet (used in StrutsCX) or
to another action or to nothing at all (e.g. if you build the
HttpServletResponse manually).
---
That is, you can build the respon
>>> Hello,
>>>
>>> is ther any way I can forward to a tile-definition?
>>>
>
>
> That is the only way you can ever get to a page at all in Struts, so the
answer has to be "Yes".
Wrong, you can forward to a JSP page or to a servlet (used in StrutsCX) or
to another action or to nothing at all (e.g.
Sure you can, but you have to satisfy some requirements:
1) Use the Tiles controller instead of standard Struts controller, i.e. in
your struts-config.xml you must specify:
but I think you already did it because you are using Tiles :-P
2) Have a elements in your struts-config.xml, either global
Whoops! in point 4) I meant:
Sorry for the mistake.
Ciao
Antonio Petrelli
[EMAIL PROTECTED] wrote:
>Mmm... I think there is some misunderstanding in your use of Tiles.
>If I understood, maybe you want to have an effect of "panel and
>subpanels". If you want to do such a thing, you ca
Mmm... I think there is some misunderstanding in your use of Tiles.
If I understood, maybe you want to have an effect of "panel and
subpanels". If you want to do such a thing, you can use what I call as
"definitions of definitions".
If I understood (again :-P ) you want to have a main page, divided
You forgot the layout JSP page. You have to make first of all a JSP page
like this:
Supposing you call this file "/layout/myLayout.jsp", you have to modify
you definition this way:
Ciao
Antonio Petrelli
Mu Mike wrote:
> I have a definition like the below
>
>
If you mean that you want to put a sub-tile inside another tile, you could
make something like this:
In other words you can use the "" element not only with JSP pages but
also with other definitions. That is you can make "definitions of
definitions" in a nested
Ok I'll try to explain the whole process.
1) Create your "TilesAction". For example, take this example class:
package foo.bar;
public class MyAction extends org.apache.struts.tiles.actions.TilesAction
{
public ActionForward execute(ComponentContext componentContext,
ActionMappi
think the best (and the most elegant) way to make dynamic tiles is by
using TilesAction. This because this class has knowledge of the use of
Tiles.
So write your TilesAction (it is similar to a plain Action, except of some
more parameters in the "execute" method). In the "execute" method put your
c
I think you could use a request-scope bean that contains an ID referring
to one item in a session-scope collection (here I mean an array, a Map, a
List...).
Then expose your item in a page-context bean (using bean:define) and use
it in the rest of the JSP page.
Ciao
Antonio
Kailash Vasani wrote:
[EMAIL PROTECTED] wrote:
>
>
>
>
>Looks like I went a bit over the top with the embedded html proposal.
>
>It seems the users would be content if whatever they'd keyed into a
>text-area looked the same when
>subsequently re-displayed as text in a document.
>
>ie just preserve the line-feeds, no ne
83 matches
Mail list logo