how can i add hidden data on my formPanel in gwt

江枫思渺然 提交于 2019-12-11 16:59:44

问题


I want to pass a string parameter on my form Panel. Is it possible to add string parameter data on GWT form panel?

I have servlet code that will receive passed string parameter using post, I cannot include the parameters in the link because it has large amounts of data

this is my servlet code:

public void doPost(HttpServletRequest request, HttpServletResponse response) {
            String printMode = request.getParameter("printMode");
            String nodeNm = ConfigConstants.PRINTER.getValue();
            String outputLogPath=SrchSvcImpl.cnfg.readValCnfg(nodeNm, ConfigConstants.OUTPUT_ERROR_LOG.getValue());

            if(printMode.equalsIgnoreCase("single_print")) {
                String role = request.getParameter("role");
                String itemsToPrint = request.getParameter("itemsToPrint");
                //do something else..
            }
}

回答1:


Use Hidden widget. It creates <input type='hidden'> element.



来源:https://stackoverflow.com/questions/44181149/how-can-i-add-hidden-data-on-my-formpanel-in-gwt

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!