Error in passing parameter between 2 jsp..
Hi..
I have error in when submitting a jsp to another jsp..
It seems like cannot get the values i put in the first jsp...
The first jsp codes..
<FORM name="mank" action="<%= HttpPortletRendererUtil.htmlFormActionLink(request, PortletRendererUtil.PAGE_LINK) %>" method="POST" autocomplete=off onSubmit="return ValidateForm()">
<%= HttpPortletRendererUtil.htmlFormHiddenFields(request, PortletRendererUtil.PAGE_LINK) %>
<INPUT type="hidden" name="<%=HttpPortletRendererUtil.portletParameter(request, "next_page")%>" value="/htdocs/mank_file/mank2.jsp"/>
<TR><TD width="35%" class=header3>NAME </TD>
<TD class=resultsord1> : <%=myrealname%>
<input type="hidden" size="10" name="name" value="<%=myrealname%>">
</TD></TR>
Jsp in second page..
String myname = request.getParameter("name");
but, when i check..the second jsp got null value from the first one..
The provider is ok...
Previously it works..but, since we configure back in the new server, it not work!..
Please help.
Regards,
Rushdan.
Have you put the tag <passAllUrlParams>true</passAllUrlParams> in your provider.xml for the portlet rendering the second JSP?
Similar Messages
-
Jsf passing parameter between jsp's
Hi
I have my main.jsp and another screen which i call object.jsp
the object.jsp can present an object in multiple ways : add, edit, view
i have 3 buttons in my main.jsp add, edit, view. I want to pass a parameter from main.jsp to object.jsp such that object.jsp will know in what state its being loaded... how do i do this?
Thanks..session?
as the article says :
To avoid these problems, developers might use session-scoped variables instead. This fixes both of those problems, but adds new ones:
A single user cannot have two windows open simultaneously; session-scoped variables are global to the user. So, for instance, a user could not work with two different search results simultaneously.
Back button support is highly limited, since navigating back can't magically restore the session to its old state. -
Passing parameter between jsp pages
Hi
I'v got the following problem: I have an jsp page that shows result of sql query as a list of 5 items, if there are more items returned - it shows first five, user is able to see more by clicking to a link which shows him the same page with next 5 items etc. The piece of index.jsp file with that link looks like that:
<html:link action="<%=(String)request.getAttribute("actionMod")%> module=... name=... styleClass=...>and at the end of initSearchAction I have:
req.setAttribute("actionMod","initSearch.do");Action is defined:
<!-- action for product list -->
<action path="/initSearch"
type="...list.InitSearchAction"
name="productListForm"
validate="false"
scope="request"
unknown="false"
>
<forward name="success" path=".search"/>
</action> .search is defined as
<definition name=".search" extends=".main">
<put name="body" value="/list/index.jsp" />
</definition>The problem is when I set a paramter in initSearchAction like that:
req.setAttribute("handle",h);and try to read it next time when initSearchAction action is running, parameter h is null. I need that to pass handle to stateful session bean that holds important information that need to be static during a session. Can anyone tell me how to pass that handle in some other way?
regards
anianow it works :)
I'm new to this things so I'm not familiar with all those sessions and requests...
thanks a lot
ania -
Hi All,
I want to pass a parameter (let us say data from a text box) from one JSP to another on an event (when 'Submit' button is clicked.). Can you please let me know how to go about this? Any sample codes or any other kind of help will be greatly appriciated.
Thanks in advance.hi,
It's quite easy, just go thru the following code.
one.jsp
<form action="two.jsp" method="post">
<input type="text" name="name"/>
<input type="submit" value="Press"/>
</form>now receive the value in two.jsp and print the same.
two.jsp
<%
String name=request.getParameter("name");
out.print("Your Name -->"+name);
%>Bala -
Passing Parameter between Methods
I have some problems because i don't really know how to pass parameter between methods in a java class.
How can i do that? below is the code that i did.
I want to pass in the parameter from a method called dbTest where this method will run StringTokenizer to capture the input from a text file then it will run storeData method whereby later it will then store into the database.
How can i pass data between this two methods whereby i want to read from text file then take the value to be passed into the database to be stored?
Thanks alot
package com;
import java.io.*;
import java.util.*;
import com.db4o.ObjectContainer;
import com.db4o.Db4o;
import com.db4o.ObjectSet;
class TokenTest {
private final static String filename = "C:\\TokenTest.yap";
public String fname;
public static void main (String[] args) {
new File(filename).delete();
ObjectContainer db=Db4o.openFile(filename);
try {
String fname;
String lname;
String city;
String state;
dbStore();
storeData();
finally {
db.close();
public String dbTest() {
DataInputStream dis = null;
String dbRecord = null;
try {
File f = new File("c:\\abc.txt");
FileReader fis = new FileReader(f);
BufferedReader bis = new BufferedReader(fis);
// read the first record of the database
while ( (dbRecord = bis.readLine()) != null) {
StringTokenizer st = new StringTokenizer(dbRecord, "|");
String fname = st.nextToken();
String lname = st.nextToken();
String city = st.nextToken();
String state = st.nextToken();
System.out.println("First Name: " + fname);
System.out.println("Last Name: " + lname);
System.out.println("City: " + city);
System.out.println("State: " + state + "\n");
} catch (IOException e) {
// catch io errors from FileInputStream or readLine()
System.out.println("Uh oh, got an IOException error: " + e.getMessage());
} finally {
// if the file opened okay, make sure we close it
if (dis != null) {
try {
dis.close();
} catch (IOException ioe) {
System.out.println("IOException error trying to close the file: " +
ioe.getMessage());
} // end if
} // end finally
return fname;
} // end dbTest
public void storeData ()
new File(filename).delete();
ObjectContainer db = Db4o.openFile(filename);
//Add data to the database
TokenTest tk = new TokenTest();
String fNme = tk.dbTest();
db.set(tk);
// try {
//open database file - database represented by ObjectContainer
// File filename = new File("c:\\abc.yap");
// ObjectContainer object = new ObjectContainer();
// while ((dbRecord = bis.readLine() !=null))
// db.set(fname);
// db.set(lname);
// db.set(city);
// db.set(state);
} // end class
Message was edited by:
erickhIn a nutshell, you don't "pass" parameters. You simply call methods with whatever parameters they take. So, methods can call methods, which can call other methods, using the parameters in question. Hope that makes sense.
-
Passing parameter between two applets
hi all,
i want to pass parameter between two applets. in other words, when user clicks the button; close the running applet, pass parameter to another applet and run another applet.
now i think that could be, ( creating a parameter table in database, when user click on button write parameters to table and stop active applet and run other applet. when other applet runs in init methot it takes parameter from table). but it will be very indirect way.
if you have an idea or information, plesae tell me.
thanks for your interestHi ,
Plz pay a visit to this wonderful website,
http://www.rgagnon.com/javadetails/java-0022.html / http://www.rgagnon.com/howto.html
Best Wishes,
Gaurav
PS : Thanks to Real Gagnon. This is all I can do at this stage, but wanted to say you are doing a wonderful job. -
Urgent! pass parameters between jsp pages
Does anyone can give an example about how to pass parameters between jsp pages?
This is what I do:
pageContext.forward("pag_loginc.jsp?p_idusr=" + strUsr + "&c_password=");
But when deployed is not working.
Help is needed.can you put that stuff in the session context in the first page, then pull it out in the second page?
-
Passing values between jsp and php
hi there, is it possible to pass values between jsp and
php? i really need to find out the way if there is
any. thanks in advance
-azali-Yes, there are a few ways to do this.
1) Think about using Cookies.
2) Maybe use a Redirect passing the values in the Query string.
3) Retain the data in a repository in the back end.
4) Using Hidden fields within your pages.
I am sure you can use these Idea's for a base to develop other methods on how to pass values back and forth from JSP -> PHP and vice versa.
-Richard Burton -
Using Go URL to Pass parameter between dashboard
Hi All,
I am trying to pass parameter using GO URL functionality from one dashboard analysis field to another dashboard.
The navigation is working properly but the parameter is not getting passed, I am not sure why.
The Called dashboard has a analysis which has IS PROMPTED filter attached to it for the passing filter. I tried various ways to make this work
Option 1
In the calling analysis, I am using a Narrative View and inside I have used the below code.
<a href="saw.dll?Go&Path=/shared/MI/_portal/Client-MI&Page=Supplier%20Detail%20Tab&Action=Navigate&P0=1&P1=eq&P2=Dim%20Supplier.Supplier%20Name%20Current&P3=1+%22STR%20LTD%22"> @2[br/]
This one navigate but filtering is not happening
Option 2 (My first preference will be this option)
Also I tried to provide custom Data Format under the column Properties
[html]"<font class="nav" onclick=\"JavaScript:GoNav(event, '/shared/MI/_portal/Client-MI/Supplier Detail Tab','Dim Supplier','Supplier Name Current','"@"');\">"@"</font>
This ends up giving error
Type mismatch of catalog object /shared/MI/_portal/Client-MI/Supplier Detail Tab -- expected , got .
Error Details
Error Codes: UVWDR6UA
Also, both the tabs (Called and Calling are under the same Dashboard)
Can anyone please let me know, were I am making mistake. I tried refereeing Oracle documentation but still no result.
ThanksLooks like you've got it almost right - just an extra unneeded "
<a href="two.jsp"?ant=<%= ant %>"><%=antName%></a>
which should render on the page as something like
My Ant Task
When you click the link, it should pass that parameter, and you can get it via request.getParameter(). -
Error while passing parameter in Oracle Jdeveloper
Hi All,
I was passed Crystal report viewer object From Servlet it is Running fine but one problem in that while passing parameter from that page to data base it is not supporting (The ok Button on page).
can any one tell me how to find Action Button (.Jsp page)
Because i am using .jsp page That was made in CR4E
in that i found only jsp code I have not get how to work Action of that button
Also another problem while making Viewer.jsp pge ..rpt-Crystal reports--->>Create Viewer Jsp->>Insert CrysatlReport viewer API code------->>>1.Connectparameterinthat report 2.connect the crystalreportPageViewer while makin this page i was running on Apache tomcat Server it is not displaying Anything only Displaying Blank Browser
Can Any one help me...
Sincerly
AmolFor your first question can you please be a little more clear as to what you are referring to? I am not familiar with an action button for the parameter pages.... what I can tell you is that we don't have any jsp code for the viewer controls, all of that is generated dynamically at runtime. We do have a viewer SDK that you can use to set properties on the viewer; information about this can be found in the [Developer Library|https://boc.sdn.sap.com/developer/library] in the Viewer SDK documentation book.
For your second question, I assume you are referring to generating a viewer page from a report in Crystal Reports for Eclipse. You will need to uncomment the viewer code (for some reason when the page is generated, the viewer code has block comments surrounding it). You will probably want to make sure the parameter code is uncommented as well.
In addition to this, there is a helper file called JRCHelperSample.java that contains all of the helper methods for the automatically generated viewer page. This can be modified in whatever way you wish to suit your needs. -
Pass parameter between programs
Hi,
I need to pass one parameter between 3 programs :
That is the actual flow of my parameter.
SAPF110V -> RFFOBE_I -> which include ZRFFORI99B)
get param <- RFFOBE_I <- set param
with statments
SET PARAMETER ID 'ZDBL' FIELD p_doublon.
GET parameter ID 'ZDBL' FIELD p_doublons.
But unfortunatly it doesn't work :/ (value of my param = 0)
I can run the include program in debug because it is run in background...
I can't use a Ztable
Any idea to pass value between this flow ?
Thanks,Hello,
The value which you want to pass between the programs can be stored in the SAP memory space by using the IMPORT and EXPORT to MEMORY ID statement.
EXPORT <internal table/variable> to MEMORY-ID 'MY MEMORY'.
Above statement will keep the value in SAP memory by creating a memory named as 'MY MEMORY'.
IMPORT <internal table/variable> from MEMORY-ID 'MY MEMORY'.
Above statement will get the value from SAP memory space.
But while using the above statement please consider that all the three programs should be run in the same session because the Memory that you are using will automatically be cleaned up by the Garbage collector as the session ends.
Hope it helps.
Thanks,
Jayant.
<<text removed - don't ask for points>>
Edited by: Matt on Nov 19, 2008 7:48 PM -
Portlet event link to pass parameter between portlets
Ok list, I followed the documentation Adding Parameters and Events to Portlets
PDK Release 2 (9.0.2 and later) and tried to make a portlet that pass parameter to another portlet using event link. I created the supposed parameter in the page and made the correct association to the receiving parameter portlet. The case is: The parameter is not caught in the receiving parameter page.
This is my event link jsp code:
<%
String sImgPath = PropertiesReader.getProperty(PropertiesReader.KEY_IMAGES_PATH);
PortletRenderRequest portletRequest = (PortletRenderRequest)request.getAttribute(HttpCommonConstants.PORTLET_RENDER_REQUEST);
// The portlet definition in provider.xml includes the following:
// - Event "submit" with event parameters "funcionalidade"
String eventSubmit = EventUtils.eventName("submit");
String eventParamFuncionalidade = EventUtils.eventParameter("funcionalidade");
// Build up the list of parameters for the "submit" event
NameValuePair[] eventSubmitParams = new NameValuePair[2];
// Give the 'funcionalidade' event parameter the constant value 'chat'
eventSubmitParams[0] = new NameValuePair(eventParamFuncionalidade, "chat");
// The event name must be passed as a parameter on the URL
eventSubmitParams[1] = new NameValuePair(eventSubmit, "");
%>
<TABLE CELLPADDING="0" CELLSPACING="0" BORDER="0">
<TR><TD><a href="<%=PortletRendererUtil.constructLink(portletRequest, portletRequest.getRenderContext().getEventURL(), eventSubmitParams, true, true)%>"><IMG SRC="<%= sImgPath + "menuButChat.gif" %>" BORDER="0"></a></TD><TR>
</TRABLE>
And this is my receiving parameter jsp code:
<%
String sFuncionalidade = "";
PortletRenderRequest portletRequest = (PortletRenderRequest)request.getAttribute(HttpCommonConstants.PORTLET_RENDER_REQUEST);
// Get the portlet definition - needed to get the public portlet parameters
PortletDefinition portlet = portletRequest.getPortletDefinition();
// Get the public portlet parameters
ParameterDefinition[] parameters = portlet.getInputParameters();
// Display all values for each of the public portlet parameters
for (int currParameter = 0; currParameter < parameters.length; currParameter++)
String name = parameters[currParameter].getName();
out.println(" <p>name = " + name + "</p> ");
// Get the parameter values
String[] values = portletRequest.getParameterValues(name);
// Display the parameter's values.
if ( values == null )
// Null array indicates no values for this parameter.
out.println(" <p>values i null</p> ");
else
out.println(" values nco i null ");
// Loop through each of the values and display non-null values on a separate line.
for ( int j = 0; (values != null) && (j < values.length); j++ )
sFuncionalidade = values[j];
out.println(" <p>" + sFuncionalidade + "</p> ");
%>
And this is my portlet definition in provider.xml:
<portlet class="oracle.portal.provider.v2.DefaultPortletDefinition">
<id>3</id>
<name>MenuColaboracao</name>
<title>Menu de Colaboragco</title>
<shortTitle>Menu de Colaboragco</shortTitle>
<description>Portlet de menu para funcionalidade de Comuicagco e Colaboragco.</description>
<timeout>10000</timeout>
<timeoutMessage>Portlet timed out</timeoutMessage>
<showEdit>false</showEdit>
<showEditDefault>false</showEditDefault>
<showPreview>false</showPreview>
<showDetails>false</showDetails>
<hasHelp>false</hasHelp>
<hasAbout>false</hasAbout>
<acceptContentType>text/html</acceptContentType>
<renderer class="oracle.portal.provider.v2.render.RenderManager">
<renderContainer>false</renderContainer>
<contentType>text/html</contentType>
<showPage>/menuColaboracao.jsp</showPage>
<pageParameterName>next_page</pageParameterName>
</renderer>
<event class="oracle.portal.provider.v2.DefaultEventDefinition">
<name>submit</name>
<description>Use this event to submit the form data to a page</description>
<parameter class="oracle.portal.provider.v2.DefaultParameterDefinition">
<name>funcionalidade</name>
<displayName>funcionalidade</displayName>
<description>Parbmetro que indica a funcionalidade a ser apresentada.</description>
</parameter>
</event>
</portlet>
<portlet class="oracle.portal.provider.v2.DefaultPortletDefinition">
<id>4</id>
<name>HomeController</name>
<title>Home Controller</title>
<shortTitle>Home Controller</shortTitle>
<description>Portlet que controla a exibigco do jsp correspondente a opgco de menu selecionada.</description>
<timeout>10000</timeout>
<timeoutMessage>Portlet timed out</timeoutMessage>
<showEdit>false</showEdit>
<showEditDefault>false</showEditDefault>
<showPreview>false</showPreview>
<showDetails>false</showDetails>
<hasHelp>false</hasHelp>
<hasAbout>false</hasAbout>
<acceptContentType>text/html</acceptContentType>
<renderer class="oracle.portal.provider.v2.render.RenderManager">
<renderContainer>false</renderContainer>
<contentType>text/html</contentType>
<showPage>/homeController.jsp</showPage>
<pageParameterName>next_page</pageParameterName>
</renderer>
<inputParameter class="oracle.portal.provider.v2.DefaultParameterDefinition">
<name>funcionalidade</name>
<displayName>funcionalidade</displayName>
<description>Parbmetro que indica a funcionalidade a ser apresentada.</description>
</inputParameter>
</portlet>
Where do I miss ???
Any help will be appreciated.
Regards,
Leandro.Leandro,
Few things which you might want to cross check to see if we are
on the right track :
1. Page containing Parameter receiving portlet contains a
paga parameter mapped on to its public parameter.
As per your example, parameter receiving page should have a page
parameter with name - "funcionalidade" - and portlet's corresponding
parmeter should be mapped to this page parameter. This can be
done through "Parameters" tab in the Page Properties screen.
2. Page containing Parameter passing portlet contains proper event
mapping.
As per your example, we have an event called "submit". We should
be able to see "submit" event under "MenuColaboracao" portlet.
When this event is raised, select which page should receive the event
data. As soon as a page is selected, this page's public parameters
are displayed below. Beside that we must be able to see a choice box
which displays four choices one of which would be "Event Output".
Map this output to the event parameter.
Hope it helps.
-AMJAD. -
Pass parameter between uix page
Hi, I am new to JDeveloper UIX technologies. I have created two uix page: page1 is built on a view. Page2 is on a table. How do I pass a parameter (customer_id) from page1 to page2?
Any help is appreciated. Thanks ahead!You can get the sample code for your answer here:
http://otn.oracle.com/sample_code/products/jdev/index.html
Download sample code with title:
Passing values between pages
Or alternatively your can keep the customer_id in the session during ActionForward then passing back the value into a textbox in page 2.
Code in ActionForward:
request.getSession().setAttribute("customer_id", value);
Code in UIX Page 2:
<textInput text="${sessionScope.customer_id}" name="code2"/>
Thanks.
Alex Cheong -
I would like to pass values between pages.
I don't want showing up on the url. Ex: some.jsp?param=value
I don't feel it's safe.
It's not coming from form either....
How can I hide the value and pass it to next page?
I want to pass the value when the user click on a hyperlink
Thanks In Advance.
Message was edited by:
TheepanClient side information is never safe no matter what you do. If the values don't end up in the url, they are always present SOMEWHERE in the html content.
If you don't want the values to end up in the url, rework the page so it DOES do a post form submit. You could turn the hyperlink into a javascript call that submits the form for you. -
How to pass parameter between two jsp pages using web link (not form)
Hi Friends,
I have two jsp pages and would like to pass a parameter from one JSP page (one.jsp) to another JPS page (two.jsp)
in one.jsp
<a href="two.jsp?ant="<%=ant%">"> <%=antName%> </a><br>
I don't know how to pass value of parameter "ant" to two.jsp from one.jsp.
Can anyone help this? Thank you in advance</a>Looks like you've got it almost right - just an extra unneeded "
<a href="two.jsp"?ant=<%= ant %>"><%=antName%></a>
which should render on the page as something like
My Ant Task
When you click the link, it should pass that parameter, and you can get it via request.getParameter().
Maybe you are looking for
-
I was just about to order a photo book, using photos stored on an external hard drive. I organised the book and pressed 'buy'. IPhotos instructed me that I needed to upgrade and so I went on the ASpp store, bought the upgrade and installed as directe
-
On My iphone 4s i cant hear the audio when i plug in my headphones
Ever since i got my iPhone 4s every time i plug my headphones into my phone and try to listen to music or a youtube video i can barely hear the sound at all even if the volume is all the way up. I don't know what to do. The same thing happened with t
-
I have a problem with the script editor that is login (Windows login, not Oracle login) dependent. For some Windows users, the script editor doesn't work properly. For those users, the editor page will appear but the edit pane cannot be written. In a
-
Increase 'archive_max_process' in oracle 10g
Dear Friends , I want to increase the value of 'archive_max_process' dynamically (i.e., alter system or alter database ) in my oracle 10g . Is it possible to do ?
-
How can we differ which is a fact and which is a dimension?
Hi All, I'm a new bee to OBIEE... If any one can help me out or provide me a link... if we have multiple facts and dimensions? How can we differ which is a fact and which is a dimension? Thnkx in Advance.