Package org.displaytag.util

Examples of org.displaytag.util.ParamEncoder


    @Override
    @Test
    public void doTest() throws Exception
    {
        WebRequest request = new GetMethodWebRequest(getJspUrl(getJspName()));
        ParamEncoder encoder = new ParamEncoder("table");
        request.setParameter(encoder.encodeParameterName(TableTagParameters.PARAMETER_PAGE), "9");

        WebResponse response = runner.getResponse(request);

        if (log.isDebugEnabled())
        {
View Full Code Here


    @Override
    @Test
    public void doTest() throws Exception
    {

        ParamEncoder encoder = new ParamEncoder("table");
        String mediaParameter = encoder.encodeParameterName(TableTagParameters.PARAMETER_EXPORTTYPE);

        WebRequest request = new GetMethodWebRequest(getJspUrl(getJspName()));
        request.setParameter(mediaParameter, Integer.toString(MediaTypeEnum.CSV.getCode()));

        WebResponse response = runner.getResponse(request);

        Assert.assertEquals("Expected a different content type.", "text/csv", response.getContentType());

        // second column should be empty
        Assert.assertEquals("Wrong content.", "ant,,camel\nant,,camel\n", response.getText());

        // now export a nested table
        encoder = new ParamEncoder("nested");
        mediaParameter = encoder.encodeParameterName(TableTagParameters.PARAMETER_EXPORTTYPE);
        request = new GetMethodWebRequest(getJspUrl(getJspName()));
        request.setParameter(mediaParameter, Integer.toString(MediaTypeEnum.CSV.getCode()));
        // this test needs the export filter
        request.setParameter(TableTagParameters.PARAMETER_EXPORTING, "1");
        response = runner.getResponse(request);
View Full Code Here

    public void doTest() throws Exception
    {
        WebRequest request = new GetMethodWebRequest(getJspUrl(getJspName()));
        WebResponse response = runner.getResponse(request);

        ParamEncoder encoder = new ParamEncoder("table");
        request.setParameter(encoder.encodeParameterName(TableTagParameters.PARAMETER_PAGE), "2");

        if (log.isDebugEnabled())
        {
            log.debug(response.getText());
        }
View Full Code Here

     */
    @Override
    @Test
    public void doTest() throws Exception
    {
        ParamEncoder encoder = new ParamEncoder("table");
        String mediaParameter = encoder.encodeParameterName(TableTagParameters.PARAMETER_EXPORTTYPE);

        WebRequest request = new GetMethodWebRequest(getJspUrl(getJspName()));
        request.setParameter(mediaParameter, Integer.toString(MediaTypeEnum.XML.getCode()));

        // save previous level, since we are expeting an excetion I don't want to fill logs
View Full Code Here

    {
        // paramEncoder has been already instantiated?
        if (this.paramEncoder == null)
        {
            // use the id attribute to get the unique identifier
            this.paramEncoder = new ParamEncoder(this.tableModel.getId());
        }

        return this.paramEncoder.encodeParameterName(parameterName);
    }
View Full Code Here

            if (splittedExcludedParams.length == 1 && "*".equals(splittedExcludedParams[0]))
            {
                // @todo cleanup: paramEncoder initialization should not be done here
                if (this.paramEncoder == null)
                {
                    this.paramEncoder = new ParamEncoder(getUid());
                }

                Iterator paramsIterator = baseHref.getParameterMap().keySet().iterator();
                while (paramsIterator.hasNext())
                {
View Full Code Here

    {
        // paramEncoder has been already instantiated?
        if (this.paramEncoder == null)
        {
            // use the id attribute to get the unique identifier
            this.paramEncoder = new ParamEncoder(getUid());
        }

        return this.paramEncoder.encodeParameterName(parameterName);
    }
View Full Code Here

    {
        // paramEncoder has been already instantiated?
        if (this.paramEncoder == null)
        {
            // use the id attribute to get the unique identifier
            this.paramEncoder = new ParamEncoder(this.id);
        }

        return this.paramEncoder.encodeParameterName(parameterName);
    }
View Full Code Here

  public static int getCurrentPage4Id(String idParam) {
    if (logger.isDebugEnabled()) {
      logger.debug("getCurrentPage4Id(String idParam=" + idParam + ") - start");
    }
   
    ParamEncoder encoder = new ParamEncoder(idParam);
    String encodedParam = encoder.encodeParameterName("p");
    if (logger.isDebugEnabled()) {
      logger.debug("getCurrentPage4Id(String) - encodedParam=" + encodedParam);
    }
   
    HttpServletRequest request = ServletActionContext.getRequest();
View Full Code Here

    {
        // paramEncoder has been already instantiated?
        if (this.paramEncoder == null)
        {
            // use the id attribute to get the unique identifier
            this.paramEncoder = new ParamEncoder(this.tableModel.getId());
        }

        return this.paramEncoder.encodeParameterName(parameterName);
    }
View Full Code Here

TOP

Related Classes of org.displaytag.util.ParamEncoder

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.