source a request.getParameter in method

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;
}
%>
894359Asked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
petmagdyConnect With a Mentor Commented:
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
 
kiranhkCommented:
is the request coming to this jsp from another jsp?? if yes, check if the other jsp is setting a parameter lang??
0
All Courses

From novice to tech pro — start learning today.