Bug in HttpServletRequest

Bug in HttpServletRequest
I came across this bug when I was developing my project on OC4J which is latest Orion.
I store the HttpServletRequest object in session
(Set Request is called com.evermind.server.http.EvermindHttpServletRequest@1bfb30)
and when I retrieve it later I get
(Previous request got from constants com.evermind.server.http.EvermindHttpServletRequest@1bfb30)
which is correct but problem start when I called getParameterNames() on this object.
When I make call
Enumeration enum = req.getParameterNames();
and I print this object in else I get
Request Element object is not null java.util.Collections$6@52b01b
I think it should return me Enumeration while it gave me Collection. Same code is working on
weblogic but it is giving problem on Orion.
Does anybody have clue or this is a bug.
Code Snippet is
Enumeration enum = req.getParameterNames();
if(enum==null)
System.out.println("Request Element object is " + enum);
else
System.out.println("Request Element object is not null " + enum);
while (enum.hasMoreElements())
System.out.println("Request Element " + enum.nextElement());
}

Hi Ashok,
When I was trying to port the application from weblogic to this ..I came across this.
Though it doesn't give error when I say
Enumeration enum = req.getParameterNames();
but when I print the object it is Collection and if I try to typecast the returned object it throws error. When I print
if(enum==null)
System.out.println("Request Element object is " + enum);
else
System.out.println("Request Element object is not null " + enum);
...I get collection. This problem is strange.
I changed my code and now I doesn't store the HttpRequest in session.(workaround)
Thanking you in anticipation,
regards,
Vijay
null

Similar Messages

  • Bug in HttpServletRequest.getParameter when using anchors (#)?

    When using
    response.sendRedirect("getParameterError_display.jsp?parm1=blurb&parm2=moreblurb#myanchor");
    to redirect to a jsp, a call to getParameter in that JSP for parm2 returns "moreblurb#myanchor" rather than "moreblurb".
    I thought originally that I was building the URL incorrectly but IE5 navigates correctly to the anchor point in my HTML.
    Is this a bug in getParameter or am I doing something wrong?
    Many Thanks, full code below.
    getParameterError.jsp
    <%@ page session="true"
    import="javax.servlet.*,
            java.util.*
    "%>
    <html>
    <head>
    <title>Illustrates problem with request.getParameter and anchors</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    </head>
    <body bgcolor="#FFFFFF" text="#000000">
    <%
        String newURL = "getParameterError_display.jsp?parm1=blurb&parm2=moreblurb#myanchor";
        response.sendRedirect( response.encodeRedirectURL( newURL ) ) ;
    %>
    </body>
    </html>
    getParameterError_display.jsp
    <%@ page session="true"
    import="javax.servlet.*,
            java.util.*
    "%>
    <html>
    <head>
    <title>Illustrates problem with request.getParameter and anchors</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    </head>
    <body bgcolor="#FFFFFF" text="#000000">
    <a href="getParameterError.jsp">try again</a>
    <br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>
    <br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>
    <a name="myanchor">here is myanchor</a>
    <a href="getParameterError.jsp">try again</a>
    <p>The paramaters are:</p>
    <%
            Enumeration e = request.getParameterNames();
            String name;
            String [] values;
            while( e.hasMoreElements() ) {
                name = (String)e.nextElement();
                values = request.getParameterValues(name);
                for(int i=0; i< values.length; i++) {
    %>
                    <%= name + " = " + values%><br>
    <%
    %>
    </body>
    </html>
    Output
    The paramaters are:
    parm2 = moreblurb#myanchor
    parm1 = blurb

    I get the same problem in Tomcat 4.0.1. Fixed it by terminating the param string with "&".
    e.g. instead of
    String newURL = "getParameterError_display.jsp?parm1=blurb&parm2=moreblurb#myanchor"; try
    String newURL = "getParameterError_display.jsp?parm1=blurb&parm2=moreblurb&#myanchor";This worked in IE6 and Netscape 6.2. Hope it works for you.

  • WL 6.1sp1&sp2 BUG: HttpServletRequest.getRequestURL()

              HttpServletRequest.getRequestURL() always returns "http://..." even if the request
              was made with "https://...". The fix is to replace the protocol specification with
              the results from getScheme() like so:
              StringBuffer aURL = request.getRequestURL();
              // broken on WL 6.1 -- need to correct the scheme
              aURL = aURL.replace(0, aURL.toString().indexOf(':'),
              request.getScheme());
              

    Tonna I wrote:
              > Hi there,
              > Which version was this bug resolved in? Is it still outstanding in WL6.1sp4?
              > We?re currently using WL6.1sp2?if it?s resolved in WL6.1SP4 we may consider upgrading
              > instead of putting in a fix.
              >
              > Cheers
              > Tonna
              >
              > Nagesh Susarla <[email protected]> wrote:
              >
              >>thanks for pointing this out!
              >>its indeed a bug
              >>
              >>Steve Ditlinger wrote:
              >>
              >>>HttpServletRequest.getRequestURL() always returns "http://..." even
              >>
              >>if the request
              >>
              >>>was made with "https://...". The fix is to replace the protocol specification
              >>
              >>with
              >>
              >>>the results from getScheme() like so:
              >>>
              >>> StringBuffer aURL = request.getRequestURL();
              >>> // broken on WL 6.1 -- need to correct the scheme
              >>> aURL = aURL.replace(0, aURL.toString().indexOf(':'),
              >>>request.getScheme());
              >
              >
              Yes the fix is a part of 61sp4. If you still have any issues with the
              above mentioned problem, or if you need a patch please contact support
              the associated bug-id : CR076389
              rgds
              Nagesh
              

  • Possible 10.1.2.1 bug

    I have a problem with a 10.1.2.1 generated uix application. I have a master-detail table relationship, lets say Departments -> Employees and have generated corresponding pages (both with table layout style). This generates a DepartmentTable.uix page with uix 'single selection' button to drill down to employees.
    If I select a department (using the radio buttons) and click to drill down to employees it works as expected. However if I navigate next page of departments and click 'employees' I get an error. The error seems to occur when you try to drill down, using the single selection button on a page which does not contain the current row.
    Stack Trace:
    05/08/26 16:49:54 java.lang.NumberFormatException: null
    05/08/26 16:49:54      at java.lang.Integer.parseInt(Integer.java:436)
    05/08/26 16:49:54      at java.lang.Integer.parseInt(Integer.java:518)
    05/08/26 16:49:54      at oracle.jheadstart.controller.strutsadf.action.JhsDataAction.onSetCurrentRowWithIndex(JhsDataAction.java:1595)
    05/08/26 16:49:54      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    05/08/26 16:49:54      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java)
    05/08/26 16:49:54      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    05/08/26 16:49:54      at java.lang.reflect.Method.invoke(Method.java)
    05/08/26 16:49:54      at oracle.adf.controller.lifecycle.PageLifecycle.handleEvent(PageLifecycle.java:544)
    05/08/26 16:49:54      at oracle.adf.controller.struts.actions.StrutsPageLifecycle.handleEvent(StrutsPageLifecycle.java:252)
    05/08/26 16:49:54      at oracle.adf.controller.struts.actions.StrutsUixLifecycle.handleEvent(StrutsUixLifecycle.java:249)
    I hope that description makes sense!
    Any ideas ?

    You are correct. Thank you for reporting this. It is a bug that was introduced with the 10.1.2.1 version. I have fixed it and we will put it on the Supplement Option site soon. In the mean while, if this is issue is bothering you or you just want to quickly test if the fix will work for you, you can create your own DataAction class that subclasses the JhsDataAction, and override this method:
    public void onSetCurrentRowWithIndex(DataActionContext daContext)
    sLog.debug("Executing onSetCurrentRowWithIndex");
    DCBindingContainer bindingContainer = daContext.getBindingContainer();
    if (bindingContainer == null)
    sLog.debug("No binding container (UIModel / modelReference) found.");
    return;
    HttpServletRequest request = daContext.getHttpServletRequest();
    String source = request.getParameter(SOURCE);
    String indexStr = request.getParameter(source+":selected");
    if (indexStr != null)
    int index = Integer.parseInt(indexStr);
    DCIteratorBinding ib = bindingContainer.findCtrlBinding(source).getDCIteratorBinding();
    ib.setCurrentRowIndexInRange(index);
    sLog.debug("Current row index of "+ib.getName()+" set to "+index);
    else
    sLog.debug("No row selected on current page; leaving row currency as is");
    (Lines in bold were added to the original implementation).
    Hope this helps,
    Peter Ebell
    JHeadstart Team

  • Java Servlet BUG (Possibly)-Servlet classname replaces retrieved doc name

    I created a test servlet (TestServlet.java) which reads data from a file which could be pdf/doc/xls/zip etc and presents the file to the user for download. When the user clicks on the save option to save the file the default name before the file extension of the file in the save dialog box is always TestServlet. i.e. If the file being downloaded is BEA.doc the default name in the save dialog box is TestServlet.doc
    The contents of the file(data in the file) are correct but the default name should be BEA.doc and not TestServlet.doc. I get the same result if the file is a pdf/xls or any other file type which is being downloaded.
    We tested this in BEA Weblogic 8.1 and Tomcat and get the same results both places so this issue is not application server specific and seems like a bug to us.
    The TestServlet.java file is below
    package com.test;
    import java.io.*;
    import java.util.*;
    import javax.servlet.http.*;
    public class TestServlet  extends HttpServlet
        private String fileName = "c:/BEA.doc";
        private FileInputStream  rd;
        private ByteArrayOutputStream wr;
        byte[] buf = new byte[8192];    //buffer size
        byte[] fileData;
        public void doGet(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws javax.servlet.ServletException, java.io.IOException
            doPost(request,response);     
        public void doPost(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws javax.servlet.ServletException, java.io.IOException
            int count = 0;
            try
                File theFile = new File(fileName);
                if (theFile.exists())
                    try
                        rd = new FileInputStream(fileName);
                        wr = new ByteArrayOutputStream();
                        while ((count = rd.read(buf)) > -1)
                            wr.write(buf, 0, count);
                        rd.close();                   
                        fileData = wr.toByteArray();
                        response.setContentType("application/msword");
                        OutputStream sos = response.getOutputStream();
                        sos.write(fileData);
                        sos.flush();
                        sos.close();                  
                    catch(Exception ex)
                        System.out.println(ex.getMessage());
                else
                    response.setContentType("text");
                    response.getWriter().write("no data");
            catch (Exception e)
                e.printStackTrace();       
    } I get the same results. i.e. The name of the document downloaded by the servlet is TestServlet.doc instead of BEA.doc which is what I have in c:\BEA.doc.

    The web browser downloading this knows nothing about the file you are loading from disk and sending via the servlet. All it knows is that it requested via Http on the url TestServlet, and is getting something in return.
    A quick google pulled up this link: http://builder.com.com/5100-6370-1027645.html
    You might try this:
    response.setHeader("Content-Disposition","inline;filename=\"BEA.doc\"");
    good luck,
    evnafets

  • HttpSessionBindingEvent.getValue() Bug in OC4J 10.1.2.0.2

    Hello,
    I thing we have found a bug in the implementation of the getValue() method from the HttpSessionBindingEvent Interface. When the HttpSessionBindingListener methods valueUnbound or valueBound are called, the event returned null for the getValue() invocation.
    We have tested the code on oc4j, Tomcat and WebShere Application Server. Only oc4j retuned a null value for an existing object.
    If someone knows that we are wrong, please post your knowledge.
    Greetings
    Carsten E.

    i also faced the same problem. the following are my codes under jdeveloper 9i
    package com.servlets;
    import java.io.IOException;
    import java.io.Serializable;
    import javax.servlet.ServletException;
    import javax.servlet.http.HttpServlet;
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;
    import javax.servlet.http.HttpSession;
    import javax.servlet.http.HttpSessionBindingEvent;
    import javax.servlet.http.HttpSessionBindingListener;
    public class SessionBindingServlet extends HttpServlet {
    public void doGet( HttpServletRequest req, HttpServletResponse res )
    throws ServletException, IOException {
    HttpSession session = req.getSession();
    session.setAttribute( "cone", new KnowAllItem( "snake eyes" ) );
    session.removeAttribute( "cone" );
    res.getWriter().println( "check your console..." );
    * By implementing HttpSessionBindingListener, KnowAllItem objects get
    * informed when they are added and/or removed from a servlet session
    * Also, remember to make you session items serializable
    class KnowAllItem implements HttpSessionBindingListener, Serializable {
    private String id;
    public KnowAllItem( String theId ) {
    id = theId;
    public void valueBound( HttpSessionBindingEvent evt ) {
    System.out.println( "added KnowAllItem to session -> " + dump( evt ) );
    public void valueUnbound( HttpSessionBindingEvent evt ) {
    System.out.println( "removed KnowAllItem from session -> " + dump( evt ) );
    private String dump( HttpSessionBindingEvent evt ) {
    return "\n attribute name: " + evt.getName() + "\n session: " +
    evt.getSession() + "\n attribute value: " + evt.getValue();
    public String toString() {
    return id;
    }

  • RequestDispatcher.forward() bug in WLS61???

    Hi
              attached is a web application called forward that demonstrate a possible
              bug in weblogic 6.1 server.
              Description of the application
              index.html:
              <html>
              <head>
              <title>form</title>
              </head>
              <body>
              <form name="form" method="post" action="forwardServlet">
              <input type="hidden" name="nextPage" size="20"
              value="result.jsp">
              </form>
              <script language="javascript">
              document.forms["form"].submit();
              </script>
              </body>
              </html>
              the index.html of the application just cause the web browser to send a
              request to the ForwardServlet with a parameter nextPage=result.jsp
              ForwardServlet.java:
              import javax.servlet.http.*;
              import javax.servlet.*;
              import java.io.*;
              public class ForwardServlet extends HttpServlet {
              public void service(HttpServletRequest request,
              HttpServletResponse response) throws ServletException,
              IOException {
              RequestDispatcher disp =
              getServletContext().getRequestDispatcher("/" +
              request.getParameter("nextPage") + "?result=kabooom");
              disp.forward(request, response);
              the servlet forwards the request to the nextPage(result.jsp) using
              RequestDispatcher.forward adding to the URI a parameter result=kabooom;
              result.jsp:
              ****<P>
              <%
              String result = request.getParameter("result");
              out.println(result);
              %>
              <P>****
              the jsp just takes the "result" parameter from the request object and
              prints it. However it gets a null instead of the String kaboom
              We use this method of adding parameters in many places in our application
              and it should work according to the API:
              "For a RequestDispatcher obtained via getRequestDispatcher(), the
              ServletRequest object has its path elements and parameters adjusted to match
              the path of the target resource."
              Everything worked fine in WLS5.1
              P.S
              if ForwardServlet.java looks like:
              import javax.servlet.http.*;
              import javax.servlet.*;
              import java.io.*;
              public class ForwardServlet extends HttpServlet {
              public void service(HttpServletRequest request,
              HttpServletResponse response) throws ServletException,
              IOException {
              RequestDispatcher disp =
              getServletContext().getRequestDispatcher("/result.jsp?result=kabooom");
              disp.forward(request, response);
              and not touching the request object itself the result.jsp will display
              kaboom!!!!
              Dror Last
              Senior Software Engineer
              Unisfair Inc.
              12 Yad Haruzim St. Tel Aviv 67778 Israel
              Tel: +972-3-5373738 Ext. 243
              Fax: +972-3-5373731
              GSM: +972-55-723710
              mailto:[email protected]
              http://www.unisfair.com/
              [forward.war]
              

    Yes, SP1 fixes the problem.
              Thanks,
              Beth
              "Ian M. Goldstein" <[email protected]> wrote in message
              news:[email protected]...
              > Service Pack 1 is available now via WebSupport
              > http://websupport.beasys.com/custsupp/
              >
              > Regards,
              > -- Ian
              >
              > "Robert Patrick" <[email protected]> wrote in message
              > news:[email protected]...
              > > Contact BEA technical support...
              > >
              > > Beth wrote:
              > >
              > > > Hi,
              > > >
              > > > We are having this same problem with WL6.1.
              > > > Where do we get this patch? It doesn't appear that SP1 is out yet.
              > > >
              > > > Thanks,
              > > > Beth
              > > >
              > > > "Andrew" <[email protected]> wrote in message
              > > > news:[email protected]...
              > > > >
              > > > > I spoke with BEA about this bug, as we were exhibiting almost the
              > exact
              > > > same behavior.
              > > > > It is definitely a bug, and their engineering department said it is
              > fixed
              > > > with
              > > > > 6.1 SP1 which is due to be released in September. They gave me a
              > patch to
              > > > test,
              > > > > and it did indeed fix this bug.
              > > > >
              > > > > Andrew
              > > > >
              > > > > "Willie" <[email protected]> wrote:
              > > > > >Hi,
              > > > > >
              > > > > >Any update on this one? We are running into the exact same problem
              > and
              > > > > >it is
              > > > > >blocking us from moving into 6.1. The same code worked well in 6.0.
              > Is
              > > > > >this
              > > > > >a WL bug? When is the fix going to be available?
              > > > > >
              > > > > >Thanks!
              > > > > >Willie
              > > > > >
              > > > > >"Dror Last" <[email protected]> wrote in message
              > > > > >news:[email protected]...
              > > > > >> Hi
              > > > > >>
              > > > > >> attached is a web application called forward that demonstrate a
              > > > possible
              > > > > >> bug in weblogic 6.1 server.
              > > > > >>
              > > > > >> Description of the application
              > > > > >> ------------------------------------------
              > > > > >>
              > > > > >> index.html:
              > > > > >>
              > > > > >> <html>
              > > > > >> <head>
              > > > > >> <title>form</title>
              > > > > >> </head>
              > > > > >> <body>
              > > > > >> <form name="form" method="post" action="forwardServlet">
              > > > > >> <input type="hidden" name="nextPage" size="20"
              > > > > >> value="result.jsp">
              > > > > >> </form>
              > > > > >> <script language="javascript">
              > > > > >> document.forms["form"].submit();
              > > > > >> </script>
              > > > > >> </body>
              > > > > >> </html>
              > > > > >>
              > > > > >> the index.html of the application just cause the web browser to
              > send
              > > > > >a
              > > > > >> request to the ForwardServlet with a parameter
              nextPage=result.jsp
              > > > > >>
              > > > > >> ForwardServlet.java:
              > > > > >>
              > > > > >>
              > > > > >> import javax.servlet.http.*;
              > > > > >> import javax.servlet.*;
              > > > > >> import java.io.*;
              > > > > >>
              > > > > >> public class ForwardServlet extends HttpServlet {
              > > > > >>
              > > > > >> public void service(HttpServletRequest request,
              > > > > >> HttpServletResponse response) throws
              ServletException,
              > > > > >> IOException {
              > > > > >> RequestDispatcher disp =
              > > > > >> getServletContext().getRequestDispatcher("/" +
              > > > > >> request.getParameter("nextPage") +
              > "?result=kabooom");
              > > > > >> disp.forward(request, response);
              > > > > >> }
              > > > > >> }
              > > > > >>
              > > > > >> the servlet forwards the request to the nextPage(result.jsp)
              using
              > > > > >> RequestDispatcher.forward adding to the URI a parameter
              > result=kabooom;
              > > > > >>
              > > > > >>
              > > > > >> result.jsp:
              > > > > >>
              > > > > >> ****<P>
              > > > > >> <%
              > > > > >> String result = request.getParameter("result");
              > > > > >> out.println(result);
              > > > > >> %>
              > > > > >> <P>****
              > > > > >>
              > > > > >> the jsp just takes the "result" parameter from the request
              object
              > > > > >and
              > > > > >> prints it. However it gets a null instead of the String kaboom
              > > > > >>
              > > > > >>
              > > > > >> We use this method of adding parameters in many places in our
              > > > application
              > > > > >> and it should work according to the API:
              > > > > >> "For a RequestDispatcher obtained via getRequestDispatcher(),
              the
              > > > > >> ServletRequest object has its path elements and parameters
              adjusted
              > > > > >to
              > > > > >match
              > > > > >> the path of the target resource."
              > > > > >>
              > > > > >> Everything worked fine in WLS5.1
              > > > > >>
              > > > > >>
              > > > > >> P.S
              > > > > >>
              > > > > >> if ForwardServlet.java looks like:
              > > > > >>
              > > > > >> import javax.servlet.http.*;
              > > > > >> import javax.servlet.*;
              > > > > >> import java.io.*;
              > > > > >>
              > > > > >> public class ForwardServlet extends HttpServlet {
              > > > > >>
              > > > > >> public void service(HttpServletRequest request,
              > > > > >> HttpServletResponse response) throws
              ServletException,
              > > > > >> IOException {
              > > > > >> RequestDispatcher disp =
              > > > > >>
              > getServletContext().getRequestDispatcher("/result.jsp?result=kabooom");
              > > > > >> disp.forward(request, response);
              > > > > >> }
              > > > > >> }
              > > > > >>
              > > > > >> and not touching the request object itself the result.jsp will
              > display
              > > > > >> kaboom!!!!
              > > > > >>
              > > > > >>
              > > > > >> Dror Last
              > > > > >> Senior Software Engineer
              > > > > >> Unisfair Inc.
              > > > > >> 12 Yad Haruzim St. Tel Aviv 67778 Israel
              > > > > >> Tel: +972-3-5373738 Ext. 243
              > > > > >> Fax: +972-3-5373731
              > > > > >> GSM: +972-55-723710
              > > > > >> mailto:[email protected]
              > > > > >> http://www.unisfair.com/
              > > > > >>
              > > > > >>
              > > > > >>
              > > > > >>
              > > > > >>
              > > > > >
              > > > > >
              > > > >
              > >
              >
              >
              

  • Cookie bug in WL 8.1?

    I'm trying to retrieve cookies from an HttpServletRequest, but all the cookies return maxAge -1 and domain null. This does not match up with the Firefox cookie viewer which shows the correct values. Is there some known bug here? I'm running WL 8.1 SP6.
              Here's a simple test script:
              <%
              for(int i = 0; i < request.getCookies().length; i++)
                   out.println("name: " + request.getCookies().getName() + "<br/>");
                   out.println("value: " + request.getCookies()[i].getValue() + "<br/>");
                   out.println("domain: " + request.getCookies()[i].getDomain() + "<br/>");
                   out.println("max age: " + request.getCookies()[i].getMaxAge() + "<br/><br/>");
              %>
              FYI, the forums stripped out the array indices. The original code compiles and runs fine.
              Edited by laphroaig at 05/01/2008 3:10 PM
              Edited by laphroaig at 05/01/2008 3:10 PM

    The max age and domain is used by the browser to detemine whether it should send the cookie with the request. These values arent sent along with the cookie . Enable LiveHTTPHeaders on firefox and see what gets sent as the cookie , this is what will get retrieved by the server in request.getCookies(ant it wont have max-age/domain)

  • WL Apache plugin Bug: HttpServletResponce unable to send more the 1 cookie.

    When using apache plugin with weblogic51 on solaris we run into problem when
              trying to send several cookies; only first cookie makes it through Apache
              plugin to the browser.
              public void doGet(HttpServletRequest req, HttpServletResponse res) {
              Cookie z = new Cookie("name3", "value3");
              z.setMaxAge(0xFFFFF);
              res.addCookie(z);
              Cookie z1 = new Cookie("name1", "value2");
              z1.setMaxAge(0xFFFFF);
              res.addCookie(z1);
              PrintWriter outputStream = res.getWriter();
              outputStream.println("<HTML><BODY></BODY></HTML>");
              outputStream.close();
              catch(Exception e) {e.printStackTrace(System.out);}
              Thanks,
              Alex
              

    This appears to be a bug. I suggest sending it as a bug report to our
              support organization.
              (... and the same for your other two posts as well! :-)
              Thanks,
              Michael
              Michael Girdley
              Product Manager, WebLogic Server & Express
              BEA Systems Inc
              Alex Rojkov <[email protected]> wrote in message
              news:8ff9ls$qgu$[email protected]..
              > When using apache plugin with weblogic51 on solaris we run into problem
              when
              > trying to send several cookies; only first cookie makes it through Apache
              > plugin to the browser.
              >
              > public void doGet(HttpServletRequest req, HttpServletResponse res) {
              >
              >
              > Cookie z = new Cookie("name3", "value3");
              > z.setMaxAge(0xFFFFF);
              > res.addCookie(z);
              >
              > Cookie z1 = new Cookie("name1", "value2");
              > z1.setMaxAge(0xFFFFF);
              > res.addCookie(z1);
              >
              > PrintWriter outputStream = res.getWriter();
              >
              > outputStream.println("<HTML><BODY></BODY></HTML>");
              > outputStream.close();
              > }
              > catch(Exception e) {e.printStackTrace(System.out);}
              > }
              >
              > Thanks,
              >
              > Alex
              >
              >
              >
              

  • Weblogic server's bug

              see my code:
              package testpath;
              import javax.servlet.*;
              import javax.servlet.http.*;
              import java.io.*;
              import java.util.*;
              import java.net.*;
              public class Servlet1 extends HttpServlet {
              static final private String CONTENT_TYPE = "text/html; charset=GBK";
              //Initialize global variables
              public void init() throws ServletException {
              //Process the HTTP Get request
              public void doGet(HttpServletRequest request, HttpServletResponse response) throws
              ServletException, IOException {
              response.setContentType(CONTENT_TYPE);
              PrintWriter out = response.getWriter();
              out.println("<html>");
              out.println("<head><title>Servlet1</title></head>");
              out.println("<body>");
              out.println("<p>The servlet has received a GET. This is the reply.</p>");
              out.println("</body></html>");
              try {
              String path=getServletContext().getResource("/WEB-INF/classes/testpath/aa.properties").getPath();
              System.out.println(path);
              FileInputStream fin=new FileInputStream(path);
              catch (MalformedURLException ex) {
              ex.printStackTrace();
              //Clean up resources
              public void destroy() {
              when i debug it within the developing environment(jbuilder7+weblogic6.1),it works
              well,but when i pack it as war file and deploy it to weblogic server,it output
              as follow:
              <2002-8-30 &#19979;&#21320;01&#26102;49&#20998;59&#31186;> <Error> <HTTP> <[WebAppServletContext(5996995,testp
              ath,/testpath)] Servlet failed with IOException
              java.io.FileNotFoundException: E:/bea/wlserver6.1/config/mydomain/applications/.
              wlnotdelete/wl_comp33043.war/WEB-INF/classes/testpath/aa.properties (&#31995;&#32479;&#25214;&#19981;&#21040;
              &#25351;&#23450;&#30340;&#36335;&#24452;&#12290;
              at java.io.FileInputStream.open(Native Method)
              at java.io.FileInputStream.<init>(FileInputStream.java:64)
              at testpath.Servlet1.doGet(Servlet1.java:32)
              at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
              at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
              at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
              pl.java:265)
              at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
              pl.java:200)
              at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppSe
              rvletContext.java:2495)
              at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestIm
              pl.java:2204)
              at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
              at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
              >
              but when i open the directory i find that the correct directory is:
              E:/bea/wlserver6.1/config/mydomain/applications/.wlnotdelete/wl_comp41635.war/W
              EB-INF/classes/testpath/aa.properties
              but if i tell the weblogic print the path,it display:
              E:/bea/wlserver6.1/config/mydomain/applications/.wlnotdelete/wl_comp41635.war!/W
              EB-INF/classes/testpath/aa.properties
              the weblogic add a "!" to the path(after wl_comp41635.war),if i remove the "!",it
              still can't find the path,but when i use "getResourceAsStream(path)",it works
              well,why?
              i think it's a bug of weblogic?
              who have the similar experience?
              

              Change the following lines:
              String path=getServletContext().getResource("/WEB-INF/classes/testpath/aa.properties").getPath();
              FileInputStream fin=new FileInputStream(path);
              to
              InputStream fin = getServletContext().getResourceAsStream("/WEB-INF/classes/testpath/aa.properties");
              Since the property file is archived into WAR, you cannot open it directly as a
              file.
              "Markus Eisele" <[email protected]> wrote:
              >
              >Guess you cannot read a file from a war-file
              >
              >Try expanding your war and deploy again.
              >
              >Greetings
              >Markus
              >
              >"zhebin cong" <[email protected]> wrote:
              >>
              >>see my code:
              >>
              >>package testpath;
              >>
              >>import javax.servlet.*;
              >>import javax.servlet.http.*;
              >>import java.io.*;
              >>import java.util.*;
              >>import java.net.*;
              >>
              >>public class Servlet1 extends HttpServlet {
              >>static final private String CONTENT_TYPE = "text/html; charset=GBK";
              >>//Initialize global variables
              >>public void init() throws ServletException {
              >>
              >>}
              >>//Process the HTTP Get request
              >>public void doGet(HttpServletRequest request, HttpServletResponse response)
              >>throws
              >>ServletException, IOException {
              >>response.setContentType(CONTENT_TYPE);
              >>PrintWriter out = response.getWriter();
              >>out.println("<html>");
              >>out.println("<head><title>Servlet1</title></head>");
              >>out.println("<body>");
              >>out.println("<p>The servlet has received a GET. This is the reply.</p>");
              >>out.println("</body></html>");
              >>try {
              >>String path=getServletContext().getResource("/WEB-INF/classes/testpath/aa.properties").getPath();
              >>System.out.println(path);
              >>FileInputStream fin=new FileInputStream(path);
              >>}
              >>catch (MalformedURLException ex) {
              >>ex.printStackTrace();
              >>}
              >>
              >>}
              >>//Clean up resources
              >>public void destroy() {
              >>}
              >>}
              >>
              >>when i debug it within the developing environment(jbuilder7+weblogic6.1),it
              >>works
              >>well,but when i pack it as war file and deploy it to weblogic server,it
              >>output
              >>as follow:
              >>
              >><2002-8-30 &#19979;&#21320;01&#26102;49&#20998;59&#31186;> <Error> <HTTP>
              >><[WebAppServletContext(5996995,testp
              >>ath,/testpath)] Servlet failed with IOException
              >>java.io.FileNotFoundException: E:/bea/wlserver6.1/config/mydomain/applications/.
              >>wlnotdelete/wl_comp33043.war/WEB-INF/classes/testpath/aa.properties
              >(&#31995;&#32479;&#25214;&#19981;&#21040;
              >>&#25351;&#23450;&#30340;&#36335;&#24452;&#12290;
              >>at java.io.FileInputStream.open(Native Method)
              >>at java.io.FileInputStream.<init>(FileInputStream.java:64)
              >>at testpath.Servlet1.doGet(Servlet1.java:32)
              >>at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
              >>at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
              >>at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
              >>pl.java:265)
              >>at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
              >>pl.java:200)
              >>at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppSe
              >>rvletContext.java:2495)
              >>at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestIm
              >>pl.java:2204)
              >>at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
              >>at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
              >>>
              >>
              >>but when i open the directory i find that the correct directory is:
              >>E:/bea/wlserver6.1/config/mydomain/applications/.wlnotdelete/wl_comp41635.war/W
              >>EB-INF/classes/testpath/aa.properties
              >>
              >>
              >>but if i tell the weblogic print the path,it display:
              >>E:/bea/wlserver6.1/config/mydomain/applications/.wlnotdelete/wl_comp41635.war!/W
              >>EB-INF/classes/testpath/aa.properties
              >>
              >>the weblogic add a "!" to the path(after wl_comp41635.war),if i remove
              >>the "!",it
              >>still can't find the path,but when i use "getResourceAsStream(path)",it
              >>works
              >>well,why?
              >>
              >>i think it's a bug of weblogic?
              >>
              >>who have the similar experience?
              >>
              >>
              >
              

  • 10G Problem with HTTPServletRequests

    Hi everyone, since we put in 10G we have a strange problem with HTTPServletRequests. We use a number of service servlets for loading images and performing data selections etc... Since we put in 10G the HTTPServletRequests seem to get mixed up so that the data selection servlet does not get its proper request but instead the last requrest that was processed by the image selection servlet.
    This is definiteley realted to either a 10G setting that we somehow missed or a 10G bug. When we deploy to the server which runs the old OC4J it works fine and it used to work fine in 9.0.3.
    Any ideas would be appreciated.
    TIA

    Hi everyone, we believe it's a timing issue. We added some logic to dump everything from the HTTPServletRequest to the log which slows down the process. It works much better then and the delay appears to help in getting the proper request to the proper servlet.
    Any comments would be appreciated.
    TIA

  • Specifying Attributes in an HttpServletRequest in JBoss

    I have an application (running on JBoss 3.2.5) storing a number of values as attributes into an HttpServletRequest object for passing to a jsp. One of these appears to be getting lost.
    On closer inspection it appears that the attributes are held in a HashMap and adding an attribute with the name entities is overwriting an attribute with the name transid in the HashMap.
    Since the HashMap is entirely under the control of HttpServletRequest there seems to be no easy way to control this. Is it a known bug?

    Please ignore - misunderstanding on my part of how HashMap represented in Eclipse.

  • Another security bug??

    All,
    I am running Weblogic with SP3. In my web application configured to use
    form-based authentication. In the web.xml file I have:
    <servlet>
    <servlet-name>InfIIPSchedulerServlet</servlet-name>
    <servlet-class>examples.servlets.InfIIPSchedulerServlet</servlet-class>
    <load-on-startup>2</load-on-startup>
    </servlet>
    <servlet-mapping>
    <servlet-name>InfIIPSchedulerServlet</servlet-name>
    <url-pattern>InfIIPSchedulerServlet</url-pattern>
    </servlet-mapping>
    <servlet-name>InfIIPSchedulerServlet</servlet-name>
    <url-pattern>jsp/InfIIPSchedulerServlet</url-pattern>
    </servlet-mapping>
    <security-constraint>
    <web-resource-collection>
    <web-resource-name>iip</web-resource-name>
    <description>Informatica Information Platform (IIP)</description>
    <url-pattern>/jsp/*</url-pattern>
    </web-resource-collection>
    </security-constraint>
    <login-config>
    <auth-method>FORM</auth-method>
    </login-config>
    public class InfIIPSchedulerServlet {
    public void service(HttpServletRequest req, HttpServletResponse res)
    throws ServletException, IOException
    HttpSession session = req.getSession(false);
    res.setContentType("text/plain");
    ServletOutputStream out = res.getOutputStream();
    try {
    if (session == null) {
    out.println("Session is null");
    } else {
    out.println("Session is " + session.toString());
    InfIIPSession ss =
    (InfIIPSession)session.getAttribute(com.informatica.viewer.util.InfHttpSessi
    onNames.USER_IIPSESSION );
    Context context = ss.getContext();
    out.println("<BR>Remote user is ");
    out.println(req.getRemoteUser());
    out.println("<BR>Principal is ");
    out.println(req.getUserPrincipal().getName());
    out.println("<BR>Principal in Context is ");
    out.println((String)context.getEnvironment().get(Context.SECURITY_PRINCIPAL)
    } catch (NamingException ne) {
    throw new ServletException(ne.getMessage());
    After loged in successfully, a welcome page came up. I got the following
    output when invoking the servlet with url
    http://localhost:7001/iip/InfIIPSchedulerServlet
    Session is weblogic.servlet.internal.session.MemorySession@69abf940
    <BR>Remote user is
    dtseng
    <BR>Principal is
    guest
    <BR>Principal in Context is
    dtseng
    With url http://localhost:7001/iip/jsp/InfIIPSchedulerServlet the output
    become
    Session is weblogic.servlet.internal.session.MemorySession@69abf940
    <BR>Remote user is
    dtseng
    <BR>Principal is
    dtseng
    <BR>Principal in Context is
    dtseng
    The difference is that the first url is not a protected resource, while
    the second is. Why req.getUserPrincipal().getName() returns different values
    depending on the context in which is is executed? Is this a security bug?

    I would like to see this feature of the phone given a significant overhaul. Instead of just displaying the dail pad, I'd like to have the choice of programming in certain numbers which could offered for dialing in place of the dial pad being shown for the Emergency call feature. Perhaps upto 10 numbers could be programmed in, so you could add the emergency numbers for your area and any other numbers you think would be useful. Of course, this should be optional so that the user has the choice of only allowing calls to the pre-registered numbers, the display of the numpad or both.
    That way, everyone would be happy, no?

  • Bug? dispatcher chain is empty in http filter EA1

    In JDeveloper EA1 (and DP) we can not call request.getParameter inside a HTTP filter.
    Is it not legal to cast ServletRequest to a HttpServletRequest in the filter? This is production code that works fine i 9.0.4
    The following code:
    public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException {
    HttpServletRequest hReq = (HttpServletRequest) request;
    String cbtDataIn = hReq.getParameter("cbtData");
    Will give you:
    ERROR [ApplicationServerThread-0] (HibernateFilter.java:39) - ERROR IN FILTER
    java.lang.IllegalStateException: dispatcher chain is empty
         at com.evermind.server.http.EvermindHttpServletRequest.getCurrentDispatcher(EvermindHttpServletRequest.java:4154)
         at com.evermind.server.http.EvermindHttpServletRequest.getParameters(EvermindHttpServletRequest.java:1414)
         at com.evermind.server.http.EvermindHttpServletRequest.getParameter(EvermindHttpServletRequest.java:2228)
         at se.sjv.sso.sso.SecurityFilter.doFilter(SecurityFilter.java:57)
         at com.evermind.server.http.EvermindFilterChain.doFilter(EvermindFilterChain.java:15)
         at se.sjv.valhall.hibernate.HibernateFilter.doFilter(HibernateFilter.java:32)
         at com.evermind.server.http.FileRequestDispatcher.handleWithFilter(FileRequestDispatcher.java:135)
         at com.evermind.server.http.FileRequestDispatcher.unprivileged_forwardInternal(FileRequestDispatcher.java:283)
         at com.evermind.server.http.FileRequestDispatcher.access$100(FileRequestDispatcher.java:30)
         at com.evermind.server.http.FileRequestDispatcher$2.oc4jRun(FileRequestDispatcher.java:254)
         at oracle.oc4j.security.OC4JSecurity.doPrivileged(OC4JSecurity.java:274)
         at com.evermind.server.http.FileRequestDispatcher.forwardInternal(FileRequestDispatcher.java:259)
         at com.evermind.server.http.HttpRequestHandler.doProcessRequest(HttpRequestHandler.java:863)
         at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:451)
         at com.evermind.server.http.HttpRequestHandler.serveOneRequest(HttpRequestHandler.java:218)
         at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:119)
         at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:112)
         at oracle.oc4j.network.ServerSocketReadHandler$SafeRunnable.run(ServerSocketReadHandler.java:245)
         at oracle.oc4j.network.ServerSocketAcceptHandler.procClientSocket(ServerSocketAcceptHandler.java:231)
         at oracle.oc4j.network.ServerSocketAcceptHandler.access$1000(ServerSocketAcceptHandler.java:33)
         at oracle.oc4j.network.ServerSocketAcceptHandler$AcceptHandlerHorse.run(ServerSocketAcceptHandler.java:820)
         at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:298)
         at java.lang.Thread.run(Thread.java:595)
    ERROR [ApplicationServerThread-0] (HibernateFilter.java:39) - FEL FÅNGAT AV FILTER
    java.lang.IllegalStateException: dispatcher chain is empty
         at com.evermind.server.http.EvermindHttpServletRequest.getCurrentDispatcher(EvermindHttpServletRequest.java:4154)
         at com.evermind.server.http.EvermindHttpServletRequest.getParameters(EvermindHttpServletRequest.java:1414)
         at com.evermind.server.http.EvermindHttpServletRequest.getParameter(EvermindHttpServletRequest.java:2228)
         at se.sjv.sso.sso.SecurityFilter.doFilter(SecurityFilter.java:57)
         at com.evermind.server.http.EvermindFilterChain.doFilter(EvermindFilterChain.java:15)
         at se.sjv.valhall.hibernate.HibernateFilter.doFilter(HibernateFilter.java:32)
         at com.evermind.server.http.FileRequestDispatcher.handleWithFilter(FileRequestDispatcher.java:135)
         at com.evermind.server.http.FileRequestDispatcher.unprivileged_forwardInternal(FileRequestDispatcher.java:283)
         at com.evermind.server.http.FileRequestDispatcher.access$100(FileRequestDispatcher.java:30)
         at com.evermind.server.http.FileRequestDispatcher$2.oc4jRun(FileRequestDispatcher.java:254)
         at oracle.oc4j.security.OC4JSecurity.doPrivileged(OC4JSecurity.java:274)
         at com.evermind.server.http.FileRequestDispatcher.forwardInternal(FileRequestDispatcher.java:259)
         at com.evermind.server.http.HttpRequestHandler.doProcessRequest(HttpRequestHandler.java:863)
         at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:451)
         at com.evermind.server.http.HttpRequestHandler.serveOneRequest(HttpRequestHandler.java:218)
         at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:119)
         at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:112)
         at oracle.oc4j.network.ServerSocketReadHandler$SafeRunnable.run(ServerSocketReadHandler.java:245)
         at oracle.oc4j.network.ServerSocketAcceptHandler.procClientSocket(ServerSocketAcceptHandler.java:231)
         at oracle.oc4j.network.ServerSocketAcceptHandler.access$1000(ServerSocketAcceptHandler.java:33)
         at oracle.oc4j.network.ServerSocketAcceptHandler$AcceptHandlerHorse.run(ServerSocketAcceptHandler.java:820)
         at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:298)
         at java.lang.Thread.run(Thread.java:595)

    We do not get this problem when we call a JSP file.
    index.jsp - filter is OK
    index.html - filter is not OK - dispatcher chain is empty
    Please tell me that this a bug in OC4J.
    Cheers,
    Rickard Nilsson
    Here is the code and the exception again:
    package web1.view;
    import java.io.IOException;
    import javax.servlet.*;
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;
    public class TestFilter implements Filter {
    public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException {
    try {
    HttpServletRequest hReq = (HttpServletRequest) request;
    HttpServletResponse hRes = (HttpServletResponse) response;
    String cbtDataIn = hReq.getParameter("cbtData");
    String b = cbtDataIn;
    } catch (Throwable t) {
    t.printStackTrace();
    public void init(FilterConfig config) throws ServletException {
    public void destroy() {
    05/11/17 11:54:27 java.lang.IllegalStateException: dispatcher chain is empty
    05/11/17 11:54:27      at com.evermind.server.http.EvermindHttpServletRequest.getCurrentDispatcher(EvermindHttpServletRequest.java:4154)
    05/11/17 11:54:27      at com.evermind.server.http.EvermindHttpServletRequest.getParameters(EvermindHttpServletRequest.java:1414)
    05/11/17 11:54:27      at com.evermind.server.http.EvermindHttpServletRequest.getParameter(EvermindHttpServletRequest.java:2228)
    05/11/17 11:54:27      at web1.view.TestFilter.doFilter(TestFilter.java:15)
    05/11/17 11:54:27      at com.evermind.server.http.FileRequestDispatcher.handleWithFilter(FileRequestDispatcher.java:137)
    05/11/17 11:54:27      at com.evermind.server.http.FileRequestDispatcher.unprivileged_forwardInternal(FileRequestDispatcher.java:283)
    05/11/17 11:54:27      at com.evermind.server.http.FileRequestDispatcher.access$100(FileRequestDispatcher.java:30)
    05/11/17 11:54:27      at com.evermind.server.http.FileRequestDispatcher$2.oc4jRun(FileRequestDispatcher.java:254)
    05/11/17 11:54:27      at oracle.oc4j.security.OC4JSecurity.doPrivileged(OC4JSecurity.java:274)
    05/11/17 11:54:27      at com.evermind.server.http.FileRequestDispatcher.forwardInternal(FileRequestDispatcher.java:259)
    05/11/17 11:54:27      at com.evermind.server.http.HttpRequestHandler.doProcessRequest(HttpRequestHandler.java:863)
    05/11/17 11:54:27      at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:451)
    05/11/17 11:54:27      at com.evermind.server.http.HttpRequestHandler.serveOneRequest(HttpRequestHandler.java:218)
    05/11/17 11:54:27      at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:119)
    05/11/17 11:54:27      at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:112)
    05/11/17 11:54:27      at oracle.oc4j.network.ServerSocketReadHandler$SafeRunnable.run(ServerSocketReadHandler.java:245)
    05/11/17 11:54:27      at oracle.oc4j.network.ServerSocketAcceptHandler.procClientSocket(ServerSocketAcceptHandler.java:231)
    05/11/17 11:54:27      at oracle.oc4j.network.ServerSocketAcceptHandler.access$1000(ServerSocketAcceptHandler.java:33)
    05/11/17 11:54:27      at oracle.oc4j.network.ServerSocketAcceptHandler$AcceptHandlerHorse.run(ServerSocketAcceptHandler.java:820)
    05/11/17 11:54:27      at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:303)
    05/11/17 11:54:27      at java.lang.Thread.run(Thread.java:595)

  • StandalonePortletURL bug ?

    Hi,
    I have a problem using the StandalonePortletURL. I have two portlets A
    and B. In portlet A i have a JSP which creates a standalone portlet URL
    and stores it in the session attribute. In portlet B i have a JSP that
    retrieves the attribute from the session and displays the url as a link.
    When i click the link in porlet B i get a floatable portlet A in its own
    window which is what i want.
    The problem is that this works fine when run from workshop but does not
    work at all when created and run as a desktop. Bascially the returned
    URL gets mangled.
    The code for JSP A is:-
    StandalonePortletURL url =
    StandalonePortletURL.createStandalonePortletURL(request, response);
    request.getSession().setAttribute("float_url",url.toString());
    The code for JSP B is:-
    <a target="_blank" href="<%=
    (String)request.getSession().getAttribute("float_url") %>">Floatable
    Portlet</a>
    The Standalone URL generated running from workshop is:-
    http://localhost:7601/proxy/mnc/portlets/martins/float2.portlet?_windowLabel=portlet_2_1&_portlet.title=Float+Two&_portlet.skeleton=default&_portlet.skeletonPath=%2Fframework%2Fskeletons&_portlet.skin=default&_portlet.skinPath=%2Fframework%2Fskins%2F&_state=float
    The Standalone URL generated running from a desktop is:-
    http://localhost:7601/proxy/10001?_windowLabel=10001&_portlet.title=Float+Two&_portlet.skeleton=default&_portlet.skeletonPath=%2Fframework%2Fskeletons&_portlet.skin=default&_portlet.skinPath=%2Fframework%2Fskins%2F&_state=float
    As you can see the first part of the URL is missing. This looks like a
    bug however looking at the decompiled code for StandalonePortletURL it
    only adds parameters to the URL so i cant see why or how this gets mangled.
    Anyone else had the same experiences or has got this working on a desktop ?
    TIA
    Martin

    Chris,
    My settings for the web.xml were already like the example you sent. And
    thus i still get the problem.
    However it seems that using the Tag Library rather than the API directly
    yields the result i want and it appears to work. Looking at the
    decompiled code for the tag library it includes a call to get the
    servlet name and add it to the generated URL as follows:-
    mUrl =
    StandalonePortletURL.createStandalonePortletURL((HttpServletRequest)pageContext.getRequest(),
    (HttpServletResponse)pageContext.getResponse());
    mUrl.setPortletServletName((String)pageContext.getServletContext().getAttribute(PortletServlet.KEY_SERVLET_NAME));
    Thus the tag library and direct api yield different results. For now we
    can use the tag library as a workaround as we are generating this in a
    JSP but for a pageflow we will need the direct API version.
    Thanks
    Martin
    Chris Jolley wrote:
    this is fixed in sp3 (not out yet) you can get a patch from customer support CR132576
    make sure the follwoing is followed
    1) Make sure the PortletServlet is registered in your web.xml
    <servlet>
    <servlet-name>PortletServlet</servlet-name>
    <servlet-class>com.bea.netuix.servlets.manager.PortletServlet</servlet-class>
    <load-on-startup>1</load-on-startup>
    </servlet>
    <servlet-mapping>
    <servlet-name>PortletServlet</servlet-name>
    <url-pattern>/portletmanager/*</url-pattern>
    </servlet-mapping>
    <servlet-mapping>
    <servlet-name>PortletServlet</servlet-name>
    <url-pattern>*.portlet</url-pattern>
    </servlet-mapping>
    2) If you want the portlet to popup in a small window and not a full browser,
    you will need to copmment out the "initPortletFloatButtons()" line in all the
    skin.js file in all the skins directories
    function initSkin()
    initDynamicMenus();
    initRolloverMenus();
    initPortletDeleteButtons();
    // See the comments in float.js about this function...
    initPortletFloatButtons();
    3) Use the following code in your JSP to float another portlet
    <%@ taglib uri="render.tld" prefix="render" %>
    <a target="_blank" class="bea-portal-button-float"
    href='<render:standalonePortletUrl/>'>Float This portlet</a>
    <a target="_blank" class="bea-portal-button-float"
    href='<render:standalonePortletUrl windowLabel="portlet_2"/>'>Float The Other
    Portlet</a>
    4) And make sure the change list associated with this CR ia applied as there
    was a bug in the code.
    Martin Porter <[email protected]> wrote:
    Hi,
    I have a problem using the StandalonePortletURL. I have two portlets
    A
    and B. In portlet A i have a JSP which creates a standalone portlet URL
    and stores it in the session attribute. In portlet B i have a JSP that
    retrieves the attribute from the session and displays the url as a link.
    When i click the link in porlet B i get a floatable portlet A in its
    own
    window which is what i want.
    The problem is that this works fine when run from workshop but does not
    work at all when created and run as a desktop. Bascially the returned
    URL gets mangled.
    The code for JSP A is:-
    StandalonePortletURL url =
    StandalonePortletURL.createStandalonePortletURL(request, response);
    request.getSession().setAttribute("float_url",url.toString());
    The code for JSP B is:-
    <a target="_blank" href="<%=
    (String)request.getSession().getAttribute("float_url") %>">Floatable
    Portlet</a>
    The Standalone URL generated running from workshop is:-
    http://localhost:7601/proxy/mnc/portlets/martins/float2.portlet?_windowLabel=portlet_2_1&_portlet.title=Float+Two&_portlet.skeleton=default&_portlet.skeletonPath=%2Fframework%2Fskeletons&_portlet.skin=default&_portlet.skinPath=%2Fframework%2Fskins%2F&_state=float
    The Standalone URL generated running from a desktop is:-
    http://localhost:7601/proxy/10001?_windowLabel=10001&_portlet.title=Float+Two&_portlet.skeleton=default&_portlet.skeletonPath=%2Fframework%2Fskeletons&_portlet.skin=default&_portlet.skinPath=%2Fframework%2Fskins%2F&_state=float
    As you can see the first part of the URL is missing. This looks like
    a
    bug however looking at the decompiled code for StandalonePortletURL it
    only adds parameters to the URL so i cant see why or how this gets mangled.
    Anyone else had the same experiences or has got this working on a desktop
    TIA
    Martin

Maybe you are looking for

  • Ipod video converter without all this adware , spyware e.t.c

    Hi again! I 'm sure that many relative questions will have been asked again but is there any s a f e free video converter for ipod without all this adware types ? Is it also additionaly available for conversion of flv video types or do I need an extr

  • How to use Windows SIM to create answer files for 32-bit (x86) Windows 7 from a 64-bit (x86_64) Windows 7 PC?

    So I'm having the old 32-bit/64-bit compatibility issues with Windows SIM. I have a Windows 7 64-bit PC (actually a virtual machine) that I intend to use to run Windows SIM and make answer files for 32-bit Windows 7 unattended installations. I've ins

  • How may I prevent loss of Music - not from iTunes - on a new computer?

    The original iTunes Library I had for my iPod Touch was on a computer that has broken down. I am concerned about what I'm reading in the iTunes HELP files, because I see no way to prevent loss of my non-purchased (at least from iTunes) music when syn

  • Print output not coming from ECC 5.0

    Hi all, Following are the settings done in my system In SPAD -> Device attributes Device Type              SWIN SWIN     : Windows printing via SAPlpd          Spool Server             sapdev_DEV_00         SAPTRANS                                   

  • Interactive Report Subscription emailing different dataset

    Hi All, I am having a bit of strange problem with subscriptions email on an interactive report. I have the report to email users every morning from an interactive report.  The dataset that is emailed is not the same as the report on the interactive r