Solved

For ldbkutty regarding a method.

Posted on 2004-09-17
3
201 Views
Last Modified: 2010-04-01
When I call the method:

    public String getCookieValue(HttpServletRequest request, String cookieName) {
        Cookie[] theCookies = request.getCookies();
        if (theCookies != null) {
            for (int i =0; i< theCookies.length; i++) {
                Cookie currentCookie = theCookies[i];
                if (currentCookie.getName().equalsIgnoreCase(cookieName)) {
                return currentCookie.getValue();
                }  
            }  
        }
        return null;
    }

I get an error:

getCookieValue(javax.servlet.http.HttpServletRequest,java.lang.String) in user.UserData cannot be applied to (java.lang.String)

I am calling it like this: String u = ud.getCookieValue("username");

Any ideas?

I am hoping that ldbkutty has the answer, I owe him the points.

ldb, if you don't know the answer, let me know so I can get you the points I owe you.
0
Comment
Question by:k41d3n
  • 2
3 Comments
 
LVL 35

Accepted Solution

by:
TimYates earned 500 total points
ID: 12084784
> String u = ud.getCookieValue("username");

String u = ud.getCookieValue( request, "username" ) ;
0
 
LVL 35

Expert Comment

by:TimYates
ID: 12084947
And you should post a comment for 0 points here:  http://www.experts-exchange.com/Community_Support/

Asking for that other question to be re-opened so you can allocate the points correctly...  Unfortunatly, it is EE policy that you cannot give more than 500 points for a question, so a "points for" question isn't allowed :-(
0
 
LVL 10

Expert Comment

by:kupra1
ID: 12133599
Buddy... That was a trivial mistake. You need to match the signature.
TimYates is absolutely correct.
0

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
EJB MDB example 4 76
struts exact match support 3 45
struts spring hibernate example 12 86
instanceof  operator in java 26 72
Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
Is your company's data protection keeping pace with virtualization? Here are 7 dynamic ways to adapt to rapid breakthroughs in technology.
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now