当前位置: 首页>>代码示例>>Java>>正文


Java Input类代码示例

本文整理汇总了Java中org.apache.ecs.html.Input的典型用法代码示例。如果您正苦于以下问题:Java Input类的具体用法?Java Input怎么用?Java Input使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


Input类属于org.apache.ecs.html包,在下文中一共展示了Input类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: makeOperationsLine

import org.apache.ecs.html.Input; //导入依赖的package包/类
protected Element makeOperationsLine(WebSession s)
{
	ElementContainer ec = new ElementContainer();

	Table t1 = new Table().setCellSpacing(0).setCellPadding(2);

	if (s.isColor())
	{
		t1.setBorder(1);
	}

	TR tr = new TR();
	tr.addElement(new TD().addElement("How many operations are defined in the WSDL: "));
	tr.addElement(new TD(new Input(Input.TEXT, "count", "")));
	Element b = ECSFactory.makeButton("Submit");
	tr.addElement(new TD(b).setAlign("LEFT"));
	t1.addElement(tr);

	ec.addElement(t1);

	return ec;
}
 
开发者ID:RIGS-IT,项目名称:sonar-xanitizer,代码行数:23,代码来源:SoapRequest.java

示例2: makeTypeLine

import org.apache.ecs.html.Input; //导入依赖的package包/类
protected Element makeTypeLine(WebSession s)
{
	ElementContainer ec = new ElementContainer();

	Table t1 = new Table().setCellSpacing(0).setCellPadding(2);

	if (s.isColor())
	{
		t1.setBorder(1);
	}

	TR tr = new TR();
	tr.addElement(new TD()
			.addElement("Now, what is the type of the (id) parameter in the \"getFirstNameRequest\" method: "));
	tr.addElement(new TD(new Input(Input.TEXT, "type", "")));
	Element b = ECSFactory.makeButton("Submit");
	tr.addElement(new TD(b).setAlign("LEFT"));
	t1.addElement(tr);

	ec.addElement(t1);

	return ec;
}
 
开发者ID:RIGS-IT,项目名称:sonar-xanitizer,代码行数:24,代码来源:SoapRequest.java

示例3: doTransfer

import org.apache.ecs.html.Input; //导入依赖的package包/类
/**
 * if TRANSFER_FUND_PARAMETER is a parameter, then doTransfer is invoked.  doTranser presents the 
 * web content to display the electronic transfer of funds.  An request
 * should have a dollar amount specified.  When this page is accessed it will mark the lesson complete  
 * 
 * @param s
 * @return Element will appropriate web content for a transfer of funds.
 */
protected Element doTransfer(WebSession s) {
	String transferFunds = HtmlEncoder.encode(s.getParser().getRawParameter(TRANSFER_FUNDS_PARAMETER, ""));
	ElementContainer ec = new ElementContainer();
	
	if (transferFunds.equalsIgnoreCase(TRANSFER_FUNDS_PAGE)){
		
		//transfer form
		ec.addElement(new H1("Electronic Transfer:"));
		String action = getLink();
		Form form = new Form(action, Form.POST);
		form.addElement( new Input(Input.text, TRANSFER_FUNDS_PARAMETER, "0"));
		//if this token is present we won't mark the lesson as completed
		form.addElement( new Input(Input.submit));
		ec.addElement(form);
		//present transfer funds form
	} else if (transferFunds.length() != 0){
		
		//transfer is confirmed
		ec.addElement(new H1("Electronic Transfer Complete"));
		ec.addElement(new StringElement("Amount Transfered: "+transferFunds));
		makeSuccess(s);
	} 
	return ec;
}
 
开发者ID:RIGS-IT,项目名称:sonar-xanitizer,代码行数:33,代码来源:CSRF.java

示例4: createSimpleProperty

