Forums Register Login
assign string to an extern page !!!
is it possible to assign a string in a textfield of an extern page that I forward...if yes...how....
I'm afraid I don't understand what it is you're trying to do. Could you please elaborate?
ok, for example you want to reach a extern page from your page (e.g: www.google.com) to retrieve information from this page.
and you want to assign a string to the page www.google.com and to execute the request....

hopefully i expressed it better this time

you can just pass whatever information you want as parameters.

For example:

<a href="http://www.google.com/search?hl=en&q=java">Click here to find google entries for Java</a>

If the page is dynamic, you can make dynamic substitutions for the parameters as in:

<a href="http://www.google.com/search?hl=en&q=<%=search >">Click here to find google entries for <%=search ></a>
hi merril,
i have tried the first link and it works fine, but the second doesn't work...
get the following error message:

but my actual page, that I want to reach is:

and there I want my string in the textfield above....

and is there a possibility that it could be executed too.....
That was a typo on my part. The line that I gave you should have read:

<a href="http://www.google.com/search?hl=en&q=<%=search %>">Click here to find google entries for <%=search %></a>

Note that in order for this to work, you'd have to establish the variable "search" in your JSP prior to the statement. Something like this:

<% String search = "java"; %>
hi merrill,
I have tried to assign the string (accession_code) in the jsp page to a hyperlink (html:link) and to a button (html:button) but it doesn't work.
but i guess it should work in that way.....

code for html link:

code for html button:
hi merrill,
sorry for this mess, but I tried to paste the entire code, but I couldn't get it to work....

you can see that both html:link and html:button has the property "accession_code" so I just want that if I click on the link or button that it takes the property and forward to the specified page with the string....
I have tried it with onlick and ohter things...... and your code fragment...
The above tags are not well-formed, nor do they conform to the requirements of the TLD, so it's no mystery that they don't work.

Please read This link to understand how to use the <html:link> tag.

You must specify the URL of your destination page using the "href" property. The paramName must refer to a javaBean that has already been created in some scope (request, session, etc.). If the javaBean can be displayed as a String, paramName is all you need. If the bean has a property you want to use, you must specify which property to use with the paramProperty attribute of the tag.

Here's my previous example reworked to use the <html:link> tag

thanks, you code fragment worked fine for the google page, but if i tried it with the page I want to forward it didn't work.

I want to forward to this page http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?CMD=search&DB=protein
and assign the string to the textfield, but I couldn't get it to work, so I tried it the way shown above, but it didn't work either....

I went to the URL you gave and did a "view source" of the page from my browser. I found that the name of the <input> for the search field is "term". That means the name of the parameter you have to pass to the URL is "term".

Also, if you've already defined a bean named proPep with a property of accession_code, you don't have to re-define it with a bean:define tag. Just use it.

With that said, the following should work.

hi merrill,
thanks a lot, it works very well...

Wink, wink, nudge, nudge, say no more ... https://richsoil.com/cards

All times above are in ranch (not your local) time.
The current ranch time is
Dec 15, 2017 05:13:38.