Skip to Content
avatar image
Former Member

Problem with a jsp script

Hi everybody,

I'm trying to write a JSP script, that redirects to a website depending on a given parameter (Language). Therefore I made an abstract portal component with the developer Studio and exported this as a par-file.

The problem is that I always getting an this error when I'm testing the script:

Error occurs during the rendering of jsp component.

This is my jsp-code:

<%

String lang = (String) request.getParameter("lang");
String url;

if ("de".equals(lang))
{
    url = "http://www.google.de";  
    response.sendRequest(url);
}
else
{
    if ("en".equals(lang))
    {
        url = "http://www.google.com";
        response.sendRequest(url);
    }
    else
    {
        url = "http://www.google.es";
        response.sendRequest(url);
    }	
}

%>

and this is my portalapp.xml:

<application>

<application-config>

<property name="ServicesReference" value="" />

<property name="releasable" value="true" />

</application-config>

<components>

<component name="Redirect">

<component-config>

<property name="ComponentType" value="jspnative" />

<property name="JSP" value="pagelet/redirect.jsp" />

<property name="SafetyLevel" vaule="low_safety" />

</component-config>

</component>

</components>

<services />

</application>

I'd really appreciate it if anyone could help me out.

Thank you very much in advance

Regrads

Norbert

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

5 Answers

  • avatar image
    Former Member
    May 16, 2006 at 03:18 PM

    Hi Norbert,

    Could you please paste the log trace file here.So that I can tell you the appropriate error occurred.

    To get the log trace file.

    Login to portal->Java Development->Log viewer->Search for your exception ID.->open the particular log file->paste the particular log trace here.

    Regards,

    Karthick Eswaran

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    May 16, 2006 at 04:36 PM

    Hi Norbert Stroh,

    If you dont have java developer role you will not get Java Development Tab in your portal.

    So go to System Administration->Support->Support Desk->Portal Runtime->Log Viewer->Here you can find your trace file by pasting your Exception id.

    Regards,

    Karthick Eswaran

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    May 16, 2006 at 04:41 PM

    Hi Norbert,

    The other way of finding out the log file is remote login to your portal desktop.

    go to <drive>->usr-><instance id>->j2ee->cluster->server0->log->here you can find out all the log files.

    The problem is because of error occurred in JSP that you have written.Its giving error when it is being compiled.

    So kindly check the log files and revert back.

    Regards,

    Karthick Eswaran

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    May 17, 2006 at 04:06 AM

    Hi Norbert

    Have u created Abstract portal component or JSPDynpage?

    Can u post your complete code?

    Regards

    Yoga

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Hi Norbert,

      It should be able to identify sendRedirect method if you import HttpServletResponse in your JSP.

      Login to the portal->Portal browser->/->/->work/pagelet->_sapportalsjsp_redirect.java

      Browse the portal and copy the whole sapportalsjspredirect.java and paste it in any of your IDE/Editor and check whether HttpServletRequest and HttpServletResponse are imported properly.

      And find out the proper error in that java file line number 87 and 92.

      Now I think you can identify the problem.

      Regards,

      Karthick

      Please award points for helpful answers.

  • avatar image
    Former Member
    Nov 08, 2006 at 10:44 AM

    The problem is this:

    The response object is some sap specific response object and not the expected HttpServletResponse! The response object you have simply does not offer any redirect method.

    For the same reason you should not use pageContext.getResponse() in tags because you will get null. Of course, this effectivly makes it impossible to use most tag libs because some tags depend on the response object.

    Add comment
    10|10000 characters needed characters exceeded