import org.apache.ecs.html.Input; //导入依赖的package包/类
public Element createSimpleProperty(SimplePropertyElement<?> e) {
	// <input type="text" wicket:id="vertrag.Vertragsnummer" />
	final String inputType;
	if (e.isNumberType()) {
		inputType = "text";
	} else if (e.isFileType()) {
		if (e.isReadonlyFileType())
			inputType = Input.button; // Download link
		else
			inputType = Input.file;
	} else {
		inputType = Input.text;
	}
	Input input = new Input();
	input.addAttribute(ATTR_WICKET_ID, e.getWicketId());
	input.setID(e.getWicketId());
	input.setType(inputType);
	return wrapInputComponent(e, input);
}
 
开发者ID:Nocket,项目名称:nocket,代码行数:20,代码来源:AbstractStylingStrategyImpl.java

示例5: wrapComponent

import org.apache.ecs.html.Input; //导入依赖的package包/类
@Override
protected Element wrapComponent(DomainElementI<?> e, Element element) {
       //<div class="control-group">
       Div controlGroup = new Div();
       controlGroup.addAttribute(ATTR_CLASS, "control-group");
       if (isInputButton(element))
           ((Input) element).setValue(e.getPrompt());
       else {
           //  <label for="vertrag.Vertragsnummer" class="control-label">Salutation</label>
           Label label = createLabel(e, element);
           label.addAttribute(ATTR_CLASS, "control-label");
           controlGroup.addElement(label);
       }
       //  <div class="controls controls-row">
       Div controlsRow = new Div();
       controlsRow.addAttribute(ATTR_CLASS, "controls");
       //    <select class="span4" wicket:id="vertrag.Vertragsnummer" id="vertrag.Vertragsnummer" size="1"><option>[option]</option></select>
       controlsRow.addElement(element);
       //  </div>
       controlGroup.addElement(controlsRow);
       //</div> 
       return controlGroup;
   }
 
开发者ID:Nocket,项目名称:nocket,代码行数:24,代码来源:DefaultStylingStrategy.java

示例6: createAskForTanContent

import org.apache.ecs.html.Input; //导入依赖的package包/类
/**
 * Create content in which the tan is asked
 * 
 * @param s
 * @param ec
 * @param tanNr
 */
private void createAskForTanContent(WebSession s, ElementContainer ec, int tanNr, String user)
{

	Div loginDiv = new Div();
	loginDiv.setID("lesson_login");

	Table table = new Table();
	table.addAttribute("align='center'", 0);
	TR tr1 = new TR();
	TD td1 = new TD();
	TD td2 = new TD();
	td1.addElement(new StringElement("Enter TAN  #" + tanNr + ": "));
	td2.addElement(new Input(Input.TEXT, TAN));
	tr1.addElement(td1);
	tr1.addElement(td2);

	TR tr2 = new TR();
	TD td3 = new TD();
	td3.setColSpan(2);
	td3.setAlign("center");

	td3.addElement(new Input(Input.SUBMIT, "Submit", "Submit"));
	tr2.addElement(td3);

	table.addElement(tr1);
	table.addElement(tr2);

	ec.addElement(new Input(Input.HIDDEN, HIDDEN_USER, user));
	loginDiv.addElement(table);
	ec.addElement(loginDiv);
	ec.addElement(createLogoutLink());

}
 
开发者ID:RIGS-IT,项目名称:sonar-xanitizer,代码行数:41,代码来源:MultiLevelLogin2.java

示例7: makeUsername

import org.apache.ecs.html.Input; //导入依赖的package包/类
protected Element makeUsername(WebSession s)
{
	ElementContainer ec = new ElementContainer();
	StringBuffer script = new StringBuffer();
	script.append("<STYLE TYPE=\"text/css\"> ");
	script.append(".blocklabel { margin-top: 8pt; }");
	script.append(".myClass 	{ color:red;");
	script.append(" font-weight: bold;");
	script.append("padding-left: 1px;");
	script.append("padding-right: 1px;");
	script.append("background: #DDDDDD;");
	script.append("border: thin black solid; }");
	script.append("LI	{ margin-top: 10pt; }");
	script.append("</STYLE>");
	ec.addElement(new StringElement(script.toString()));

	ec.addElement(new StringElement("User ID: "));
	Input username = new Input(Input.TEXT, "username", "");
	ec.addElement(username);

	String userInput = s.getParser().getRawParameter("username", "");

	ec.addElement(new BR());
	ec.addElement(new BR());

	String formattedInput = "<span class='myClass'>" + userInput + "</span>";
	ec.addElement(new Div(SELECT_ST + formattedInput));

	Input b = new Input();

	b.setName("Submit");
	b.setType(Input.SUBMIT);
	b.setValue("Submit");

	ec.addElement(new PRE(b));

	return ec;
}
 
