Solved

For ldbkutty regarding a method.

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
bean mapper frameworks 5 59
Coldfusion 10 - JSP File Not Found - 404 Error 5 85
TreeSet comparator example 7 90
How to Make JSP Pages Responsive ? details are below 3 594
Some code to ensure data integrity when using macros within Excel. Also included code that helps secure your data within an Excel workbook.
A simple overview of the possibilities of using technology for project management.
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.
Both in life and business – not all partnerships are created equal. As the demand for cloud services increases, so do the number of self-proclaimed cloud partners. Asking the right questions up front in the partnership, will enable both parties …

863 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

23 Experts available now in Live!

Get 1:1 Help Now