Forums

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

How to connect servlet to jsp file in jira

Bruno Fidrmuc June 4, 2018

Hi,

I have a working jira plugin, with a servlet. But at this point my servlet only prints out "Hello world" as shown on a picture below. It is linked to a simple .vm file.Now I would like to link my servlet to a .jsp file, but I can't find a proper tutorial for that or a good answer that fix my problem. When I try to connect servlet with jsp I get 500 error.

image.png

 

1 answer

0 votes
Alexey Matveev
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 4, 2018

Hello,

How did you develop the servlet? Why do you want to connect it to JSP file?

Bruno Fidrmuc June 4, 2018

HI,

I have developed servlet following this tutorial https://developer.atlassian.com/server/jira/platform/creating-a-jira-issue-crud-servlet-and-issue-search/ , I want to connect (link) it to jsp file because I have web application that I have to integrate as jira plugin

Alexey Matveev
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 4, 2018

You should choose first the place in Jira UI, where you would like to connect your servlet. Then you can create a web item, which would call your servlet. Here is a tutorial:

https://developer.atlassian.com/server/jira/platform/adding-menu-items-to-jira/

Bruno Fidrmuc June 4, 2018

I have no problem with location, first one I created was in new tab, and I had a button (web-item) which called servlet. Only problem that I have is JSP I don't know how to call JSP from servlet I used 

RequestDispatcher rd = getServletContext().getRequestDispatcher("locatio");
rd.forward(request, response);

RequestDispatcher rd = request.getRequestDispatcher("/start.jsp");
rd.forward(request, response);

 request.getRequestDispatcher(request.getServletContext().getContextPath() + "/start.jsp").forward(request, response);

 

but none of the above worked for me. Is there a specific folder where JSP files have to be?

Alexey Matveev
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 4, 2018

Why would you need a jsp? You can return a vm or soy templates for user interface.

Bruno Fidrmuc June 4, 2018

Because web app that I have uses jsp files so if I don't have to change them I wouldn't, but if there is no other option I will have to change them.

Alexey Matveev
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 4, 2018

I put jsp pages in the webapp folder. Have a look inside the folder and you will see other jsp page there. Then you can call the jsp by base_url/yourjsp.jsp

Like Jaroslav Pavlicek likes this

Suggest an answer

Log in or Sign up to answer