cancel
Showing results for 
Search instead for 
Did you mean: 

Calling Java from JSP in a form action

Former Member
0 Kudos

Hi experts,

I have an portal application with:

- portalapp.xml

- ChangePassw.java

- change.jsp

How can call to doContent or doPost from jsp.

My passwd.java:

public class ChangePassw extends AbstractPortalComponent

{

    @SuppressWarnings("null")

  public void doContent(IPortalComponentRequest request, IPortalComponentResponse response)

    {

...

...

}

My change.jsp:

...

<FORM name="helpForm" method="post" action="login.ChangePassw">

...

My portalapp.xml:

...

    <component name="ChangePassw">

      <component-config>

        <property name="ClassName" value="login.ChangePassw"/>

        <property name="SafetyLevel" value="no_safety"/>

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

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

      </component-config>

...

What are wrong? The error is:

com.sap.portal.prt.broker.PortalModuleNotFoundException: Could not retrieve portal application login

Thanks in advance,

Regards,

Accepted Solutions (1)

Accepted Solutions (1)

detlev_beutner
Active Contributor
0 Kudos

Hi Victor,

Hm, there seems to be some basic understanding missing. First, if you need a JSP for your UI, a JSPDynPageComponent instead of an AbstractPortalComponent might make much more sense, just as the framework delivers primarily the eventhandling which otherwise you have to implement by yourself (of course this is possible, but not graceful at all). See for example Tutorial III: Building a JSP DynPage - Portal - SAP Library and around.

Then your concrete error comes from "<FORM name="helpForm" method="post" action="login.ChangePassw">". The "action" is translated into a call for a URL relative to the current URL, and it uses "login.ChangePassw" as value. This leads to the portal looking up an application "login" with the component "ChangePassw", which does not exist.

Then, you defined the ComponentType as servlet where in fact you wanted an AbstractPortalComponent, which is defined by not passing any parameter for the ComponentType (but the same holds for JSPDynPage or DynPage; just for native servlets and pure jsp's there is the possibility to leave the standard portal way).

I would urgently suggest to work through the Developers Guide (see link above), as it makes no sense to get this straight bit by bit here in the forum.

Hope it helps nevertheless

Best regards

Detlev

Former Member
0 Kudos

wuau... I do not understand nothing. Sorry.

I check that I wrote a mistake:

My change.jsp:

...

<FORM name="helpForm" method="post" action="<%=login.ChangePassw%>">

If the component ChangePassw is a servlet; can I call like the before command?

Regards,

detlev_beutner
Active Contributor
0 Kudos

Hi Victor,

Really no offense, but this still holds: "I would urgently suggest to work through the Developers Guide (see link above), as it makes no sense to get this straight bit by bit here in the forum."

In the latest syntax, you would reference the ChangePassw member of the login bean. Of course nothing which would make sense here, as there is no login bean, but "login" seems to be your package name.

Anyhow, there is too much knowledge missing, as this makes any sense to follow up bit per bit through the forum. Please go through the dev's guide, it is written "just for you" 😉

Best regards

Detlev

Former Member

Answers (0)