This week's book giveaway is in the Agile and Other Processes forum. We're giving away four copies of Real-World Software Development: A Project-Driven Guide to Fundamentals in Java and have Dr. Raoul-Gabriel Urma & Richard Warburton on-line! See this thread for details.
Hi I'm using servlet to search for learning concepts. for example when the user query about validation and click submit the results appear as following:
important learning resources: [url]hyperlink1:
other related topics [url]topic1
for the first list it is dirct hyperlink. For the second list I need to hyperlink each topic so that when clicked the topic will be send to a method to search for it and display result. So there is no direct URL but I need to allow the user (if want to) to select one of the topic and send it for a search methd. How this can be done? shall I use the <a> tag with herf? but there is no url. or is there another way to make the action go to another servelet or method?
You seem to think it's possible to make a hyperlink which will connect to your server and call an arbitrary method in your Java code. It isn't.
When connecting to a servlet, the link will either call the doGet() method or the doPost() method of the servlet depending on how the link is set up.
So if you need certain methods to be called, the way to do that is to pass parameters to the servlet, which the servlet code will then inspect and do the appropriate thing, as Bosun Bello already suggested.
posted 8 years ago
I'm not sure that I clearly understand what you said. This is my first servelet that manipulates OWL ontology using Jena and JessBridge. Everything works fine except this part. Do you mean that I build another servlet within the project that accepts parameters and call it in hyperlink?
the herf is the an attribute of the <a> tag that allow displaying text as hyperlink in html. Is there another way?
posted 8 years ago
I don't think this can be done using JSP as the output is changrd each time based on creating instances of other classes and calling some methods of these classes which returns the results in vectors that are displayed to the user
OK. suppose that I make this search task using JSP then it displays the results as in first message then when one of the topics is clicked the same process will be done for this topic as the query text. Will it be possible to receive client request (clicking the topic) in a JSP and then make the JSP call itself to restart the search process?
Is there a good reference for such code that I can learn from it. I run out of time
where testMethod placed in the same servlet. and SQA>System is the package.
There is no syntax error. The application runs correctly untill I click on one of the topics where the function testMethod should be processed but it doesn't. I think the problem is with the function URL. I also tried it without the package name.
Does any one knows what I did wrong? How I should pass the method testMethod?
But how did the elephant get like that? What did you do? I think all we can do now is read this tiny ad: