cancel
Showing results for 
Search instead for 
Did you mean: 

Problem reading fields from a JSP in AbstractPortalComponent

Former Member
0 Kudos

Hi All,

I am trying to create a PAR file that has an AbstractPortalComponent and a JSP. Problem is how do I submit from a JSP (I am not using HTMLB) to my AbstractPortalComponent. I created an event, but I am not able to read the fields in the form in JSP in this event.

Any help will be greatly appreciated

Thanks,

Preet

Accepted Solutions (0)

Answers (5)

Answers (5)

Former Member
0 Kudos

I was able to resolve this issue

Former Member
0 Kudos

Hi,

You can submit using js . So you can put this line end of your JSP.

<script language ="javascript">

document.forms[0].submit();

</script>

you can get the formfields using the following code inside docontent

 public void doContent(IPortalComponentRequest request, IPortalComponentResponse response)  {


HttpServletRequest req = request.getServletRequest();
String value = req.getParameter("<formfieldname>");
...

}

if will submit everytime it will be on loop.So were you will have the control ,Since you are not using any HTMLB components

Former Member
0 Kudos

Hi All,

Thanks a lot to all of you for replying to my question. I did give points to all of you.

Here is my problem. I am able to display the JSP from abstract portal component class. I am not able to do a submit from the jsp. If any one can please tell me how to do that? Also how to read the form fields that are being passed from the JSP. I will really appreciate it. I am not using HTMLB. I amusing HTML.

Thanks to all

Preet

Former Member
0 Kudos

Hi

putting variables in AbstractportalComponent

com.sapportals.portal.prt.resource.IResource jspResource = request.getResource("INDEXJSP", "jsp/abc.jsp");

request.getNode().putValue("VALUE",value);

response.include(request, jspResource);

In jsp you can read the variable

String value = (String)request.getNode().getValue("VALUE");

Regards

Ganesan S

Former Member
0 Kudos

Hi,

You use jspdynpage

Refer this thread

Regards,

Beevin.

Former Member
0 Kudos

hi Johar,

use this code in java class..

public void doContent(IPortalComponentRequest request, IPortalComponentResponse response)

{

IResource jspResource = request.getResource("jsp", "jsp/InitLogon.jsp");

response.include(request, jspResource);

}

write ur code in jsp... for eg username and password validation..

<b>InitLogon.jsp</b>

<form name="logonForm" action="/irj/portal/" method="post">

<input name="login_submit" type="hidden" value="on">

<table>

<tr><td>Username</td>

<td><input type="text" name="j_user"></td>

</tr><tr>

<td>Password</td>

<td><input type="password" name="j_password"></td>

</tr>

<tr><td colspan=2 align=right>

<input class="button" type="submit" name="Logon" value="Logon"

onmouseover="this.style.backgroundColor='#33CCCC'" onMouseOut="this.style.backgroundColor='#FFFFFF'">

</td></tr>

</table>

</form>

hope it may help u...

regards,

Chinnadurai.R