[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

source a request.getParameter in method

Posted on 2004-10-28
2
Medium Priority
?
206 Views
Last Modified: 2010-04-01
Hi,
I'm new to all this, but  I want to source a param in this but it errors on the request.getParam.
What do I need to do??

<%!
// Builds include filename for localization
private String includeLocArrays() throws Exception {

      String inc_name = "test";
      String fileExt = ".inc";
        String countryCode = request.getParameter("lang");

      if (countryCode == null){
            countryCode = "-DA";
      }
            
      inc_name += countryCode + fileExt;
       return inc_name;
}
%>
0
Comment
Question by:894359
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 8

Expert Comment

by:kiranhk
ID: 12438383
is the request coming to this jsp from another jsp?? if yes, check if the other jsp is setting a parameter lang??
0
 
LVL 13

Accepted Solution

by:
petmagdy earned 2000 total points
ID: 12438419
transfer this function to a Java Class

Class MyUtil
{
 public String includeLocArrays(HttpRequest request) throws Exception {

     String inc_name = "test";
     String fileExt = ".inc";
        String countryCode = request.getParameter("lang");

     if (countryCode == null){
          countryCode = "-DA";
     }
         
     inc_name += countryCode + fileExt;
      return inc_name;
 }
}

and then call it from ur Jsp
0

Featured Post

Enroll in October's Free Course of the Month

Do you work with and analyze data? Enroll in October's Course of the Month for 7+ hours of SQL training, allowing you to quickly and efficiently store or retrieve data. It's free for Premium Members, Team Accounts, and Qualified Experts!

Question has a verified solution.

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

An overview of cyber security, cyber crime, and personal protection against hackers. Includes a brief summary of the Equifax breach and why everyone should be aware of it. Other subjects include: how cyber security has failed to advance with technol…
This month, Experts Exchange sat down with resident SQL expert, Jim Horn, for an in-depth look into the makings of a successful career in SQL.
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…
Suggested Courses

650 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