开发者ID:RIGS-IT,项目名称:sonar-xanitizer,代码行数:39,代码来源:BackDoors.java

示例8: makeInput

import org.apache.ecs.html.Input; //导入依赖的package包/类
/**
 * Description of the Method
 * 
 * @param s
 *            Description of the Parameter
 * @return Description of the Return Value
 */
protected Element makeInput(WebSession s)
{
	Table t = new Table(0).setCellSpacing(0).setCellPadding(0).setBorder(0);
	TR row1 = new TR();
	TR row2 = new TR();
	row1.addElement(new TD(new StringElement(WebGoatI18N.get("Title")+": ")));

	Input inputTitle = new Input(Input.TEXT, TITLE, "");
	row1.addElement(new TD(inputTitle));

	TD item1 = new TD();
	item1.setVAlign("TOP");
	item1.addElement(new StringElement(WebGoatI18N.get("Message")+": "));
	row2.addElement(item1);

	TD item2 = new TD();
	TextArea ta = new TextArea(MESSAGE, 5, 60);
	item2.addElement(ta);
	row2.addElement(item2);
	t.addElement(row1);
	t.addElement(row2);

	Element b = ECSFactory.makeButton(WebGoatI18N.get("Submit"));
	ElementContainer ec = new ElementContainer();
	ec.addElement(t);
	ec.addElement(new P().addElement(b));

	return (ec);
}
 
开发者ID:RIGS-IT,项目名称:sonar-xanitizer,代码行数:37,代码来源:StoredXss.java

示例9: doStage1

import org.apache.ecs.html.Input; //导入依赖的package包/类
/**
 * 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);
}
 
开发者ID:RIGS-IT,项目名称:sonar-xanitizer,代码行数:42,代码来源:Challenge2Screen.java

示例10: makeAccountLine

import org.apache.ecs.html.Input; //导入依赖的package包/类
protected Element makeAccountLine(WebSession s)
{
	ElementContainer ec = new ElementContainer();
	ec.addElement(new P().addElement(WebGoatI18N.get("EnterUserid")));

	userid = s.getParser().getRawParameter(USERID, "jsmith");
	Input input = new Input(Input.TEXT, USERID, userid.toString());
	ec.addElement(input);

	Element b = ECSFactory.makeButton(WebGoatI18N.get("Go!"));
	ec.addElement(b);

	return ec;

}
 
开发者ID:RIGS-IT,项目名称:sonar-xanitizer,代码行数:16,代码来源:SqlModifyData.java

示例11: makeAccountLine

import org.apache.ecs.html.Input; //导入依赖的package包/类
protected Element makeAccountLine(WebSession s)
{
	ElementContainer ec = new ElementContainer();
	ec.addElement(new P().addElement(WebGoatI18N.get("EnterLastName")));

	accountName = s.getParser().getRawParameter(ACCT_NAME, "Your Name");
	Input input = new Input(Input.TEXT, ACCT_NAME, accountName.toString());
	ec.addElement(input);

	Element b = ECSFactory.makeButton(WebGoatI18N.get("Go!"));
	ec.addElement(b);

	return ec;

}
 
开发者ID:RIGS-IT,项目名称:sonar-xanitizer,代码行数:16,代码来源:SqlStringInjection.java

示例12: createContent

import org.apache.ecs.html.Input; //导入依赖的package包/类
/**
 * Description of the Method
 * 
 * @param s
 *            Description of the Parameter
 * @return Description of the Return Value
 */
