Bear Bibeault wrote:Correct it by getting rid of it. Authentication checking of this type should be done in a filter that you write and declare once.
The Sun Certified Java Developer Exam with J2SE 5: paper version from Amazon, PDF from Apress, Online reference: Books 24x7 Personal blog
Andrew Monkhouse wrote:Filters can work on the data coming into your web application, or on the data leaving your web application. As such they can be used for such things that are common to all your code such as security on the way in, and setting the correct header information on the way out (although there are often better ways to do the later).
I would recommend a good book on developing for the web, such as Head First Servlets and JSP. Failing that, you might want to look at the Sun Java Servlet Technology tutorial, or a specific article on The Essentials of Filters.
Farakh khan wrote:I tried a lot but invain. Kindly help me to correct this method
David Newton wrote:
Farakh khan wrote:I tried a lot but invain. Kindly help me to correct this method
Farakh khan wrote:
David Newton wrote:
Farakh khan wrote:I tried a lot but invain. Kindly help me to correct this method
BUMP!!
Error:
Cannot find symbol:
-- Attributes
-- StringUtils
Shall I have to import some packages?
I tested by imorting java.util.* but not works
Please help me again. copy paste what am doing
Best Regards
David Newton wrote:...
Obviously you'd need to adapt it to your own environment.
David Newton wrote:Nobody here is going to write your code for you. I showed you one way to fix your method, including using a constant to define the attribute name, and using a third-party library to do the null/empty check. To be honest, I expected the code I wrote to be self-explanatory--I'm kind of at a loss to explain it any further without doing *all* your work for you, which is something we really try not to do here.
David Newton wrote:I wrote the method the way *I* would have written it (well, with the caveat that this isn't how I'd do it). Obviously since I'm writing it the way *I* would write it I used the techniques and libraries *I* would use. You're not using them. So replace the stuff that you *don't* have with the stuff you *do*. It's really clear what the intent of the code I used is, or at least it *should* be.
Nothing? Or something? Like this tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
|