Struts action not triggering - struts2

I was working/using in the application for long time and today when i tried to fix some issues struts 2 action is not responding. I have faced the same issue in some other application, long time back and did some setup in Eclipse / Tomcat which allocation struts 2 action to get triggered. I could see the queries running in the backend after login, for the first landing page.
Tolls / Technology stack that i am using,
Struts 2.0, Display Tag, Eclipse, Tomcat
Any guess what could be that configuration? It may be filter / proxy / Something else. I couldnt recall that.

Related

Grails 3.3.10 and strange behavior in the URLs

I'm developing an application using Grails 3.3.10 using Spring security plugin but I'm getting very weird behavior, when I run the application using -https for instance I finished editing the Profile in the edit.gsp here its URL https://localhost:8443/profile/edit/1 and I press Update so it will suppose to take me to the index.gsp but the URL I get is http://localhost:8080//profile/index as you can see the URL isn't https and there is extra / by the way this is happing in a lot of the views.
What is the reason for this behavior
I figured out what is the cause for this weird behavior i found in config file application.yml, the property grails.serverURL was configured twice ,so i commented them and everything worked fine

Cannot create a session after the response has been committed - PrettyFaces MultiPageMessagesSupport on Glassfish4

I have a Java EE app where I use JSF2 + PrettyFaces + EBJ3 + Glassfish
I just recently updated to Glassfish4 which is the default Server implementation for Java EE 7 and I started getting issues with PrettyFaces.
I have configured on my faces-config.xml:
<lifecycle>
<phase-listener>com.ocpsoft.pretty.faces.event.MultiPageMessagesSupport</phase-listener>
</lifecycle>
to enable for Faces Messages to be passed around correctly and displayed on screen.
But since I upgraded from Glassfish3 to 4 I started getting this issue:
java.lang.IllegalStateException: Cannot create a session after the response has
been committed
...
at com.ocpsoft.pretty.faces.util.FacesMessagesUtils.saveMessages(FacesMe
ssagesUtils.java:56)
at com.ocpsoft.pretty.faces.event.MultiPageMessagesSupport.afterPhase(Mu
ltiPageMessagesSupport.java:66)
If I remove the listener from faces-config.xml none of the Faces messages are displayed on screen.
I am using PrettyFaces to have nice well formatted URLs to enhance SEO on my site. I wish I couldn't have to replace it or refactor my app to not use it since I already mapped a lot of the navigation flow using it. Does somebody know a better option for this scenario?
I really appreciate any suggestions. Thanks.
I don't recommend to use MultiPageMessagesSupport if you are deploying to a "modern" container with JSF 2.2 support. The MultiPageMessagesSupport phase listener has been developed for JSF 1.x. JSF 2.x added support for persisting messages across redirects. Just execute this code before redirecting:
FacesContext.getCurrentInstance().getExternalContext().getFlash().setKeepMessages(true);

Primefaces fileUpload working locally but not on server

I have developed an application which allows the user to upload a file.
I am using Primefaces 2.2RC2 / JSF 2.0 / Tomcat 6 / Firefox
Everything works great when I am running it through my local server. When I push it to my live server the entire application freezes when I attempt to upload. An authentication window appears which causes it to freeze.
The upload works fine in IE which seems ridiculous.
I am not very savy when it comes to server configuration and permissions but I am assuming that this issue is probably a permissions problem.
EDIT More information
I am not storing the file locally or anything, I am just using the FileUploadEvent and then getting the contents of the file and storing it to a database like so:
public void upload(FileUploadEvent event) {
byte[] file = event.getFile().getContents();
...
myDao.uploadFile(file);
}
There are no errors in the error logs so I can't even start to track down what is going on, it just locks up.
From doing some research it looks like this Flash bug is causing the problem.
https://bugs.adobe.com/jira/browse/FP-1044
Does anyone know a work around?
On a side note: Can anyone recommend another way of uploading files using Tomcat 6, JSF 2.0 ? Using primefaces was one of the only solutions that I have found for my configuration. Thank you.
#BalusC
I you are correct in that it is a Firefox issue. Anyway what is primefaces file upload is using the SWFupload flash component. For some reason the cred's are not POSTed when the SWFupload component posts back to the page. I have not found much of a work around other than to not use SWFupload. Since primefaces does not offer another option for fileUpload I will have to wait for Primefaces 3 I guess.

Server application unavailable in a MVC2 application over IIS 6

I created an application pool, and i assigned to it a test application(simple 1 view that renders hello, one action and one controller ) that i made in MVC
The thing is that when i executes as many times as i want it works, but after some hours (i dont know why), if i enter again into my server and i execute it, crashes.
The thing is that the only user that executes this application is me. Im wondering the following:
Are in IIS 6 any default setting that says something like: "Pool, shutdown if there arent request during certain amount of time"?
Thanks in advance.
Best regards.
I found the problem.
In the application pool there wasn't only one application, there were two.
The first one, configured to run on asp.net 2.0, and the other (my test application configured to run on Asp.net 4.0). Every time I reset the pool and execute one application, the other crashes.
The solution: All the applications running on the same application pool should be configured to run in the same version of asp.net

Liferay - Struts2 Portlet sample

I am working with struts2 portlet sample and deployed in liferay portel using liferay server. It is working fine. But now I am trying to validate my form even that working perfectly for first time. But after first attempt when form is submitted with desired values it is not proceedin further and not recogonizing the desired action too.
Can anybody helm me in this issue.
Thanks in advance
We have the same setup and have had numerous problems with making struts 2 work nicely with the portlet api. We had the same problem as you early on. Are you using the bridge provided with the struts 2 distribution?
One thing that doesn't work with the bridge is chained actions - you can't have an action that redirects to another action. We did som coding of our own to solve it where the action classes figures out which action that is next. (Our application is a step-by-step guide where steps are included or not dependings on what you have entered previously.)
You might put some break points in PortletStateInterceptor and verify that your action state is getting save and then restored. Note that in portlets there is an action phase and a render phase and if you find the DirectRenderRequest action on the top of the stack instead of yours then you're probably not saving the valuestack state during the action phase.

Resources