KeinHappyAuer February 2016

parameters are not passed in jsp

I'm developing a breadcrumb on my website, I use following code in my jsp:

<form action="envelope">
                <input type="hidden" id="id" name="id" value="">
                <input type="hidden" name="q" value="${fn:escapeXml(param.q)}">
                <button type="submit" id="back" class="btn btn-sm btn-primary">
                    <span class="fa fa-chevron-left"></span> Back
                </button>
                <ol class="breadcrumb">
                  <li id="file"><a href="envelope.jsp?id=${envLev0}">File</a></li>
                  <li id="format"><a href="envelope.jsp?id=${envLev1}">Format</a></li>
                  <li id="batch"><a href="envelope.jsp?id=${envLev2}">Batch</a></li>
                  <li id="payment" class="active">Payment</li>
                </ol>
            </form>

I use following code to resolve my parameters in my DetailsControllerServlet:

 @Override
    public void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        String index = request.getParameter(FIELD_INDEX);
        String type = request.getParameter(FIELD_TYPE);
        String id = request.getParameter(FIELD_ID);

        Map<String, Object> map = searchDetails(index, id);
        for (Map.Entry<String, Object> entry : map.entrySet()) {
            String key = entry.getKey();
            Object value = entry.getValue();
            if(FIELD_BUSINESS_DATA.equals(key)) {
                value = XML_UTILS.toHtml((String)value);
            }
            request.setAttribute(key, value);
            if(LOGGER.isDebugEnabled()) {
                LOGGER.debug("Added '" + key + "'='" + value + "' to the request.");
            }
        }
        request.setAttribute(FIELD_INDEX, index);
        request.se        

Answers


Cooki3Tube February 2016

I think the problem lies in your detailsPage. Are you using request.getParameter() or request.getAttribute(). You should be using the later.

Post Status

Asked in February 2016
Viewed 1,965 times
Voted 8
Answered 1 times

Search




Leave an answer