Vijay Ganapathy

Greenhorn
+ Follow
since May 23, 2012
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 Vijay Ganapathy

Maybe you need to back up and explain what you are actually trying to accomplish without any decisions as to how to go about it?




What I'm trying to do is pretty usual stuff.
I've a JSP page with a form and a submit button in it. On clicking submit, it takes the form data and posts it to the server(struts 1.1) which in turn invokes a 3rd party web service.
The problem is that when the web service takes some time to respond, the users are quiet often clicking on the submit button more than once which is triggering off more requests.

Now all I wanted to do was provide the users some feedback while blocking the user actions.

I am currently displaying an animated gif on form submit, but once the form is submitted IE is stop the gif animation. So, I thought of AJAXifying the request so that the gif animation could continue.
But in fact, I couldn't do that because I had to show the response in a different JSP page that has much more functionality. (I just picked a wrong use case for AJAX).
Also, now, I don't need to do that since I'm able to run the gif animation by displaying the gif once again after the form submit which I'm doing using JQuery. Let me know if you have any better ideas.

This is what I've done:





It's not clear to me what you're trying to do here.



Well.. to display a progress bar to the user on the current page but still the response has to be shown on a different page

This is already a mature struts web app , so I don't want to go around re-engineer a whole lot to display the result in the current page.

So, I'm just wondering if there's a way at all to redirect the response. This might not be possible since all I have is JSP generated HTML in the callback method.
Okay, so, from a flow standpoint

User Click -> Javascript -> AJAX request(server response will not be processed here since callback not implemented) -> Server process -> different URL

Is this correct?
But the UI is going to be painted by whatever the JSP that the struts forwards to, isn't it?

Basically, I'm trying to AJAXify an existing server call(struts 1.1) that in turn invokes 3rd party web services.
When the result comes back , based on current struts config, it is forward to a different JSP.
So, my question is, what is the point of implementing a callback in the calling JSP which will probably never going to get executed?

Here's the scenario:

JSP1 {
<form id="xx">
inputs x, y, z;
</form

<script language="javascript">
function callServer() {
makeAjaxCall();
}
function callback(response) {
//deal with response
}
</html> //end jsp1

But based on what is in struts config, the response is forwarded to a JSP2.
So, what happens to the callback(response) in JSP1?
JSP2
I'm new to AJAX and trying to understand the concept.

I've a struts 1.1 action class that takes its input , does some biz op and returns a mapping.findForward("success or failure").

Now, when I invoke the struts action via AJAX , I also provide a callback which will invoked upon server returning a response. I want to understand what happens when the server responds, because, based on the struts configuration xml, the response will be forwarded to the corresponding JSP. If thats the case, whats the use of the callback method? Should I ignore that?

Thanks

Vijay
I've a wsimport generated class from a WSDL as follows:

I'm pasting the schema from the comments in the generated class.


Obviously as you can see from the above schema, the element name is Errors and it will contain sub elements of type of ArrayOfErrorDetail which is nothing but a List<ErrorDetail>. The ErrorDetail is POJO which has a errorCode, errorType and errorMessage.

SOAPUI generates the request as :




while the JAXWS client generates the request as:



I'm creating the ArrayOfErrorDetail object as follows in my code:



And the ArrayOfErrorDetail object is this way:



What am I doing wrong? Please help.
11 years ago

Mohana Rao Sv wrote:https://coderanch.com/how-to/java/BeForthrightWhenCrossPostingToOtherSites



Thanks. I'll keep that in mind
11 years ago

Mohana Rao Sv wrote:Avoid cross posting Access properties from util classes used by Action



Mohana: I understand how ActionSupport works. Please stop giving obvious answers without understanding the question.
AFAIK, coderanch and stackoverflow are different web sites.
Different web sites are visited by different people.
Different people have different levels of knowledge and different opinions.
Please explain to me whats the problem in cross posting.

Thanks
11 years ago

Jimmy Clark wrote:A Struts Properties file should be used for Struts-based classes only. Application classes that are not Struts-based should not be using the Struts Properties file. They should use their own Properties file instead.



Thanks for your reply. So, should I be using a different framework for loading the application properties?
Like Apache commons or Resourcebundle.
I guess, my question is ActionSupport sounds more specific to an Action, is there a generic component within struts that can load not only struts properties, but also application properties.
I'm pretty comfortable and happy that I didnt have to do addl. coding to load props because of ActionSupport but just a little inconvenient to have every class either extend ActionSupport or implement another mechanism to load properties. Does it make sense?

11 years ago
Hi everyone,

I just want to know if there's a way to access the properties from a utility class used by an Action class. To access the properties from an Action class we extend the ActionSupport and use the getText("property.key.name") method.
So, my question is -should every other class extend the ActionSupport to access properties, even though its not an Action class? or is there any other way?

Thanks
Vijay
11 years ago
did no one run into situation before. I'm stuck with this. Have tried various OGNL expressions to do this with no luck!
11 years ago
Hi All

I'm new to struts2 and I'm trying to retrieve a session object using a dynamic session key.

My app flow is like this: User will hit the action from their browser -> http://localhost:8080/prjcr/pad.action?userid=p02585@test.org

In the action class, I retrieve a list of values from a web service using p02585@test.org request param and store them in the session as follows:



Extract userid part of the request parameter to be used as the session key


and then push the associated list of values into session



and forward to a JSP that displays this list in a select drop down as follows:



I've tried to pull the qdList from the session in jsp using a dynamic session key which is the userid.
In java, we do it as session.get(userid). I am not able to get in terms with the OGNL notation yet. So, I dont know how to do it in Struts2/OGNL.

I've tried diff. variations of with no luck. Can someone please help?

Thanks in advance
Vijay
11 years ago
Hi,

I'm new to struts2 and I'm trying to populate a drop down on load of a JSP page. I learned that we can do this using <s:select> tag backed by a list member variable with getters/setters in the Action class.
Something like this:

Here's the POJO


Here's the Action class


I get the loggedInUserId parameter as a URL param in the JSP.
How do I pass that parameter to the populate method in TestAction?
What should be the corresponding struts.xml configuration and so on?

Any sample code is appreciated.

Thanks in Advance
Vijay
11 years ago