protected Element createContent(WebSession s)
{
	ElementContainer ec = new ElementContainer();

	StringBuffer person = null;
	try
	{
		ec.addElement(new StringElement(WebGoatI18N.get("EnterYourName")+": "));

		person = new StringBuffer(s.getParser().getStringParameter(PERSON, ""));
		person.reverse();

		Input input = new Input(Input.TEXT, PERSON, person.toString());
		ec.addElement(input);

		Element b = ECSFactory.makeButton(WebGoatI18N.get("Go!"));
		ec.addElement(b);
	} catch (Exception e)
	{
		s.setMessage("Error generating " + this.getClass().getName());
		e.printStackTrace();
	}

	if (!person.toString().equals("") && getLessonTracker(s).getNumVisits() > 3)
	{
		makeSuccess(s);
	}

	return (ec);
}
 
开发者ID:RIGS-IT,项目名称:sonar-xanitizer,代码行数:38,代码来源:HttpBasics.java

示例13: createAskForTanContent

import org.apache.ecs.html.Input; //导入依赖的package包/类
/**
 * Create content in which the tan is asked
 * 
 * @param s
 * @param ec
 * @param tanNr
 */
private void createAskForTanContent(WebSession s, ElementContainer ec, int tanNr)
{

	Div loginDiv = new Div();
	loginDiv.setID("lesson_login");

	Table table = new Table();
	table.addAttribute("align='center'", 0);
	TR tr1 = new TR();
	TD td1 = new TD();
	TD td2 = new TD();
	td1.addElement(new StringElement("Enter TAN  #" + tanNr + ": "));
	td2.addElement(new Input(Input.TEXT, TAN));
	tr1.addElement(td1);
	tr1.addElement(td2);

	TR tr2 = new TR();
	TD td3 = new TD();
	td3.setColSpan(2);
	td3.setAlign("center");

	td3.addElement(new Input(Input.SUBMIT, "Submit", "Submit"));
	tr2.addElement(td3);

	table.addElement(tr1);
	table.addElement(tr2);

	ec.addElement(new Input(Input.HIDDEN, HIDDEN_TAN, tanNr));
	loginDiv.addElement(table);
	ec.addElement(loginDiv);
	ec.addElement(createLogoutLink());

}
 
开发者ID:RIGS-IT,项目名称:sonar-xanitizer,代码行数:41,代码来源:MultiLevelLogin1.java

示例14: makeInput

import org.apache.ecs.html.Input; //导入依赖的package包/类
/**
 * Description of the Method
 * 
 * @param s
 *            Description of the Parameter
 * @return Description of the Return Value
 */
protected Element makeInput(WebSession s)
{
	Table t = new Table(0).setCellSpacing(0).setCellPadding(0).setBorder(0);
	TR row1 = new TR();
	TR row2 = new TR();
	row1.addElement(new TD(new StringElement("Title: ")));

	Input inputTitle = new Input(Input.TEXT, TITLE, "");
	row1.addElement(new TD(inputTitle));

	TD item1 = new TD();
	item1.setVAlign("TOP");
	item1.addElement(new StringElement("Message: "));
	row2.addElement(item1);

	TD item2 = new TD();
	TextArea ta = new TextArea(MESSAGE, 12, 60);
	ta.addAttribute("wrap", "soft");
	item2.addElement(ta);
	row2.addElement(item2);
	t.addElement(row1);
	t.addElement(row2);

	Element b = ECSFactory.makeButton("Submit");
	ElementContainer ec = new ElementContainer();
	ec.addElement(t);
	ec.addElement(new P().addElement(b));

	return (ec);
}
 
开发者ID:RIGS-IT,项目名称:sonar-xanitizer,代码行数:38,代码来源:CSRF.java

示例15: makeInputLine

import org.apache.ecs.html.Input; //导入依赖的package包/类
protected Element makeInputLine(WebSession s)
{
	ElementContainer ec = new ElementContainer();

	ec.addElement(new P().addElement("Please change your password: "));

	Input input = new Input(Input.TEXT, PASSWORD);
	ec.addElement(input);

	Element b = ECSFactory.makeButton("Go!");
	ec.addElement(b);

	return ec;
}
 
开发者ID:RIGS-IT,项目名称:sonar-xanitizer,代码行数:15,代码来源:WsSAXInjection.java


注:本文中的org.apache.ecs.html.Input类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。