I have an base action class with is an abstract class extending the Sruts Action class. In my base action class i have different methods. Few of the methods has got ServletRequest and ServletResponse as parameters. But one method has got only the request object and bean object as parameter.
Firstly i would like to know if i can get the response object in this method without changing the signature of the method? because i need the response object to flush the XML to my jsp page as part of YUI Autocomplete.
Secoondly i would like to know why i cannot print my XML page in JSP using out.println(). The obtained XML is converted to String and am trying to flush the String, but not happening.
Code like this makes me crazy:Why should I have to read ~ ten lines when ~ two would do?Or if you're anti-ternary:Less cognitive overhead: I don't have to keep reading to find out if anything else important happens.
What's the "userId" local for? It's set, then never used again.
Why differentiate between commandSessionName being null or not? The call to doExecute(inputDTO) just delegates to a call using null anyway, so why bother checking?Half the lines, and removes the extraneous bits that don't actually do anything. Just sayin'... keep it clean.
Joined: May 31, 2010
Thanks for the advise. I am new comer in posting forums. I will make the necessary changes as advised. Please let me know if can get the response object in the postExecute(). I tried converting the xml to string and setting the string as request attribute.
In my JSP page am getting the request attribute and using response object of JSP i am trying to print the XML but in vain.
I am facing a autocomplete problem solving. actually i have a selection box and text box in jsp. after i selecting some value from selection box i want show the autocompleted values in text box. my flow is one jsp, servlet, DAO and DTO.