cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Your Friends List is a way to easily have access to the community members that you interact with the most! X

How to call a servlet from a jsp form

TG_10272716
10-Marble

How to call a servlet from a jsp form

 

Hello,

 

I know there is already a similar topic but it seems like this does not work in newer versions anymore. I am trying to call a Servlet from a custom jsp in Windchill 12.0.2.1.

The serlets url is <server>/Windchill/servlet/MyExportServlet. The servlet works fine when I paste this url in the browser.

 

I am generating the url in the jsp like you can see blow.

 

 

        <%
            String cb = WTProperties.getLocalProperties().getProperty("wt.server.codebase");

            String action = cb + "/servlet/MyExportServlet";
        %>

 

 

 

Then there is a form in the jsp that is supposed to call the servlet

 

 

<form action="<%=action%>">

....inputs

<button type="submit">Submit</button>

</form>

 

 

However when pressing submit the page seems to be reloading and the servlet is not called. There is no error or anything else.

 

Does anyone know how to do this?

 

Best regards

 

ACCEPTED SOLUTION

Accepted Solutions

Hi @TG_10272716 

I guess that it should works.

try to use but it is same 😄

<input type="submit" value=" Submit ">

PetrH

View solution in original post

2 REPLIES 2

Hi @TG_10272716 

I guess that it should works.

try to use but it is same 😄

<input type="submit" value=" Submit ">

PetrH

Hello @HelesicPetr,

thank you for your reply.

It is actually working now, with  <input type="submit" /> but also with <button type="submit" />

Looks like there was something else wrong.

Thank you

Announcements
Top Tags