Providing init parameters to a servlet portal component

I'm creating a portalcomponent based on a servlet. So I have the following declaration in my portalapp.xml:
      <component-config>
        <property name="ComponentType" value="servlet"/>
        <property name="ClassName" value="test.TestServlet"/>
Now I want to provide standard init-parameters (as defined in a servlets' web.xml) to this servlet, but I can't find any documentation describing how to do this. Standard profile parameters do not get through to the ServletConfig or ServletContext.
Any help will be appreciated.
Regards,
Marnix

seems simple enough right
but i don't get this to work.
private Vector parameterNames = null;
public void init(){
parameterNames = new Vector();
for(Enumeration e = this.getInitParameterNames(); e.hasMoreElements() ;) {
parameterNames.add(e.nextElement());

Similar Messages

  • Can't define init parameters for multiple servlets

    I want to define init parameters for two servlets in the web.xml file but i only get null for my Login servlet
    <web-app>
    <servlet>
    <servlet-name>
    RSServlet
    </servlet-name>
    <servlet-class>
    RoadSafe.Servlet.RSServlet
    </servlet-class>
    <init-param>
    <param-name>serverip</param-name>
    <param-value>localhost</param-value>
    </init-param>
         <load-on-startup>
              2
         </load-on-startup>
    </servlet>
         <servlet>
    <servlet-name>
    Login
    </servlet-name>
    <servlet-class>
    RoadSafe.AdMisc.Login
    </servlet-class>
    <init-param>
    <param-name>serverip2</param-name>
    <param-value>localhost</param-value>
    </init-param>
         <load-on-startup>
              1
         </load-on-startup>
    </servlet>
    <servlet-mapping>
    <servlet-name>
    RSServlet
    </servlet-name>
    <url-pattern>
    /RSServlet
    </url-pattern>
    </servlet-mapping>
    <servlet-mapping>
    <servlet-name>
    Login
    </servlet-name>
    <url-pattern>
    /Login
    </url-pattern>
    </servlet-mapping>
    </web-app>

    In the code for you Login servlet, are you using the name "serverip2" to access the initial parameter ?
    Thats the name you have used in the web.xml file.

  • Difference between Abstract portal Component and JSPDyn page.

    Hi Experts,
    What is the difference between Abstract portal Component and JSPDyn page.
    Thanks,
    Jay.

    Hi,
    The PDK provides two methods for creating a portal component:
    Abstract Portal Component
    The Abstract Portal Component class offers a lean method for writing HTML commands to the Web client as well as for basic event handling. It is an implementation of the IPortalComponent, which is the central abstraction of the Portal Component API.
    DynPage
    The Page Processor Component, which extends the Abstract Portal Component, returns a DynPage. It provides more sophisticated event handling. Controls that produce events (such as buttons and checkboxes) have an event attribute that contains the name of the event handling method. This event handling method is invoked by the DynPage when it occurs.
    The JSPDynPage is an implementation of the DynPage and allows the use of the DynPage in combination with JSP (Java Server Pages).
    The PDK documentation and examples focus on the DynPage. Easier event handling and the separatation of content development (JSP) from application development (Java) make the DynPage a better choice for components with interaction and changing content.
    For more details, Refer thes thread,
    https://fortress.wa.gov/dop/portal/irj/portalapps/com.sap.portal.pdk.basic.portalcomponentimplementation/docs/jspdynpage.html
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/f0b3e9d5-b2af-2a10-20ba-9f6ce6b1a27f
    Hop it helps..
    GS
    Edited by: Sathishkumar GS on Apr 14, 2008 2:07 PM

  • How can I include a portal component look and feel in a java servlet

    Does any body know how can i include a portal component look and feel (tables, buttons, etc) in a java servlet?

    Hi José,
    I don't think that is possible. But you can import the css files that ep uses for its look and feel and try to give your web pages similar look and feel. The tables and other controls used in EP are totally different and are done through complex JavaScript coding instead of simple HTML tags. If you want exact lok and feel then i thin you must go for a Webdynpro based application rather then a J2EE application with JSPs.
    Regards,
    Guru.
    PS: Give points for helpful replies.

  • How do I get a servlet configured with init parameters

    When I try to add a set of <init-param> parameters to a servlet it seems
              like the weblogic server is trying to load it as a bean, which since its not
              a bean it can't do. I get the following error trace when I start the
              server:
              C:\bea\wlserver6.0sp1>set
              PATH=.\bin;C:\orant\bin;C:\WINNT\system32;C:\WINNT;C:\
              WINNT\System32\Wbem;C:\MSSQL7\BINN;C:\Program Files\Microsoft Visual
              Studio\Comm
              on\Tools\WinNT;C:\Program Files\Microsoft Visual
              Studio\Common\MSDev98\Bin;C:\Pr
              ogram Files\Microsoft Visual Studio\Common\Tools;C:\Program Files\Microsoft
              Visu
              al Studio\VC98\bin;"C:\Program
              Files\Mts";C:\PROGRA~1\NETWOR~1\PGP;C:\MSSQL7\BIN
              N;C:\jdk1.2.2\bin;
              weblogic.xml.dom.ChildCountException
              at weblogic.xml.dom.DOMUtils.getElementByTagName(DOMUtils.java:147)
              at weblogic.xml.dom.DOMUtils.getValueByTagName(DOMUtils.java:128)
              at
              weblogic.servlet.internal.dd.ParameterDescriptor.<init>(ParameterDesc
              riptor.java:45)
              at
              weblogic.servlet.internal.dd.ServletDescriptor.<init>(ServletDescript
              or.java:79)
              at
              weblogic.servlet.internal.dd.WebAppDescriptor.<init>(WebAppDescriptor
              .java:171)
              at
              weblogic.servlet.internal.dd.DescriptorLoader.initialize(DescriptorLo
              ader.java:288)
              at
              weblogic.servlet.internal.dd.DescriptorLoader.<init>(DescriptorLoader
              .java:230)
              at
              weblogic.servlet.internal.HttpServer.loadWARContext(HttpServer.java:4
              73)
              at
              weblogic.servlet.internal.HttpServer.loadWebApp(HttpServer.java:421)
              at weblogic.j2ee.WebAppComponent.deploy(WebAppComponent.java:74)
              at weblogic.j2ee.Application.addComponent(Application.java:126)
              at weblogic.j2ee.J2EEService.addDeployment(J2EEService.java:115)
              at
              weblogic.management.mbeans.custom.DeploymentTarget.addDeployment(Depl
              oymentTarget.java:283)
              at
              weblogic.management.mbeans.custom.DeploymentTarget.addDeployment(Depl
              oymentTarget.java:109)
              at
              weblogic.management.mbeans.custom.WebServer.addWebDeployment(WebServe
              r.java:76)
              at java.lang.reflect.Method.invoke(Native Method)
              at
              weblogic.management.internal.DynamicMBeanImpl.invokeLocally(DynamicMB
              eanImpl.java:562)
              at
              weblogic.management.internal.DynamicMBeanImpl.invoke(DynamicMBeanImpl
              .java:548)
              at
              weblogic.management.internal.ConfigurationMBeanImpl.invoke(Configurat
              ionMBeanImpl.java:285)
              at
              com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:15
              55)
              at
              com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:15
              23)
              at
              weblogic.management.internal.MBeanProxy.invoke(MBeanProxy.java:437)
              at
              weblogic.management.internal.MBeanProxy.invoke(MBeanProxy.java:178)
              at $Proxy27.addWebDeployment(Unknown Source)
              at
              weblogic.management.configuration.WebServerMBean_CachingStub.addWebDe
              ployment(WebServerMBean_CachingStub.java:985)
              at
              weblogic.management.mbeans.custom.DeploymentTarget.addDeployment(Depl
              oymentTarget.java:269)
              at
              weblogic.management.mbeans.custom.DeploymentTarget.addDeployments(Dep
              loymentTarget.java:233)
              at
              weblogic.management.mbeans.custom.DeploymentTarget.updateServerDeploy
              ments(DeploymentTarget.java:194)
              at
              weblogic.management.mbeans.custom.DeploymentTarget.updateDeployments(
              DeploymentTarget.java:158)
              at java.lang.reflect.Method.invoke(Native Method)
              at
              weblogic.management.internal.DynamicMBeanImpl.invokeLocally(DynamicMB
              eanImpl.java:562)
              at
              weblogic.management.internal.DynamicMBeanImpl.invoke(DynamicMBeanImpl
              .java:548)
              at
              weblogic.management.internal.ConfigurationMBeanImpl.invoke(Configurat
              ionMBeanImpl.java:285)
              at
              com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:15
              55)
              at
              com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:15
              23)
              at
              weblogic.management.internal.MBeanProxy.invoke(MBeanProxy.java:437)
              at
              weblogic.management.internal.MBeanProxy.invoke(MBeanProxy.java:178)
              at $Proxy26.updateDeployments(Unknown Source)
              at
              weblogic.management.configuration.ServerMBean_CachingStub.updateDeplo
              yments(ServerMBean_CachingStub.java:2299)
              at
              weblogic.management.mbeans.custom.ApplicationManager.startConfigManag
              er(ApplicationManager.java:240)
              at
              weblogic.management.mbeans.custom.ApplicationManager.start(Applicatio
              nManager.java:122)
              at java.lang.reflect.Method.invoke(Native Method)
              at
              weblogic.management.internal.DynamicMBeanImpl.invokeLocally(DynamicMB
              eanImpl.java:562)
              at
              weblogic.management.internal.DynamicMBeanImpl.invoke(DynamicMBeanImpl
              .java:548)
              at
              weblogic.management.internal.ConfigurationMBeanImpl.invoke(Configurat
              ionMBeanImpl.java:285)
              at
              com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:15
              55)
              at
              com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:15
              23)
              at
              weblogic.management.internal.MBeanProxy.invoke(MBeanProxy.java:437)
              at
              weblogic.management.internal.MBeanProxy.invoke(MBeanProxy.java:178)
              at $Proxy19.start(Unknown Source)
              at
              weblogic.management.configuration.ApplicationManagerMBean_CachingStub
              .start(ApplicationManagerMBean_CachingStub.java:435)
              at
              weblogic.management.Admin.startApplicationManager(Admin.java:1030)
              at weblogic.management.Admin.finish(Admin.java:491)
              at weblogic.t3.srvr.T3Srvr.start(T3Srvr.java:429)
              at weblogic.t3.srvr.T3Srvr.run(T3Srvr.java:170)
              at weblogic.Server.main(Server.java:35)
              >
              <Apr 3, 2001 3:42:32 PM EDT> <Notice> <WebLogicServer> <WebLogic Server
              started>
              <Apr 3, 2001 3:42:32 PM EDT> <Notice> <WebLogicServer> <ListenThread
              listening o
              n port 7001>
              <Apr 3, 2001 3:42:32 PM EDT> <Notice> <WebLogicServer> <SSLListenThread
              listenin
              g on port 7002>
              <Apr 3, 2001 3:42:38 PM EDT> <Error> <HTTP> <HttpServer(1112581,null default
              ctx
              ,ajrserver) found no context for "GET /CommonOpinionAdmin2?verifyinstall=
              HTTP/1
              .1". This should not happen unless the default context failed to deploy.>
              The distribution file is not a WAR file, but a JAR file. I need to to just
              do what it does if I don't specify any init-param's which is to pass them
              when the servlet does get loaded, or load it as a servlet from a jar file
              instead of a bean.
              How do I configure weblogics to run my servlet with init parameters.
              Thank You,
              Anthony Rizzolo
              

    I'll answer my own problem. It turns out that you can't put multiple
              <param-name> and <param-value> pairs within a single <init-param>. I
              assumed that you could since none of the examples had more than one
              parameter I didn't realize that you had to specify multiple <init-param>
              tags if you had multiple parameters.
              Anthony Rizzolo
              "Anthony Rizzolo" <[email protected]> wrote in message
              news:[email protected]...
              > When I try to add a set of <init-param> parameters to a servlet it seems
              > like the weblogic server is trying to load it as a bean, which since its
              not
              > a bean it can't do. I get the following error trace when I start the
              > server:
              >
              > C:\bea\wlserver6.0sp1>set
              > PATH=.\bin;C:\orant\bin;C:\WINNT\system32;C:\WINNT;C:\
              > WINNT\System32\Wbem;C:\MSSQL7\BINN;C:\Program Files\Microsoft Visual
              > Studio\Comm
              > on\Tools\WinNT;C:\Program Files\Microsoft Visual
              > Studio\Common\MSDev98\Bin;C:\Pr
              > ogram Files\Microsoft Visual Studio\Common\Tools;C:\Program
              Files\Microsoft
              > Visu
              > al Studio\VC98\bin;"C:\Program
              > Files\Mts";C:\PROGRA~1\NETWOR~1\PGP;C:\MSSQL7\BIN
              > N;C:\jdk1.2.2\bin;
              >
              > weblogic.xml.dom.ChildCountException
              > at
              weblogic.xml.dom.DOMUtils.getElementByTagName(DOMUtils.java:147)
              > at weblogic.xml.dom.DOMUtils.getValueByTagName(DOMUtils.java:128)
              > at
              > weblogic.servlet.internal.dd.ParameterDescriptor.<init>(ParameterDesc
              > riptor.java:45)
              > at
              > weblogic.servlet.internal.dd.ServletDescriptor.<init>(ServletDescript
              > or.java:79)
              > at
              > weblogic.servlet.internal.dd.WebAppDescriptor.<init>(WebAppDescriptor
              > .java:171)
              > at
              > weblogic.servlet.internal.dd.DescriptorLoader.initialize(DescriptorLo
              > ader.java:288)
              > at
              > weblogic.servlet.internal.dd.DescriptorLoader.<init>(DescriptorLoader
              > .java:230)
              > at
              > weblogic.servlet.internal.HttpServer.loadWARContext(HttpServer.java:4
              > 73)
              > at
              > weblogic.servlet.internal.HttpServer.loadWebApp(HttpServer.java:421)
              > at weblogic.j2ee.WebAppComponent.deploy(WebAppComponent.java:74)
              > at weblogic.j2ee.Application.addComponent(Application.java:126)
              > at weblogic.j2ee.J2EEService.addDeployment(J2EEService.java:115)
              > at
              > weblogic.management.mbeans.custom.DeploymentTarget.addDeployment(Depl
              > oymentTarget.java:283)
              > at
              > weblogic.management.mbeans.custom.DeploymentTarget.addDeployment(Depl
              > oymentTarget.java:109)
              > at
              > weblogic.management.mbeans.custom.WebServer.addWebDeployment(WebServe
              > r.java:76)
              > at java.lang.reflect.Method.invoke(Native Method)
              > at
              > weblogic.management.internal.DynamicMBeanImpl.invokeLocally(DynamicMB
              > eanImpl.java:562)
              > at
              > weblogic.management.internal.DynamicMBeanImpl.invoke(DynamicMBeanImpl
              > .java:548)
              > at
              > weblogic.management.internal.ConfigurationMBeanImpl.invoke(Configurat
              > ionMBeanImpl.java:285)
              > at
              > com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:15
              > 55)
              > at
              > com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:15
              > 23)
              > at
              > weblogic.management.internal.MBeanProxy.invoke(MBeanProxy.java:437)
              > at
              > weblogic.management.internal.MBeanProxy.invoke(MBeanProxy.java:178)
              > at $Proxy27.addWebDeployment(Unknown Source)
              > at
              > weblogic.management.configuration.WebServerMBean_CachingStub.addWebDe
              > ployment(WebServerMBean_CachingStub.java:985)
              > at
              > weblogic.management.mbeans.custom.DeploymentTarget.addDeployment(Depl
              > oymentTarget.java:269)
              > at
              > weblogic.management.mbeans.custom.DeploymentTarget.addDeployments(Dep
              > loymentTarget.java:233)
              > at
              > weblogic.management.mbeans.custom.DeploymentTarget.updateServerDeploy
              > ments(DeploymentTarget.java:194)
              > at
              > weblogic.management.mbeans.custom.DeploymentTarget.updateDeployments(
              > DeploymentTarget.java:158)
              > at java.lang.reflect.Method.invoke(Native Method)
              > at
              > weblogic.management.internal.DynamicMBeanImpl.invokeLocally(DynamicMB
              > eanImpl.java:562)
              > at
              > weblogic.management.internal.DynamicMBeanImpl.invoke(DynamicMBeanImpl
              > .java:548)
              > at
              > weblogic.management.internal.ConfigurationMBeanImpl.invoke(Configurat
              > ionMBeanImpl.java:285)
              > at
              > com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:15
              > 55)
              > at
              > com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:15
              > 23)
              > at
              > weblogic.management.internal.MBeanProxy.invoke(MBeanProxy.java:437)
              > at
              > weblogic.management.internal.MBeanProxy.invoke(MBeanProxy.java:178)
              > at $Proxy26.updateDeployments(Unknown Source)
              > at
              > weblogic.management.configuration.ServerMBean_CachingStub.updateDeplo
              > yments(ServerMBean_CachingStub.java:2299)
              > at
              > weblogic.management.mbeans.custom.ApplicationManager.startConfigManag
              > er(ApplicationManager.java:240)
              > at
              > weblogic.management.mbeans.custom.ApplicationManager.start(Applicatio
              > nManager.java:122)
              > at java.lang.reflect.Method.invoke(Native Method)
              > at
              > weblogic.management.internal.DynamicMBeanImpl.invokeLocally(DynamicMB
              > eanImpl.java:562)
              > at
              > weblogic.management.internal.DynamicMBeanImpl.invoke(DynamicMBeanImpl
              > .java:548)
              > at
              > weblogic.management.internal.ConfigurationMBeanImpl.invoke(Configurat
              > ionMBeanImpl.java:285)
              > at
              > com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:15
              > 55)
              > at
              > com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:15
              > 23)
              > at
              > weblogic.management.internal.MBeanProxy.invoke(MBeanProxy.java:437)
              > at
              > weblogic.management.internal.MBeanProxy.invoke(MBeanProxy.java:178)
              > at $Proxy19.start(Unknown Source)
              > at
              > weblogic.management.configuration.ApplicationManagerMBean_CachingStub
              > .start(ApplicationManagerMBean_CachingStub.java:435)
              > at
              > weblogic.management.Admin.startApplicationManager(Admin.java:1030)
              > at weblogic.management.Admin.finish(Admin.java:491)
              > at weblogic.t3.srvr.T3Srvr.start(T3Srvr.java:429)
              > at weblogic.t3.srvr.T3Srvr.run(T3Srvr.java:170)
              > at weblogic.Server.main(Server.java:35)
              > >
              > <Apr 3, 2001 3:42:32 PM EDT> <Notice> <WebLogicServer> <WebLogic Server
              > started>
              >
              > <Apr 3, 2001 3:42:32 PM EDT> <Notice> <WebLogicServer> <ListenThread
              > listening o
              > n port 7001>
              > <Apr 3, 2001 3:42:32 PM EDT> <Notice> <WebLogicServer> <SSLListenThread
              > listenin
              > g on port 7002>
              > <Apr 3, 2001 3:42:38 PM EDT> <Error> <HTTP> <HttpServer(1112581,null
              default
              > ctx
              > ,ajrserver) found no context for "GET /CommonOpinionAdmin2?verifyinstall=
              > HTTP/1
              > .1". This should not happen unless the default context failed to deploy.>
              >
              > The distribution file is not a WAR file, but a JAR file. I need to to
              just
              > do what it does if I don't specify any init-param's which is to pass them
              > when the servlet does get loaded, or load it as a servlet from a jar file
              > instead of a bean.
              >
              > How do I configure weblogics to run my servlet with init parameters.
              >
              > Thank You,
              > Anthony Rizzolo
              >
              >
              

  • Servlet init parameters common to more servlets

    Hi all,
    I have a set of servlets using each one some init parameters.
    Some of these parameters are common to a certain number of servlets.
    Does exist a place where to put this init-parameter, avoiding to repeat these values
    in all the definions of the servlets in the web xml file (I am using Tomcat 4.x) ?
    thanks in advance,
    Andrea

    instead of adding a init-param to the servlet tag you also might add a context-param tag to the web-app.
    please see the web-app DTD file to see the exact structure (i think it's named context-param and the child-elements are similar to those of init-param - but sorry - i'm not 100% sure).
    inside the servlet you could then do something like the following:
    // this = e.g. a HttpServlet
    String param = this.getServletConfig().getInitParameter("your_param");
    if(param == null) {
      param = this.getServletContext().getInitParameter("your_param");
      if(param == null) {
        throw new ServletException("Missing parameter");
    }result:
    servlet searches the servlet specific init parameters
    if the parameter could be found it will be used (servlet param "overwrites" global param)
    else the servlet searches the webapp specific init parameter
    if the parameter could be found it will be used
    else the servlet throws an exception

  • Different behaviour on servlet w/o servlet-mapping and init parameters

    I was playing around and found, that the init-parameter of a servlet is always null if there is no servlet mapping. I did not define a servlet mapping because I used the servlet only for for (named) dispatching (client usage should not be allowed).
    web.xml:
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <web-app xmlns="http://java.sun.com/xml/ns/j2ee"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
    http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd" version="2.4">
      <servlet>
        <servlet-name>InitParamServlet</servlet-name>
        <servlet-class>test.InitParamServlet</servlet-class>
        <init-param>
          <param-name>param1</param-name>
          <param-value>value1</param-value>
        </init-param>
      </servlet>
      <servlet-mapping>
        <servlet-name>InitParamServlet</servlet-name>
        <url-pattern>*.initparam</url-pattern>
      </servlet-mapping>
    </web-app>
    InitParamServlet.java:
    package test;
    import java.io.IOException;
    import java.io.PrintWriter;
    import javax.servlet.ServletException;
    import javax.servlet.http.HttpServlet;
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;
    public class InitParamServlet extends HttpServlet{
      private static final long serialVersionUID = 1L;
      protected void doGet(HttpServletRequest request, HttpServletResponse response)
          throws ServletException, IOException {
        response.setContentType("text/html");
        PrintWriter pw = response.getWriter();
        pw.write(getServletName());
        pw.write(": param1=" + getInitParameter("param1"));
    }The URL http://localhost:8080/xxx/servlet/test.InitParamServletreturns org.apache.catalina.INVOKER.test.InitParamServlet: param1=null
    (on Tomcat), and the call to the same servlet with URL http://localhost:8080/xxx/test.initparamreturns InitParamServlet: param1=value1 instead (the correct init parameter value)!
    The same happens with jetty. This looks strange for me; I would expect the same behaviour for the servlet (independent from servlet-mapping-tag in the web.xml).

    When you call the url
    http://localhost:8080/xxx/servlet/test.InitParamServlet
    you are actually calling the invoker servlet that is defined in the default conf/web.xml. If you look at this web.xml file you will see that the invoker is mapped with the pattern "/servlet/*" which maps to the above url. The request goes to this servlet which parses the url and then calls the InitParamServlet class.
    When you call the url
    http://localhost:8080/xxx/test.initparam
    you are matching the url pattern you defined in the WEB-INF/web.xml file ("*.initparam"). This time the request goes to servlet instance that you defines in the servlet naming tags as "InitParamServlet" and since you defined init params they are populated.
    Note that these urls will also match the "*.initparam" pattern
    http://localhost:8080/xxx/XXXXX.initparam
    http://localhost:8080/xxx/badpackage.initparam
    http://localhost:8080/xxx/A.initparam
    Most people would have simplely defined the second servlet mapping as "initparam" and accessed the servlet with the url
    http://localhost:8080/xxx/initparam

  • Using JDO in a portal component.

    Hi!
    I've tried using JDO in a portal component (DynPage), but it just won't work for me (WAS 6.40).
    What I've tried is this:
    - Looking up a PersistenceManagerFactory using the name "java:comp/env/jdo/defaultPMF"
    This does not work ... I get a NameNotFoundException: Path to object does not exist at java:comp, the whole lookup name is java:comp/env/jdo/defaultPMF
    - After reading this forum I tried with the name "deployedAdapters/jdo/defaultPMF/shareable/jdo/defaultPMF" although this is probably not the correct way
    This did return a PersistenceManagerFactory object, however I wasn't able to cast to the PersistenceManagerFactory interface that I had. It must have been different versions of the interface - I tried downloading the jdo.jar from Sun and compiling the portal component against that, but still the ClassCastException occured. I used the reflection API to determine that the object returned did in fact implement the interface named javax.jdo.PersistenceManagerFactory. I even tried using the jdo.jar libraries from the server, but to no luck.
    So ... my question is: Is JDO not available from a portal component? Must I develop a J2EE application to make it work? If so, I'd rather use Hibernate in my portal components, but it seems stupid when JDO is available?
    Thanks,
    Thomas

    Hi Thomas,
    In order to be able to use JDO in a Portal component, you have to add a Private Sharing Reference to the application sap.com/com.sap.jdo. This is a standard application provided with the SAP WebAS Java installation.
    For more info on how to do that, please refer to <a href="https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/ep/g-i/how%20to%20access%20an%20ejb%20from%20a%20portal%20component.mht">this</a> tutorial -> Accessing the EJB -> New Portal Component -> scroll to the section "Add PrivateSharingReference".
    Hope that helps!
    Vladimir

  • Redirecting to external website from abstract portal component?

    Hi,
    I have developed an abstract portal component and trying to be redirected to an external website ex : www.google.com
    here is the code...
    public void doContent(IPortalComponentRequest request, IPortalComponentResponse response)
    HttpServletRequest req = request.getServletRequest();
    String queryString = req.getQueryString();
    String redirectURL = queryString.substring(queryString.indexOf("=")+1);
    HttpServletResponse resp = request.getServletResponse(true);
    resp.sendRedirect(redirectURL);
    OR
    RequestDispatcher rd = req.getRequestDispatcher("www.google.com");
    rd.forward(req, resp);
    But couldn't able to redirect in either ways ..
    exception was ... iView not found: www.google.com.
    Any help?
    Thanks
    MMK

    Hi Mohan,
    When you do a redirect you need to provide a URL. From javadocs
    Sends a temporary redirect response to the client using the specified redirect location URL. This method can accept relative URLs; the servlet container will convert the relative URL to an absolute URL before sending the response to the client.
    Thus when you provide just "www.google.com" the converted complete URL will be something like http://portalserver/irj....www.google.com whcih of course does not exist as a portal component. Thus you get the error iview not found.
    Hence you need to give a full URL and not a relative URL.
    Akhilesh

  • Call jspdynpage or Abstract Portal Component from SAPUI5

    Hi,
    I am new to SAPUI5, so might ask basic and dumb questions.
    I am trying to develop an application in sapui5 which should have the functionality to read and write a file to the server. It is different from file upload as the user wont be selecting any file, rather the data in the form should be written to a file in the server on a click of a button. After doing some research I figured out that sapui5 doesn't give an option to read/write a file to the server.
    So, as an alternative I thought of developing a service, an SAP portal application (jspdynpage, WDJ, abstract portal component - or if you can suggest any other app) that can be called from the sapui5 for reading/writing purpose. The data can be received/sent as an xml, and in the sapui5 application I can parse the data and do the needful.
    Now my question is how to call the portal application (that would be a url) without redirecting, and pass the necessary parameter? Sapui5 should just call that url and data should be passed or received as a parameter. I am not sure if OData model call will work, as I am getting an exception. Can you please provide a solution to this?
    Ps: We are on SAP EP 7.3 and would like to stick to SAP apps, and no additional database etc.
    Regards,
    Piyush.

    Hi All,
    I found a way to do that. I created an Abstract Portal Component application that accepts data through url parameters. Used the regular java APIs to read/write files to the server.
    Now the challenge, at least to me, was to call this application from SAPUI5 application. I used ajax call.
    var response = $.ajax ({
         url: "<url>",
         type: "POST"
    Next, will also try to find if I could use any of the models provided by SAPUI5 to call the portal application.
    Note: Make sure both your sapui5 app and the portal application is deployed on the same server, else it wont be able to authenticate (SSO wont work) and you may receive exceptions.
    Regards,
    Piyush.

  • How to pass parameters/atrributes to Servlet from ALBPM

    HI Friends,
    I am invoking servlet from bpm using server configuration, i am able to invoke servlet, but not able to pass parameters dynamically,
    Also I like to receive response parameters/attributes from servlets?
    Can any body help me on this?
    Look forward for response.
    Cheers

    Some helpful Docs on the WebServer component for you:
    The WebServer component is used to send HTTP requests to an HTTP server and capture the responses. It supports HTTP methods GET and POST.
    The body of the HTTP response is available in the WebServer.response attribute (String).
    Note: This component is superseded by the Fuego.NetX.AdvancedWebServer component, which provides better performance and more functionality like support for proxies and for more HTTP methods (like PUT and DELETE).
    Example: Get Oracle's website home page and save it to a file.
    getFrom(WebServer, url : "http://oracle.com", args : null)
    binaryResponse = Binary(text: WebServer.response,
    encoding: "UTF8")
    BinaryFile.writeFromBinaryTo(data : binaryResponse,
    name : "/tmp/oracle_index.html",
    append : false)

  • Error while consuming web service in portal component

    Hi All,
    I am working on a portal application which uses web services in portal component via web service.
    I have tested the web service and then creted a relevant portal service to it .When using this portal service in the portal component and running it Im getting the following run time error
    Portal Runtime Error
    An exception occurred while processing a request for :
    iView : Test_portal_service_app.Test_portal_service_app
    Component Name : Test_portal_service_app.Test_portal_service_app
    com.sap.portal.ivs.global.ume.UMECLient.
    Exception id: 11:17_03/07/08_0028_2739150
    See the details for the exception ID in the log file
    I did not use any ume attributes or ume api methods in the portal component .
    I have also added sharingreference= portalserviceapplication name  in deploymentdescriptor of the portal application which has the portal component.
    Please provide any suggestion for the possible cause of error .
    Urgent!!!!
    Thanks.

    Hi all,
    Please throw some light into this issue i am getting the following exception.
    com.sap.engine.services.webservices.jaxm.soap.accessor.NestedSOAPException: Problem in server response: Proxy Authentication Required.
    I have given the proxy settings in the com.sap.portal.ivs.httpservice  in the portal and also
    defined a proxy server in the Visual Administrator under Services -> Webservice Container -> HTTP Proxy Server
    I am calling service in the following manner.
    IPortalRuntimeResources runtime = PortalRuntime.getRuntimeResources();
       IService service = runtime.getService(IWS_P_Service.KEY);
       IWS_P_Service ws_service = (IWS_P_Service)service;
        Volumes from = new Volumes(Volumes.VOLUMES_KILOLITER_VALUE);
        Volumes to = new Volumes(Volumes.VOLUMES_LITER_VALUE);
        ChangeVolumeUnit cvu = new ChangeVolumeUnit(1200,from,to);
        // working upto here
         response.write("working");
         ChangeVolumeUnitResponse cvu_res = ws_service.ChangeVolumeUnit(cvu);
         double result = cvu_res.getChangeVolumeUnitResult();
         response.write(result+"");
    It is working upto "working".
    If any body has any solutions please post.
    Thanks

  • How to access a  web service(.wsdl) from portal component.

    Hi ,
    Is there any document/tutorial available on how to access a webservice from portal component ?
    I have found this linkhttps://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/ep/g-i/how to access a web service.htm...
    but the urls in the link are not working...
    i want  to know the steps to access webs service and sample code if some body has already done that..
    Thanks for the help.
    Lakshmi

    Hi Lakshmi,
    See the links below:
    http://help.sap.com/saphelp_nw04/helpdata/en/f0/581140d72dc442e10000000a1550b0/content.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/a3/918340d990ce62e10000000a155106/content.htm
    Hope this helps.
    Regards,
    Pooja.

  • Anonymous access to Portal Component over direct URL.

    Hi All,
    Im having a few Issues with enabling anonymous access to a portal component.
    Here is a mock of our portalapp.xml file
    <?xml version="1.0"  encoding="iso-8859-1"?>
    <application>
      <application-config>
        <property name="SharingReference" value="usermanagement, knowledgemanagement, landscape, htmlb, exportalJCOclient, exportal"/>
        <property name="startup" value="true"/>
        <property name="releasable" value="true"/>
        <property name="Vendor" value="com.ourdomain"/>
        <property name="SecurityArea" value="OurSecurityArea"/> -->
      </application-config>
      <components>
        <component name="MyComponent">
          <component-config>
            <property name="ClassName" value="com.ourdomain.MyClass"/>
            <property name="ComponentType" value="servlet"/>
            <property name="SafetyLevel" value="no_safety"/>
          </component-config>
          <component-profile/>
        </component>
      </components>
      <services/>
    </application>
    I want to be able to access the servlet over a URL like...
    http://host:port/irj/servlet/prt/portal/prtroot/MyApp.MyComponent
    I have added the Default User Group Everyone to the no_safety area of our com.ourDomain Security Zone.
    However when try to navigate to the URL we are first faced with a SAP Portal login page. on successful login the servlet is then shown.
    Note: I was able to get the Same Servlet working within an iView when the iViews Authentification Scheme was set to anonymous...However i am under instruction to get it working without the iView...
    As Background, The servlet is to be a sink for accepting data sent via an HTTP Post.
    Any help with this or pointers in the right direction would be greatly appreciated.
    -Paul

    Hi Darrell,
    Thankyou for that, yes it has helped....And I can now access the servlet directly without need to login.
    I figured that there was something that i was missing.....
    -Paul

  • Portal Component receives GET from other app out of the Enterprise Portal?

    Hello.
    I want to design a portal component, to which i can send GET-Parameters via URL.
    The sending application runs out of the enterprise Portal and has a simple HTML-form (The portal component generates HTML and JAVA-Script for a Flex Application in the Enterprise Portal which should point to a specific document named in the params. The params will be written into the generated HTML document after calling).
    Is this possible without authetification and how would the URL looks like, which is used to call the enterprise portal?
    Pls help me.
    With best regards
    Edited by: Björn Karpenstein on Aug 15, 2008 11:02 AM
    Edited by: Björn Karpenstein on Aug 15, 2008 11:03 AM
    Edited by: Björn Karpenstein on Aug 15, 2008 11:05 AM

    Hi Björn,
    you can access request parameters with the following code in the standard methods of your Portal Component:
              // IPortalComponentRequest request;
              request.getServletRequest().getParameter("ParamName");
    The direct URL of your Portal Component without a specific iView is:
    http://
    If your component should be directly accessable without authentication you must add the following property in your portalapp.xml in the the component-profile section:
          <component-profile>
            <property name="AuthScheme" value="anonymous"></property>
          </component-profile>
    Best regards,
    Stefan Brauneis

Maybe you are looking for

  • JTable tab key navigation with JComboBox Cell Editors in Java 1.3 & 1.4

    Hello - this is one for the experts! I have a JTable which has an editable JComboBox as one of the cell editors for a particular column. Users must be able to navigate through the table using the tab key. After editing a cell a single tab should adva

  • Trying to install Freehand MX

    trying to install Freehand MX on my old computer XP my computer got stolen while traveling and I desperately need Freehand up running now, I have serial number etc. but it tells me I can't register the product on line, i turned firewall off etc. but

  • SCCM 2012 R2 & MDT 2013 OSD Refresh - BDEDrive Assigned letter

    Hello, I'm having an issue with my MDT OSD refresh for Win 7 machines. I've capture a Win 7 reference image from a VM using MDT capture TS and I can successfully deploy that image to a bare metal VM using an MDT integrated SCCM TS. The disk partition

  • Is this a bug? Delete key acts as Home key

    In the SCSM client, go to a CR, look at the planning tab, and use your keyboard to modify the scheduled start/end dates. If you click in the box, and press the delete key (i.e. on the 9 to change it to an 8), the delete key acts as normal. However, i

  • Wrong song order during playback

    I have an issue that the song order during playback is in accordance to the song number. Random playback is switched off. I delete all my music from iPhone 4s, I just synced a signle album for easier verification, but the issue stays same. Thanks for