Building dynamic URLS in jsp
Hello,
I wonder if you could help , please.
I have prepared a JSP page which has three different combo boxes.
Depending on the option chosen , I have to submit the form to an html page that it is located in a different server.
So I have to make the url to that server but with the value chosen in the last combo box.
I mean , in another server in the address (http://www/ejemplo.com/test/)I have pages like :
a1.html
b2.html
c1.html
Where a1, b2 and c3 are the values chosen in the last combo.
I have an input button , and when it is clicked , it should forward to the address:
http://www/ejemplo.com/test/a1.html if a1 were chosen.
I have written teh following code, but it does not work....How can I do it??? Could anybody help, please???
<INPUT TYPE="submit" name="Solicitud" value ="Request Page" >
<%
if ( request.getParameter("Solicitud") != null )
String pagina = "http://www/ejemplo.com/test/" ;
String sel3 = request.getParameter( "Combo3" );
pagina = "pagina" + "sel3";
pageContext.forward(pagina);
}%>
</form>
Hi Ani,
First of all, you were correct , I forgot to include the .html for the option chosen in the combo3.....I have corrected it..but still does not work....
Do you have any idea???
Here you have my new code...
<INPUT TYPE="submit" name="Solicitud" value ="Request Page" >
<% if ( request.getParameter("Solicitud") != null )
String pagina = "http://www.ejemplo.com/test/";
String sel3 = request.getParameter( "CountryCode" );
sel3 = sel3+".html";
pagina = pagina + "sel3"; //removed the quotes for pagina
%>
<jsp:forward page="<%=pagina%>">
</jsp:forward>
<%}%>
</form>
Similar Messages
-
How to build dynamic menus using JSP==Urgent==Please Help me
Hello,
I have exhausted searching on internet to find a book
which tells how to build Dynmic menus in JSP.I dont want
to use DHTML as this becomes complex as the menu categories
are built using data from database.Is there any workaround in
java to do this without DHTML or atleast sample code.
can somebody help me in this regard.
Thanks
JackHello a.s.kumar,
I would be greatful if you could send me the sample code.
[email protected]
we can't let MM Flash run away with the show can we. Javascript can do a decent job, but the underlying menu data is static.
Cheers, Darren -
Hello experts,
I'm searching for a possibility to build up dynamically a portal url like this:
http://<hostname>:<port>/irj/portal?NavigationTarget=navurl://dcaceb3f782aa37c63aedfdc8347c7b5&....
&CurrentWindowId=WIDDefaultExternal1250835714537&NavigationContext=navurl://39fccbe94b41d07fd15b942490ec5e9e
The goal is it to start the browser with the seached URL from an ABAP report. How to start the internet browser I allready now. Is there any ABAP class for building such urls with parameter support?
Thanks in advance.
Best Regards
Clemenshi,
this is one [WAY|http://help.sap.com/saphelp_nw04/helpdata/en/d3/ab0b5decd045e482d0deae9f9c90d5/frameset.htm]
let me know is that ok for u or ......
if u r using webdynpro for abap check for the manus Dua post
How to open URL IView with dynamic url parameter (navigate_absolute)
let me know u need more info
ravidndra -
Dynamic URLs in WebIntelligence BO 4.0
HI together,
I´ve got a WebIntelligence Document with a table.
One Column of the table should be a opendocument Link to another webi. The Content of the cell should be part of the
openDocument link.
I tried the following steps:
On the selected column -> Linking -> Add Hyperlink -> Here I´ve added the URL -> Button Parse
Now I can "Customize the following dynamic elements of the URL" ; when I choose select object for a parameter the URL contains the object I´ve selected:
The URL looks like:
http://server:port/BOE/OpenDocument/opendoc/openDocument.jsp?iDocID=4342323944sd444&sIDType=CUID&sRefresh=Y&lsRParameter=(
[Kontonr]
The Object
[Kontonr]
is also the value of the column.
I can´t confirm this change with "OK" -> Nothing happens.
Has anyone an idea to build a correct dynamic URL?
Kind regards
Lars
Edited by: Lars Ohm on Jan 24, 2012 6:45 PMHi Lars,
Too late to reply, though might help the future visitors !!
This how it should be parsed :
http://server:port/BOE/OpenDocument/opendoc/openDocument.jsp?iDocID=4342323944sd444&sIDType=CUID&sRefresh=Y&lsRParameter=(=[Kontonr])
Thanks,
Kaarthi -
I know I can uset the url:{'c:\logo.gif'} in a picture to dynamically load a gif into by report, but how do I do it if I want the location of the gif to come in on the XML so that I can have different logos or signatures based on the report data?
Build the URL dynamically. Use an if-then-else or choose test based on some attribute. Then the url can be set using concat (as an example).
http://download.oracle.com/docs/cd/E12844_01/doc/bip.1013/e12187/T421739T481157.htm
Element reference from XML file -
Open a Dynamic URL from a Table column link
Hi,
Jdev Version (11.1.1.6.0)
I have requirement to open a dynamic URL from table column. Any time I click on link, it should generate dynamic URL based on column attribute and open in popup or browser. Can someone pls suggest how to achieve this.
Thanks
Ank1)If you have any parameters that needs to be passed to build that dynamicURL, just set a propertyListener on the column attribute and get the value.
2)Then on the af:commandLink action, build your dynamicURL with the required parameters.
3) If you URL is all together a different application which doesn't share your transaction, you can open it as below
In the below code, urlWithParams will be your dynamicURL.
ExtendedRenderKitService erks =
Service.getRenderKitService(facesContext, ExtendedRenderKitService.class);
StringBuilder sbURL = new StringBuilder();
sbURL.append("window.open(\"" + urlWithParams + "\");");
erks.addScript(facesContext, sbURL.toString());
You can also try the above response by user 948181.
Hope it helps. -
Need Dynamic Table in JSP page
Hi Friends,
I need to build table dynamically in my JSP page.
My requirement like:
I have a Button in my JSP page when i click that it should go to another jsp where it will ask me the row and column counts, after i entered some values then i have a button to say OK it should go to the first page again there i want the table for the rows and columns dynamically.
(like MS- Word when u create table it will ask the row count and column count after that its building a table)
Please help me....Make use of JSTL's c:forEach.
-
Creating dynamic URL parameters
I need to access the form value j_username to create a dynamic url but the following JSP code snippet is putting a blank value into �username�. This is before the form is submitted.
Any ideas ?
<input type="button" name="btnPassword" value="Password?" onClick=
"<c:url var="emailMyPwdUrl" value="secure/MailPasswd.do">
<c:param name="username"
value= "${document.loginForm.j_username.value}"/>
</c:url>
<input type="button" name="btnPassword" value="Password?"
onClick="document.location='${emailMyPwdUrl}';"> "> I also tried with JavaScript and am having the same problem!
function getLogin() {
var user = document.loginForm.j_username.value;
if ( user == '' ) {
alert( 'No User Name Entered');
else {
alert('User Name Entered:' + user);
<c:url var="emailMyPwdUrl" value="secure/MailPasswd.do">
<c:param name="username"
value= "${document.loginForm.j_username.value}"/>
</c:url>
document.location='${emailMyPwdUrl}';
}Thanks for your reply,
So basically when the user presses the "btnPassword" button I want to get the value "j_username" from the form and then redirect (no submit!)to "secure/MailPasswd.do" with parameter "username".
I do not want to submit the form when "btnPassword" is pressed as this will cause the "j_security_check" action to take place.
I am correctly redirected to "secure/MailPasswd.do" but the problem is the parameter "username" is blank when I try to getParameter on the "secure/MailPasswd.do" page.
So am I setting the c:param username correctly ?
Here is the full JSP page as I pasted it incorrectly the last time...
c:set var="fullPath" value="${pageContext.request.contextPath}"/>
<form name="loginForm" method="post" action="j_security_check">
<table border="0"
width="350"
height="263"
align="center"
background="${fullPath}/images/include/collage.gif">
<tr>
<td colspan="3" align="center">
<c:if test="${not empty error}">
<font class="error">${error}</font>
</c:if>
</td>
</tr>
<tr>
<td colspan="3" align="center">
<c:if test="${not empty message}">
${message}
</c:if>
</td>
</tr>
<tr>
<td align="center">
<table border="0">
<tr>
<td align="right">
<span class="text">User ID</span>
</td>
<td align="left" colspan=2>
<input type="text" name="j_username" size="21" />
</td>
</tr>
<tr>
<td align="right">
<span class="text">Password</span>
</td>
<td align="left" colspan=2>
<input type="password" name="j_password" size="21" />
</td>
</tr>
<tr>
<td></td>
<td>
<input type="submit" value="${buttonLabel}" />
</td>
<td>
<input type="button" name="btnPassword" value="Password?"
onClick="
<c:url var="emailMyPwdUrl" value="secure/MailPasswd.do">
<c:param name="username"
value= "${document.loginForm.j_username.value}"/>
</c:url>
document.location='${emailMyPwdUrl}';"
</td>
</tr>
</table>
</td>
</tr>
</table>
</form> -
HTTP Receiver Adapter : Dynamic URL
Hi,
I have a scenario where I wish to build a dynamic URL for the HTTP Receiver Adapter. The URL will contain a customer number which is present in the mapping.
The help seems to suggest that this is possible :
<i>If you want to use an HTTP destination or URL set by the mapping, set the URL or HTTP Destination indicator. (The indicator displayed depends on the Addressing Type you selected above). If you set the indicator, the URL or HTTP destination set dynamically is called by HTTP.
If the message header does not contain the URL or the HTTP destination, and you have set the Fail If Adapter-Specific Message Attributes Missing indicator, the XI message is set to status System Error. If you do not set the indicator, the URL or HTTP destination defined statically in the communication channel is used.</i>
However, it is not very clear where the URL needs to be set dynamically.
Does anyone know how to achieve this ?
Cheers
Colin.hello to all,
We have a unique issue with one of our customers that is limited to 100 character URL. The current url is http://mycompany.com/sap/xi/adapter_plain?namespace=urn%3Agoodyear%2Ecom%3AAIT%3AInventoryCheck&interface=AITInventoryCheck_Abs&service=HTTP_AIT_InvChk&QOS=BE&sap-client=010&sap-language=EN
Is there a way to have a URL like
http://mycompany.com/sap/xi/adapter_plain?namespace=urn%3Agoodyear%2Ecom%3AAIT%3AInventoryCheck
and then somewhere in the process add... &interface=AITInventoryCheck_Abs&service=HTTP_AIT_InvChk&QOS=BE&sap-client=010&sap-language=EN
So the data comes to an F5 through the DMZ to the SAP webdispatcher then to the SAP XI system.
Any ideas if this is possible or how you could start with a shorter URL?
Thanks,
Dede -
Dynamic URL for Exploration View
Hi Experts,
We know that we could create Dynamic URL for InfoSpace to get its facet value and chart type
Would you kindly let me know whether it is possible to get dyanmic URL for Exploration View
I know it's hard to set chart type but we just want to fitler value on facet
Best regards
Alex yangHi Mallik,
Thanks for your help
But it looks like this kind of thing does not even for InfoSpace.
According to the document from SAP, http://help.sap.com/businessobject/product_guides/boexir4/en/xi4_exp_admin_en.pdf
The strucutre will be as below for InfoSpace if you want to pass parameter value
http://Test.com:8080/explorer/index.jsp?isna=Dynamic URL Test&fans=Year_:_2013
We need to use isna to get infospace name or document id and using Fans to get facet value
But we do not know what's the key word to get exploration view name
Would you kindly let me know whether there is some document to use?
Best regards
Alex yang -
Hello,
I am currently working on a new webshop at which i want to
rewrite a dynamic URL.
Currently the UL looks like this:
http://www.mysite.nl/product.php?categorie=hat&subcategorie=red%20hat&slug=super%20hat
I want to make it look like this:
http://www.mysite.nl/hat/red-hat/super-hat/
However, I cannot get this to work!
I currently have this code running which always makes sure
the URL starts with "
http://www."
Options +FollowSymLinks
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} !^www\.mysite\.nl$ [NC]
RewriteRule ^(.*)$
http://www.mysite.nl/$1
[R=301,L]
I want to use this code to rewrite the URL:
RewriteRule
http://www.mysite.nl/(.*)/(.*)/(.*)/
product.php?categorie=$1&subcategorie=$2&slug=$3
So the .htaccess file looks like this:
Options +FollowSymLinks
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} !^www\.mysite\.nl$ [NC]
RewriteRule ^(.*)$
http://www.mysite.nl/$1
[R=301,L]
RewriteRule
http://www.mysite.nl/(.*)/(.*)/(.*)/
product.php?categorie=$1&subcategorie=$2&slug=$3
However, this doesn't seem to work. Can anybody help
me?Hello,
I have a little followup question concerning this point. I
currently use this URL php to build my URL:
<a href="/<?php echo str_replace(array('%20', ' '),
'-', $row_Recordset1['categorie']) . "/" . str_replace(array('%20',
' '), '-', $row_Recordset1['subcategorie']) . "/" .
str_replace(array('%20', ' '), '-', $row_Recordset1['slug']) .
".html"; ?>">
This works perfectly, however, I need to write a "slug"
variable for every inputted product. The slug is simply the name
where dashes and such are replaced by "-" so no errors occur when
the GET is done on the product page. No ID number is used because
the SLUG is better SEO, t contains the product name...
This takes too much time however. I really want to use the
"name" (product name) variable instead. Someone wrote a nifty peace
of code for this:
* function to automatically convert text string to URL string
* @param string $str text string to convert
* @param int $optimize - set to max number of words in URL
* @return string $str
function writeUrl($str,$optimize = false) {
//global $config;
//uses('sanitize');
$str = strtolower(trim($str));
$str = html_entity_decode($str, ENT_QUOTES);
$patterns[0] = '/ - ¦ \/ /'; // existing hyphen with
space, or existing forward slash with spaces (' - ', or ' / ')
$patterns[1] = '/ ¦ /'; // space and double space
$patterns[2] = '/\//'; // forward slash
$replacements[0] = '-';
$replacements[1] = '-';
$replacements[2] = '-';
$str = preg_replace($patterns, $replacements, $str);
//$sanitize = new Sanitize;
//$str = $sanitize->paranoid($str,array('-'));
// shorten and optimize url if required
if ($optimize) {
$stopWords = array('all',
'and',
'its',
'the',
$acceptableWords = array(
'le', // eg: le mans
$strArray = explode('-',$str);
// remove empty values
$strArray = array_filter($strArray);
// remove stop words and short words
foreach ($strArray as $key => $value) {
if (in_array($value,$stopWords) ¦¦
( strlen($value) <= 2 &&
!in_array($value,$acceptableWords) ) ) {
unset($strArray[$key]);
// remove duplicate values
$strArray = array_unique($strArray);
// slice array to max number words, resetting array keys in
the process
$strArray = array_slice($strArray, 0, $optimize);
// if last word is numeric, remove it so as not to confuse it
with page number
for($i=0;$i<count($strArray);$i++) {
$lastKey = count($strArray)-1;
if (is_numeric($strArray[$lastKey])) {
unset($strArray[$lastKey]);
// construct complete url string
$str = implode('-',$strArray);
return $str;
The following code outputs text where all dashes and such are
replaced by "-":
$text = 'The quick brown fox jumps over the lazy dog';
echo writeUrl($text, 6);
// result:
// quick-brown-fox-jumps-over-lazy
I think it should be possible to use this to create the URL,
something like:
<?php
$text = '". $row_Recordset1["categorie"] ."/".
$row_Recordset1["subcategorie"] ."/". $row_Recordset1["name"]
.".html';
echo writeUrl($text, 6);
?>
This doesnt seem to be written properly, can you guyz tell me
if this is a good way and how exactly do I need to formulate the
php input?
Thanks! -
About how to build dynamic maps using jdeveloper 10g and mapviewer
i follow the guidance (about how to build dynamic maps using jdeveloper 10g and oracle application server mapviewer) to write a jsp file,but error take palce ,i get information "Project: D:\jdev1012\jdev\mywork\WebMap\ViewController\ViewController.jpr
D:\jdev1012\jdev\mywork\WebMap\ViewController\public_html\WebMap.jsp
Error(12,37): cannot access class oracle.lbs.mapclient.taglib.MapViewerInitTag; file oracle\lbs\mapclient\taglib\MapViewerInitTag.class not found
Error(12,190): cannot access class oracle.lbs.mapclient.taglib.MapViewerInitTag; file oracle\lbs\mapclient\taglib\MapViewerInitTag.class not found
Error(12,102): cannot access class oracle.lbs.mapclient.taglib.MapViewerInitTag; file oracle\lbs\mapclient\taglib\MapViewerInitTag.class not found
Error(12,28): cannot access class oracle.lbs.mapclient.MapViewer; file oracle\lbs\mapclient\MapViewer.class not found
Error(12,40): cannot access class oracle.lbs.mapclient.MapViewer; file oracle\lbs\mapclient\MapViewer.class not found
Error(13,37): cannot access class oracle.lbs.mapclient.taglib.MapViewerSetParamTag; file oracle\lbs\mapclient\taglib\MapViewerSetParamTag.class not found
Error(13,198): cannot access class oracle.lbs.mapclient.taglib.MapViewerSetParamTag; file oracle\lbs\mapclient\taglib\MapViewerSetParamTag.class not found
Error(13,106): cannot access class oracle.lbs.mapclient.taglib.MapViewerSetParamTag; file oracle\lbs\mapclient\taglib\MapViewerSetParamTag.class not found
Error(14,37): cannot access class oracle.lbs.mapclient.taglib.MapViewerRunTag; file oracle\lbs\mapclient\taglib\MapViewerRunTag.class not found
Error(14,188): cannot access class oracle.lbs.mapclient.taglib.MapViewerRunTag; file oracle\lbs\mapclient\taglib\MapViewerRunTag.class not found
Error(14,101): cannot access class oracle.lbs.mapclient.taglib.MapViewerRunTag; file oracle\lbs\mapclient\taglib\MapViewerRunTag.class not found
Error(15,37): cannot access class oracle.lbs.mapclient.taglib.MapViewerGetMapURLTag; file oracle\lbs\mapclient\taglib\MapViewerGetMapURLTag.class not found
Error(15,200): cannot access class oracle.lbs.mapclient.taglib.MapViewerGetMapURLTag; file oracle\lbs\mapclient\taglib\MapViewerGetMapURLTag.class not found
Error(15,107): cannot access class oracle.lbs.mapclient.taglib.MapViewerGetMapURLTag; file oracle\lbs\mapclient\taglib\MapViewerGetMapURLTag.class not found"
can you help?
greetingsI found a lot of information in document 133682.1 on metalink.
step by step example how to deploy a JSP business component application. -
How create dynamic URL for every row shown in the report?
Hi,
Iam new to this Application. I created one interactive report to find the number of bugs logged for every product and its sub component for past one year. The report will look like below structure in the application.
Product Subcomponent Total
P1 S1 10
P2 S2 4
P2 S21 15
Now i want to pick the value of Prouct and sub component for every row dynamiaclly and want to generate the URL with the conditions and make it as hyperlink for the Total Column.
Iam able to make hyperlink for the Total column using the edit options for the total attribute, but it is opening the same page for all the rows in the total column. I want to generate dynamic URL by picking the value prodcut and sub componenet dynamically from the report for every row and want to make it as hayperlink for every row individually.
Please tell me how to do this?
Please revert back if you are not clear. Appericiate for your quick help.Hello <unknown user>,
So you already set the Column Link attributes for your Total column. Should all links go to the same page, but with different parameters (ProductID, SubcompID)? Or to another page? And how can you determine that page?
Assuming you'll go to a sort of detail page or form:
Target = [Page in this app]
Page = <your target page no>
Item1 = <ProductID field in target page>
Value = #PRODUCTID#
Item2 = <SubcompID field in target page>
Value = #SUNCOMPID#
(you can use the ' flashlight' for getting the correct values)
Greetings,
Roel
http://roelhartman.blogspot.com/
You can reward this reply by marking it as either Helpful or Correct ;-) -
Hi,
We have created an iView of type "com.sap.portal.appintegrator.sap".
In URL template property we have set the following value:
<System.protocol>://<System.server>:<System.port><System.uri>?parameter=value¶meter=value&...
That's to say, it is a dynamic URL that is built at runtime.
My question is: How can we find out the value of URL when we preview the iView, that is, the URL value at runtime?
Helpful answers will be rewarded!!
Thanks in advance,
Samantha.Hi Samantha,
If I am understanding the issue properly.
the solution is:
there is no way you can get the url for iView.
You need to assign the iView to Role. and assign it to a user.
When you open the iView then from title bar select Add to Favorites, this will save it in the Browser favorites and when you go to the link and see the properties you get the Short URL.
In Portal terminology the Dynamic URL is called Short URL.
And to find the short url navigate to
System Administration->Navigation-> Short URLs
Hope this helps you.
Pramod
-award points if helpful -
How to call a dynamic URL on 'button press' event, in MVC-based BSP
Hi,
My requirement is as below:
On selecting a row in table view, and pressing a button, I need to open a browser.
The Browser URL depends on the row selected.
The key field from table view, is added at the end of the URL string.
Shortly, I can say that, I am getting a value on row selection & want to pass it to button event.
In Views Section, there are 2 tags- (1)table view & (2)button.
Right now, I have put the code for getting the key field, in DO_HANDLE_DATA method.
In Button's OnClientClick method, I have called the Javascript to open the browser.
If I now write the code to concatenate the key field value to form the dynamic URL in 'OnClick' method,
it will be called only after the browser is opened.
(as OnClick event is executed only after OnClientClick event is executed)
Could anyone please tell me what event (and in which tag) can be used to solve this.
Is there any event which is triggered, as soon as the row is selected, & before the button press event is triggered ?
Would really appreciate responses made to this query.
Thanks,
Nisha Vengal.Hi Nisha,
The crux of your issue here is that you want to call the event triggered with onClick before calling the event triggered on onClientClick. This can be achieved by the following code in the function called on the onClientClick.
function fn_button()
htmlbSL(this,2,'b_row_selection:onInputProcessing()');
window.open("new_page",target="BLANK");
Here, fn_button is the javascript function called on button click, and b_row_selection is the event triggered on the onClick event of row selection.
Try this out and let us know if it works for you.
Regards,
Saurabh
Maybe you are looking for
-
All in the tittle Ni error message : it opens then immediatly close iPad
-
Is there a way to view psd thumbnails in Windows 8?
Is there a way to view psd thumbnails in Windows 8 without downloading third-party software?
-
Installing Lightroom 4.4 on a new computer
I have to migrate from a windows pc to a mac. I have already installed Lightroom 4.4 on the new mac book pro. How can I manage the migration without loosing all my Catalogs, photos, templates, and all the work done on my photos with Lightroom? Which
-
Caching swf per page with document.write
To solve "click to activate this object", i use document.write to put flash files.. But this prevents caching. I have "the same" swf files for many items on the page, and browser loads that swf, "item" times. And this triggers my Denial of Service pr
-
Changed home name lost all data
Has anyone experienced this? I changed my home name (has first and last name, took out last), was on the internet, and then lost everything. Any programs I opened wanted me to register. I restarted, and now everything is gone, but it is in the origin