User e25fe1ac40
04-01-2005 16:11:38
I have had some difficulty with the following constructs, which alter the example set provided by ChemAxon to do new things. I want a button I've created in my applet genereated hit display table (from "searchresults.jsp") to do an additional search/retrieval. So I pass a parameter to a modified "searching.jsp" as follows
from the "action" portion of the applet parameters
"| <%= obj[0][4] %> |%|searching.jsp?Name=<%= obj[0][4] %>"+ [where obj[0][4] is the field data that represents a compound id]
to capture the "Name" I have in the searching.jsp the following
String Compound = (String)request.getParameter("Name");
followed by
session.removeAttribute("Cmpd");
session.setAttribute("Cmpd", Compound);
The I add to my own sql search filter ("SearchString") as follows
String CompoundIDent = new String((String)session.getAttribute("Cmpd"));
SearchString.append(CompoundIDent);
This does not retrieve the new "Compound" (I get the last succesfully retrieved compund) even though I can use the following manual construct to successfully retrieve a new "Compound"
String Compound = new String("Name");
entering the "Name" parameter manually and everything else being the same.
However, as evidence the dynamic passing seems to be working, I can also output into a HTML text (generated from within "searchresults.jsp") the new "Name" variable using the first, dynamically altered string construct in "searching.jsp" (and the manually altered string construct) as follows (again, from within "searchresults.jsp")
Here is the compound ID <%= (String)session.getAttribute("Cmpd") %>
but the molecule displayed is only from the last successful search ....
Perhaps this is more complex than it has to be, but I admit to being a beginner at Java, JSP and JavaScripting... Thanks, Manton
from the "action" portion of the applet parameters
"| <%= obj[0][4] %> |%|searching.jsp?Name=<%= obj[0][4] %>"+ [where obj[0][4] is the field data that represents a compound id]
to capture the "Name" I have in the searching.jsp the following
String Compound = (String)request.getParameter("Name");
followed by
session.removeAttribute("Cmpd");
session.setAttribute("Cmpd", Compound);
The I add to my own sql search filter ("SearchString") as follows
String CompoundIDent = new String((String)session.getAttribute("Cmpd"));
SearchString.append(CompoundIDent);
This does not retrieve the new "Compound" (I get the last succesfully retrieved compund) even though I can use the following manual construct to successfully retrieve a new "Compound"
String Compound = new String("Name");
entering the "Name" parameter manually and everything else being the same.
However, as evidence the dynamic passing seems to be working, I can also output into a HTML text (generated from within "searchresults.jsp") the new "Name" variable using the first, dynamically altered string construct in "searching.jsp" (and the manually altered string construct) as follows (again, from within "searchresults.jsp")
Here is the compound ID <%= (String)session.getAttribute("Cmpd") %>
but the molecule displayed is only from the last successful search ....
Perhaps this is more complex than it has to be, but I admit to being a beginner at Java, JSP and JavaScripting... Thanks, Manton