Solved

For ldbkutty regarding a method.

Posted on 2004-09-17
3
208 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

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
java.util.concurrent.Callable way of creating threads 2 110
HTML5 vs JSP - REST based application development 4 1,216
Suggestion on WebSite Template Sites 6 108
jsp error 6 26
With User Account Control (UAC) enabled in Windows 7, one needs to open an elevated Command Prompt in order to run scripts under administrative privileges. Although the elevated Command Prompt accomplishes the task, the question How to run as script…
A project that enables an administrator to perform actions within a user session context not just at the time of login but any time later on day(s) or week(s) later.
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

828 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