R: Automatically detecting struts-config changes and reload app.

2004-03-25 Thread Leonardo Francalanci
I wrote the following on 01/23/2004 on the mailing list, but nobody cared... I wrote a servlet to trigger off a reload of the struts-config.xml. The servlet is: protected void doGet(..) { ActionServlet as =

R: Automatically detecting struts-config changes and reload app.

2004-03-25 Thread Leonardo Francalanci
I used your code ( Thanks ) and I finally got it to work with a Filter. We have a login filter in our app. So I added a method which runs only in development mode. just one thing: I'm not sure, but it seems that sometimes Tomcat does not re-read the file. It's like it keeps it cached

[OT] JSP or Velocity

2004-02-27 Thread Leonardo Francalanci
take a look at freemarker http://www.freemarker.org/index.html It is very similar to Velocity, but you can use JSP tags in freemarker templates. (You can use JSP custom tag libraries in templates. from http://freemarker.org/fmVsVel.html)

R: Reload Action Classes

2004-02-21 Thread Leonardo Francalanci
With Eclipse when you debug the tomcat application each modification is reflected (via hot code replace) to your web app. Of course things like adding a new method don't work: in those cases I use the tomcat manager: http://yourserver/manager/reload?path=/yourapp I think all other IDEs

R: persistent data storage - the right way

2004-02-16 Thread Leonardo Francalanci
I think that with hibernate you don't need to write sql code to save/update/delete your objects or to retrieve objects by their id, with ibatis you have to write all your sql code. Example with hibernate (pseudo-code...): session.find(MyObject, id); MyObject.setProp1(newvalue) session.save() //

[OT] persistent data storage - the right way

2004-02-16 Thread Leonardo Francalanci
[/] Leonardo Francalanci [EMAIL PROTECTED] 16/02/2004 09:46 Please respond to Struts Users Mailing List To: Struts Users Mailing List [EMAIL PROTECTED] cc: Subject:R: persistent data storage - the right way I think that with hibernate you don't need to write sql

R: repost: validator retrieving data

2004-02-09 Thread Leonardo Francalanci
I think it's right only in simple cases If your prepare means: - Putting in the request a collection for a select (for example) - Initializing the form with data from DB or any other source You are doing 2 things completely different (logically) in the same action and that's why you need a

R: R: repost: validator retrieving data

2004-02-09 Thread Leonardo Francalanci
The input for the save action is the second action or the jsp page if you use a filter. Am i missing something? No! Yu're right! Why didn't I think about it!? THANK YOU (grazie...) - To unsubscribe, e-mail: [EMAIL

R: repost: validator retrieving data

2004-02-06 Thread Leonardo Francalanci
in other words, your setup action will be called only when you enter the page for the first time Suppose I have: 1) A listbox with values retrieved from db 2) a form with values retrieved from db that the user can change. Now, if I don't call the setup action when there's a validation error,

R: repost: validator retrieving data

2004-02-06 Thread Leonardo Francalanci
I'm sorry, I'll try to explain better. If I used your solution in case of a validation error my list box would not be filled. When you have a validation error it returns to the page where you filled the list box and these values are the same that the user introduced. The listbox and

R: repost: validator retrieving data

2004-02-06 Thread Leonardo Francalanci
When an error occur, it doesnt return to preprare action. It just back to the page selected in the tag input (input=/prepare.jsp ) You dont need to write code like this... if (!comingFromAValidationError()) form.fillfromDB(); else // leave form as is, with data entered by the user }

R: repost: validator retrieving data

2004-02-06 Thread Leonardo Francalanci
Ok, I understand you... Let me I think it... I found 2 solutions so far: 1) hidden field in the form (extending a Form that has an hidden field and extending an action that has a method like isComingFromAValidatorError() that looks for the value of the hidden par) 2) If the request is a GET

repost: validator retrieving data

2004-02-05 Thread Leonardo Francalanci
I'm sorry but nobody answered my question... Could somebody help me? I'm using validator for my pages. Searching the mailing list I found that I should use 2 actions: If there are 2 actions, one to prepare the page and one to process the user input, we define the input attribute value of the

