private SubmitButton getDefaultButton() { if (getSubmitButtons().length == 1) { return getSubmitButtons()[0]; } else { return getSubmitButton( "" ); } }
private SubmitButton getDefaultButton() { if (getSubmitButtons().length == 1) { return getSubmitButtons()[0]; } else { return getSubmitButton( "" ); } }
private SubmitButton getDefaultButton() { if (getSubmitButtons().length == 1) { return getSubmitButtons()[0]; } else { return getSubmitButton( "" ); } }
/** * Returns the submit button defined in this form with the specified ID. * If more than one such button exists, will return the first found. * If no such button is found, will return null. **/ public SubmitButton getSubmitButtonWithID( String ID ) { SubmitButton[] buttons = getSubmitButtons(); for (int i = 0; i < buttons.length; i++) { if (buttons[i].getID().equals( ID )) { return buttons[i]; } } return null; }
/** * Returns the submit button defined in this form with the specified name. * If more than one such button exists, will return the first found. * If no such button is found, will return null. **/ public SubmitButton getSubmitButton( String name ) { SubmitButton[] buttons = getSubmitButtons(); for (int i = 0; i < buttons.length; i++) { if (buttons[i].getName().equals( name )) { return buttons[i]; } } return null; }
/** * Returns the submit button defined in this form with the specified name. * If more than one such button exists, will return the first found. * If no such button is found, will return null. **/ public SubmitButton getSubmitButton( String name ) { SubmitButton[] buttons = getSubmitButtons(); for (int i = 0; i < buttons.length; i++) { if (buttons[i].getName().equals( name )) { return buttons[i]; } } return null; }
/** * Returns the submit button defined in this form with the specified name. * If more than one such button exists, will return the first found. * If no such button is found, will return null. **/ public SubmitButton getSubmitButton( String name ) { SubmitButton[] buttons = getSubmitButtons(); for (int i = 0; i < buttons.length; i++) { if (buttons[i].getName().equals( name )) { return buttons[i]; } } return null; }
/** * Returns the submit button defined in this form with the specified ID. * If more than one such button exists, will return the first found. * If no such button is found, will return null. **/ public SubmitButton getSubmitButtonWithID( String ID ) { SubmitButton[] buttons = getSubmitButtons(); for (int i = 0; i < buttons.length; i++) { if (buttons[i].getID().equals( ID )) { return buttons[i]; } } return null; }
/** * Returns the submit button defined in this form with the specified ID. * If more than one such button exists, will return the first found. * If no such button is found, will return null. **/ public SubmitButton getSubmitButtonWithID( String ID ) { SubmitButton[] buttons = getSubmitButtons(); for (int i = 0; i < buttons.length; i++) { if (buttons[i].getID().equals( ID )) { return buttons[i]; } } return null; }
/** * Returns the submit button defined in this form with the specified name and value. * If more than one such button exists, will return the first found. * If no such button is found, will return null. **/ public SubmitButton getSubmitButton( String name, String value ) { SubmitButton[] buttons = getSubmitButtons(); for (int i = 0; i < buttons.length; i++) { if (buttons[i].getName().equals( name ) && buttons[i].getValue().equals( value )) { return buttons[i]; } } return null; }
/** * Returns the submit button defined in this form with the specified name and value. * If more than one such button exists, will return the first found. * If no such button is found, will return null. **/ public SubmitButton getSubmitButton( String name, String value ) { SubmitButton[] buttons = getSubmitButtons(); for (int i = 0; i < buttons.length; i++) { if (buttons[i].getName().equals( name ) && buttons[i].getValue().equals( value )) { return buttons[i]; } } return null; }
/** * Returns the submit button defined in this form with the specified name and value. * If more than one such button exists, will return the first found. * If no such button is found, will return null. **/ public SubmitButton getSubmitButton( String name, String value ) { SubmitButton[] buttons = getSubmitButtons(); for (int i = 0; i < buttons.length; i++) { if (buttons[i].getName().equals( name ) && buttons[i].getValue().equals( value )) { return buttons[i]; } } return null; }
private WebRequest getScriptedSubmitRequest() { SubmitButton[] buttons = getSubmitButtons(); for (int i = 0; i < buttons.length; i++) { buttons[i].setPressed( false ); } if (getMethod().equalsIgnoreCase( "post" )) { return new PostMethodWebRequest( this ); } else { return new GetMethodWebRequest( this ); } }
private WebRequest getScriptedSubmitRequest() { SubmitButton[] buttons = getSubmitButtons(); for (int i = 0; i < buttons.length; i++) { buttons[i].setPressed( false ); } if (getMethod().equalsIgnoreCase( "post" )) { return new PostMethodWebRequest( this ); } else { return new GetMethodWebRequest( this ); } }
private WebRequest getScriptedSubmitRequest() { SubmitButton[] buttons = getSubmitButtons(); for (int i = 0; i < buttons.length; i++) { buttons[i].setPressed( false ); } if (getMethod().equalsIgnoreCase( "post" )) { return new PostMethodWebRequest( this ); } else { return new GetMethodWebRequest( this ); } }
protected Void scrape() throws IOException, SAXException, ProcessingException { WebResponse response = goTo(project._getURL()+"/servlets/ProjectMailingListList"); for (WebForm form : response.getForms()) { if(!form.getAction().equals("ProjectMailingListList")) continue; if(!form.getParameterValue("listName").equals(name)) continue; // found the form SubmitButton sb = form.getSubmitButtons()[0]; if(!sb.getValue().equals("Subscribe")) throw new ProcessingException("Found "+sb.getValue()+" but expected Subscribe"); // set the mode form.setParameter("subtype",mode.getNameAsWord()); checkError(form.submit(sb)); return null; } throw new ProcessingException("no subscription form found"); } }.run();
/** * Creates and returns a web request which includes the specified button and position. If no button is specified, * will include the default button, if any. No parameter validation will be done on the returned request * and no scripts will be run when it is submitted. **/ public WebRequest newUnvalidatedRequest( SubmitButton button, int x, int y ) { if (button == null) button = getDefaultButton(); SubmitButton[] buttons = getSubmitButtons(); for (int i = 0; i < buttons.length; i++) { buttons[i].setPressed( false ); } button.setPressed( true ); if (getMethod().equalsIgnoreCase( "post" )) { return new PostMethodWebRequest( this, new UncheckedParameterHolder( this ), button, x, y ); } else { return new GetMethodWebRequest( this, new UncheckedParameterHolder( this ), button, x, y ); } }
/** * Creates and returns a web request which includes the specified button and position. If no button is specified, * will include the default button, if any. No parameter validation will be done on the returned request * and no scripts will be run when it is submitted. **/ public WebRequest newUnvalidatedRequest( SubmitButton button, int x, int y ) { if (button == null) button = getDefaultButton(); SubmitButton[] buttons = getSubmitButtons(); for (int i = 0; i < buttons.length; i++) { buttons[i].setPressed( false ); } button.setPressed( true ); if (getMethod().equalsIgnoreCase( "post" )) { return new PostMethodWebRequest( this, new UncheckedParameterHolder( this ), button, x, y ); } else { return new GetMethodWebRequest( this, new UncheckedParameterHolder( this ), button, x, y ); } }
/** * Creates and returns a web request which includes the specified button and position. If no button is specified, * will include the default button, if any. No parameter validation will be done on the returned request * and no scripts will be run when it is submitted. **/ public WebRequest newUnvalidatedRequest( SubmitButton button, int x, int y ) { if (button == null) button = getDefaultButton(); SubmitButton[] buttons = getSubmitButtons(); for (int i = 0; i < buttons.length; i++) { buttons[i].setPressed( false ); } button.setPressed( true ); if (getMethod().equalsIgnoreCase( "post" )) { return new PostMethodWebRequest( this, new UncheckedParameterHolder( this ), button, x, y ); } else { return new GetMethodWebRequest( this, new UncheckedParameterHolder( this ), button, x, y ); } }
SubmitButton[] buttons = getSubmitButtons(); for (int i = 0; i < buttons.length; i++) { buttons[i].setPressed( false );