I am currently trying to write a custom extension, which should provide me an extended state of the administration page.
Therefore, I retraced the steps portrayed in the administration example and got a static webpage as my result.
Now, I would like to display some saved data on this webpage.
To achieve this, I tried to pass some attributes to the request in the HttpServlet
Code: Select all
doGet()
Does anyone know a working way of passing data between the Servlet and the JSP file?
Below is a listing of my source code:
Code: Select all
public class SettingsServlet extends HttpServlet{
private static final long serialVersionUID = 1L;
@Override
protected void doGet(final HttpServletRequest request, final HttpServletResponse response) throws ServletException, IOException{
request.setAttribute("foo", "data");
getServletContext().getRequestDispatcher("/extended_settings.jsp").forward(request, response);
}
@Override
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
doGet(request, response);
}
}
Here is the JSP file's request code:
Code: Select all
<%="Request attributes" + Collections.list(request.getAttributeNames()).toString()%>
which returns an empty List
And my hivemodule.xml:
Code: Select all
<contribution configuration-id="com.polarion.xray.webui.administrationPageExtenders">
<extender
name="Extended settings"
parentNodeName="Notifications"
parentNodeIconUrl="/polarion/icons/default/topicIcons/notification.png"
iconUrl="/polarion/icons/default/topicIconsSmall/notification.png"
pageUrl="/polarion/notificationSettings/extended_settings.jsp"
projectScope="false"
projectGroupScope="false"
repositoryScope="true"/>
</contribution>
Although the website shows up fine, no data is passed.
Any help is much appreciated!