R: repost: validator retrieving data

2004-02-05 Thread Leonardo Francalanci
} Regards Anant -Original Message- From: Leonardo Francalanci [mailto:[EMAIL PROTECTED] Sent: Thursday, February 05, 2004 5:44 PM To: [EMAIL PROTECTED] Subject: repost: validator retrieving data I'm sorry but nobody answered my question... Could somebody help me? I'm

R: repost: validator retrieving data

2004-02-05 Thread Leonardo Francalanci
().equals(abcErrorShow)){ Populate data from form bean itself } Regards Anant -Original Message- From: Leonardo Francalanci [mailto:[EMAIL PROTECTED] Sent: Thursday, February 05, 2004 5:44 PM To: [EMAIL PROTECTED] Subject: repost: validator retrieving data I'm sorry but nobody

R: R: R: request attributes and failed validation

2004-02-03 Thread Leonardo Francalanci
It's is not there the first time. Only when it's been sent there by way of a failed validation via the input=/showForm.do attribute. But you did not specify the form for the showForm action, did you? Because if you specify it, the controller creates one for you before the call to execute(..)

R: request attributes and failed validation

2004-02-02 Thread Leonardo Francalanci
Using an Action as input sometimes takes more work. Your action should know that it's only redisplaying a form and not reset all form values (or else the user will have to reinput everything instead of just correct the validation error). How do you usually do this? Using an hidden

R: R: request attributes and failed validation

2004-02-02 Thread Leonardo Francalanci
I think that the form is added to the request before the call to execute(..). Are you sure that (request.getAttribute(myForm) != null) is not true the first time you call the page? -Messaggio originale- Da: Ian Joyce [mailto:[EMAIL PROTECTED] Inviato: lunedi 2 febbraio 2004 13.09 A:

validator retrieving data

2004-01-30 Thread Leonardo Francalanci
I'm using validator for my pages. Searching the mailing list I found that I should use 2 actions: If there are 2 actions, one to prepare the page and one to process the user input, we define the input attribute value of the process action mapping to be the URL of the prepare action. I think

reload struts config

2004-01-23 Thread Leonardo Francalanci
I wrote a servlet to trigger off a reload of the struts-config.xml. The servlet is: protected void doGet(..) { ActionServlet as = ((ActionServlet)request.getSession().getServletContext().getAttribute(Global s.ACTION_SERVLET_KEY)); as.destroy();

[OT?]Tomcat multiple users developing

2004-01-21 Thread Leonardo Francalanci
Hello, we are 3 developers currently developing a web site with struts. The problem we are facing is that every time a user makes a change to the code or to the struts.xml he has to reload the application: this involve a great loss of time. I'd like to know: 1) How do you share the same

R: [OT] JNDI datasource lookup to test classes

2003-08-23 Thread Leonardo Francalanci
The most common solution to this problem is using a Factory Method to return the correct implementation of the interface. Your classes should never know which implementation is in use because they will all ask the Factory Method for the object. You just need to change the one line in the

[OT] JNDI datasource lookup to test classes

2003-08-22 Thread Leonardo Francalanci
In my DB tier I use an interface to get the connection. When used under Tomcat, the class that implements the connection gets the connecton through JNDI. I want to test these classes outside of Tomcat. Is there a simple way to put objects in the Context, I mean a simple way to emulate Tomcat

R: Velocity Tiles

2003-01-31 Thread Leonardo Francalanci
Just wondering, is it possible to use Tiles Velocity together? I guess the question could just be, does Velocity permit you to import JSP tag libraries? The only way I found is using VelTag. Look at http://jakarta.apache.org/velocity/veltag.html

Authentication

2003-01-20 Thread Leonardo Francalanci
An important issue in web-appications is authentication. Is there a way to handle authentication in an automatic fashion, for example in the struts-config, like: action path=/query_params forward=/query_params.jsp