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

Community Tip - Learn all about the Community Ranking System, a fun gamification element of the PTC Community. X

How to call a servlet from a jsp form

FS_10272716
9-Granite

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

 

1 ACCEPTED SOLUTION

Accepted Solutions

Hi @FS_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 @FS_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

Top Tags