本文整理汇总了Java中org.apache.ecs.html.Input.HIDDEN属性的典型用法代码示例。如果您正苦于以下问题:Java Input.HIDDEN属性的具体用法?Java Input.HIDDEN怎么用?Java Input.HIDDEN使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.apache.ecs.html.Input
的用法示例。
在下文中一共展示了Input.HIDDEN属性的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: doStage1
/**
* Determine the username and password
*
* @param s
* Description of the Parameter
* @return Description of the Return Value
* @exception Exception
* Description of the Exception
*/
protected Element doStage1(WebSession s) throws Exception
{
setStage(s, 1);
String username = s.getParser().getRawParameter(USERNAME, "");
String password = s.getParser().getRawParameter(PASSWORD, "");
if (username.equals(user) && password.equals(pass))
{
s.setMessage("Welcome to stage 2 -- get credit card numbers!");
setStage(s, 2);
return (doStage2(s));
}
s.setMessage("Invalid login");
ElementContainer ec = new ElementContainer();
ec.addElement(makeLogin(s));
// <START_OMIT_SOURCE>
// these are red herrings for the first stage
Input input = new Input(Input.HIDDEN, USER, user);
ec.addElement(input);
Cookie newCookie = new Cookie(USER_COOKIE, Encoding.base64Encode(user));
s.getResponse().addCookie(newCookie);
phoneHome(s, "User: " + username + " --> " + "Pass: " + password);
// <END_OMIT_SOURCE>
return (ec);
}
示例2: createMainContent
protected Element createMainContent(WebSession s)
{
ElementContainer ec = new ElementContainer();
try
{
ec.addElement(new Script().setSrc("javascript/clientSideFiltering.js"));
Input input = new Input(Input.HIDDEN, "userID", 102);
input.setID("userID");
ec.addElement(input);
style sty = new style();
sty.addElement("#lesson_wrapper {height: 435px;width: 500px;}"
+ "#lesson_header {background-image: url(lessons/Ajax/images/lesson1_header.jpg);"
+ "width: 490px;padding-right: 10px;padding-top: 60px;background-repeat: no-repeat;}"
+ ".lesson_workspace {background-image: url(lessons/Ajax/images/lesson1_workspace.jpg);"
+ "width: 489px;height: 325px;padding-left: 10px;padding-top: 10px;background-repeat: no-repeat;}");
ec.addElement(sty);
Div wrapperDiv = new Div();
wrapperDiv.setID("lesson_wrapper");
Div headerDiv = new Div();
headerDiv.setID("lesson_header");
Div workspaceDiv = new Div();
workspaceDiv.setClass("lesson_workspace");
wrapperDiv.addElement(headerDiv);
wrapperDiv.addElement(workspaceDiv);
ec.addElement(wrapperDiv);
workspaceDiv.addElement(new BR());
workspaceDiv.addElement(new BR());
workspaceDiv.addElement(new P().addElement(" Select user:"));
workspaceDiv.addElement(createDropDown());
workspaceDiv.addElement(new P());
Table t = new Table().setCellSpacing(0).setCellPadding(2).setBorder(1).setWidth("90%").setAlign("center");
t.setID("hiddenEmployeeRecords");
t.setStyle("display: none");
workspaceDiv.addElement(t);
t = new Table().setCellSpacing(0).setCellPadding(2).setBorder(1).setWidth("90%").setAlign("center");
TR tr = new TR();
tr.addElement(new TD().addElement("UserID"));
tr.addElement(new TD().addElement("First Name"));
tr.addElement(new TD().addElement("Last Name"));
tr.addElement(new TD().addElement("SSN"));
tr.addElement(new TD().addElement("Salary"));
t.addElement(tr);
tr = new TR();
tr.setID("employeeRecord");
t.addElement(tr);
workspaceDiv.addElement(t);
} catch (Exception e)
{
s.setMessage("Error generating " + this.getClass().getName());
e.printStackTrace();
}
return (ec);
}