hexin orsen

Greenhorn
+ Follow
since Aug 14, 2009
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by hexin orsen

hi;
jsp page has out instance,but in servlet we can get one out instance by response.getWriter() ;

In servlet ,out is org.apache.catalina.connector.CoyoteWriter instance;
In jsp page ,out is org.apache.jasper.runtime.JspWriterImpl instance;
14 years ago
first thanks Bear criticism,i did not communicate their ideas clearly and had several mistakes.

hexin orsen wrote:
you most make sure that input_text is not null,and its instance exist pageScope requestScope

Not correct. When using old-fashioned scriptlet expressions, the variable must be a scripting variable, not a scoped variable.



i say that input_text is servlet to jspcode.but it can be initialized in jsp



if you do this ,input_text will aotu-save in current pageSope;

after save input_text in requestScope ,you can use it in jsp page like

Again, not correct. Scoped variables are accessed via the modern EL, not out-moded scriptlets.



el get parameter's values in pageScope or requestScope ..... even now , you can initialize :input_text = null;
that is correct.

14 years ago
JSP
if you use like this


you most make sure that input_text is not null,and its instance exist pageScope requestScope...otherwise that show null.

eg:



after save input_text in requestScope ,you can use it in jsp page like
one way:

anthoer way using el:
14 years ago
JSP
i think that is not preciseness:
public String getErrorMsg(String msg)
{
errorMsg =(String)errors.get(msg.trim());
return (errorMsg == null) ? "":errorMsg;
}
if parameter of getErrorMsg is null,there is NullPointerException that you using msg.trim() .if you are not sure msg is not null,so your code shoud change .
14 years ago
JSP