String value = getServletConfig( ).getParameter(“foo”);
String value = getServletContext( ).getAttribute(“foo”);
Object value = getServletContext( ).getInitParameter(“foo”);
String value = getServletContext( ).getInitParameter(“foo”)
第1题:
public class test( public static void main(string[]args){ string foo = args [1]; string foo = args [2]; string foo = args [3]; } ) And command line invocation: Java Test red green blue What is the result?()
第2题:
Given: String value = getServletContext().getInitParameter("foo"); in an HttpServlet and a web applicationdeployment descriptor that contains:
第3题:
A.Theattributefooisplacedintheapplication
B.AServletContextListenerregisteredforthatservletisnotified
C.AServletAttributeListenerregisteredforthatservletisnotified
D.AnHttpSessionAttributeListenerregisteredforthatservletisnotified
第4题:
Given the JSP code: <% request.setAttribute("foo", "bar"); %>and the Classic tag handler code: 5. public int doStartTag() throws JspException { 6. // insert code here 7. // return int 8. } Assume there are no other "foo" attributes in the web application. Which invocation on the pageContextobject,inserted at line 6,assigns "bar" to the variable x?()
第5题:
int index = 1; boolean test = new Boolean; boolean foo= test [index]; What is the result?()
第6题:
int index = 1; String test = new String; String foo = test[index]; What is the result?()
第7题:
5. String foo = “base”; 6. foo.substring(0,3); 7. foo.concat(“ket”) 8. Type the value of foo at line 8.()
第8题:
Given:Stringvalue=getServletContext().getInitParameter("foo");inanHttpServletandawebapplicationdeploymentdescriptorthatcontains:<context-param><param-name>foo</param-name><param-value>frodo</param-value></context-param>Whichtwoaretrue?()
A.ThefooinitializationparameterCANNOTbesetprogrammatically.
B.CompilationfailsbecausegetInitParameterreturnstypeObject.
C.ThefooinitializationparameterisNOTaservletinitializationparameter.
D.CompilationfailsbecauseServletContextdoesNOThaveagetInitParametermethod.
E.Thefooparametermustbedefinedwithinthe
第9题:
String foo = “blue”; Boolean[]bar = new Boolean [1]; if (bar[0]) { foo = “green”; } What is the result? ()
第10题:
3. string foo = “ABCDE”; 4. foo.substring(3); 5. foo.concat(“XYZ”); 6. Type the value of foo at line 6.()