Yiorgos Panayiotakis

Greenhorn
+ Follow
since Jul 17, 2009
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Yiorgos Panayiotakis

The thing is that I use the execAndWait interceptor of struts2, and I want to remove this annoying 'blink' effect that goes with using the
meta refresh tag. So for this purpose I do have to use Ajax to poll the server when the response is ready. Because the response is either
the wait page or the actual results when process completes, the status code is always 200. Also there is no URL, because response is generated
dynamically, only the data exist which I want to present to the user somehow.
Unfortunately I have to deal with the entire HTML response and not just the content. I have to replace the whole current html page with a
new one provided by the server.
Hi all,

I 'm having a problem that I don't know how to deal with it. I want to make an ajax function, which polls for a server response.
Problem is that the response is dynamically constructed and the server returns an html page, which is either the wait page when
process has not yet completed, or the results page when process completes. I want to know, how can I show user the html page
returned to me. I tried using document.write but this does not seem to work. Here is the sample of the code I am using:

Thanks.
Hi,

I have an issue in my code that I can't resolve and I would appreciate your help.
I am using the struts2 execAndWait interceptor when I submit a form on my site.
Below is the relevant struts.xml snippet



The problem I have, is that when I submit my form via POST and produce
some results then if I try to refresh the results page (results.jsp) those data previously
send via POST do not exist anymore, so I'm redirected to the wait page and
finally because data do not exist to an error page (that does not happen in
Firefox where data somehow are preserved in refresh). Obviously data are erased
the first time the wait page is auto-refreshed. FYI here is a simplified version
of my wait.jsp



I could solve this problem by using includeParams="all" in s:url (as seen above) when
refreshing wait page but then the data are seen in the URL (aside the fact that there is
a ton of data).Also, when data are not latin characters then after the first refresh the
character encoding in URL fails, so cannot be used later for repeating the request with
refresh (e.g. ProcessTripForm.action?originCity=Ηράκλειο is becoming after the first
refresh ProcessTripForm.action?originCity=%26%23xCE%3B%26%23x97%3B%26%23xCF%3B
%26%23x81%3B%26%23xCE%3B%26%23xAC%3B and continues to expand).

My question is how can I preserve data when I use the execAndWait interceptor and use a
POST request in a way that when I'm on result page and hit refresh the same request will
be repeated?
If that is not possible, and I have the data on my URL via GET and includeParams then what
do I have to do so encoding does not fail ?
13 years ago
Yes I'm aware of that, but I use struts2 (2.0.14) (which as far as I know lacks of that functionality) and I
hesitate to upgrade to struts2.1, cause of the problems luring in such a transition.

So to be more specific, my question is how can I achieve extension-less actions in struts2.0.x?

Thanks.
14 years ago
How can I rewrite the URL produced by Struts2, so that I can remove .action extension from url.
For example consider the URL below:

I would like to be converted to

I tried struts.action.extension="/" or "" but that does not seem to work.
Also tried to use URLRewriteFilter but also without any success. Has anybody
faced this problem before ? And can anyone point me to a solution for this
problem?

Thanks.
14 years ago
Thank you very much Marty for the info.

I 've seen the first link before and used that info to supress the errors, with a statement like the one below:

but I'm not sure if this is the correct way to go, since I cannot be sure that this"intervention" does not affect the token after the redirection.
14 years ago
I am using the tokenSession interceptor for Struts2(2.0.14) using the token tag (s:token) in my forms in order to restrict double submits of a page. Though
the interceptor seems to work (because I do no get an invalid.token error), I am getting the following error :



which I suspect it has to do with the fact that I use the type = RedirectAction in my action results (struts.xml). Do I need to configure something in order to work?
How can I eliminate the errors above ? Below is my struts.xml, the action code does nothing just returns success for the moment.



Thanks.
14 years ago
Actually I found the problem related with question 1. I had to add an id attribute to s:action tag, which I
then used to access my property. Hence the new (corrected) code (just in case anybody stumbles to the
same problem) is :
14 years ago
Ok you are probably right maybe I have to elaborate a bit to give you a better understanding of what I'm
asking.

In question 1 what I want is to use the s:action tag to provide me with the data to populate a drop-down
list. To be more specific I want to populate a drop-down list with a number of Countries. For this purpose
I created an action (populateCountryList) that its sole purpose is to supply me with the List of Countries
(see code snippet below).


Now in the header of each of my pages I have the code



which fails to populate the drop-down list. Correct me if I am wrong but shouldn't the Countries property be
available on the ValueStack after I used the s:action tag ?

For the second question imagine that while the user changes the Language I want some code to be executed
(so I have to provide some action to the form) and then return to the current page that initiated the submission
of the form . Because this form is in the header page (which is included in several pages) I want to know if
there is a way to tell struts (through struts.xml) to execute an action and then return back to the same page
that initiate the request.

Thanks
14 years ago
Hi,

I'm just getting started with Struts2 and I have some questions regarding the usage of the framework.
I want to use the s:action tag to populate a select drop-down list but it does not seem to work. I read
the documentation regarding the s:action tag and I cannot find what am I doing wrong. Are there any
examples of s:action usage to point me to (apart from the extremely trivial ones) ?

Also another issue I have is how can I submit a form to the current page the user is. For example I
have a drop-down list from which the user selects the language he wants, and then submits the result.
I want the user after the submission of the form to be redirected to the same page he was. How can I
achieve that using action mapping on the struts.xml ?

Thanks in advance
14 years ago
I have a rather common problem I think. I want to retrieve my Entity's next (auto-incremented) id without actually persisting the entity.
How is this possible to retrieve an auto increment key before persisting to the database ?

Do i need to use any special annotation on the Entity's id for this purpose ?

Btw I'm using mysql 5 as the underlying database.
Hi,

I also have the same issue here. Though when I'm creating the object relation mapping I use cascade=CascadeType.ALL,
somehow when auto-generating the new database schema cascade types (e.g. update,delete) are set to restrict, although
no errors are presented during the process of generating the schema and the foreign keys relations are created correctly.
Here is a small snippet of how my code looks like.

Entity A (AnotherEntity)


Entity B(EventType)


I'm wondering if anybody has any idea about the problem I'm facing. Btw I'm using JPA - hibernate ddl-generation on mysql 5 and
deploy on jboss 4.2

Thanks in advance for the help

--
y.p.