Skip to main content
AI Assist is now on Stack Overflow. Start a chat to get instant answers from across the network. Sign up to save and share your chats.
replaced http://stackoverflow.com/ with https://stackoverflow.com/
Source Link
URL Rewriter Bot
URL Rewriter Bot

Get rid of the <jsp:useBean>. When using the type attribute instead of class, it won't check if there's already an instance in the scope, it will plain override the Person instance which you created in the servlet with a new, blank, default constructed instance.

When using "MVC architecture", the <jsp:useBean> tag is useless. Remove it and just use usual ELEL to access it:

${person.firstName} ${person.lastName} 

Or better, to prevent XSS attacks, use JSTLJSTL <c:out>.

<c:out value="${person.firstName} ${person.lastName}" /> 

Get rid of the <jsp:useBean>. When using the type attribute instead of class, it won't check if there's already an instance in the scope, it will plain override the Person instance which you created in the servlet with a new, blank, default constructed instance.

When using "MVC architecture", the <jsp:useBean> tag is useless. Remove it and just use usual EL to access it:

${person.firstName} ${person.lastName} 

Or better, to prevent XSS attacks, use JSTL <c:out>.

<c:out value="${person.firstName} ${person.lastName}" /> 

Get rid of the <jsp:useBean>. When using the type attribute instead of class, it won't check if there's already an instance in the scope, it will plain override the Person instance which you created in the servlet with a new, blank, default constructed instance.

When using "MVC architecture", the <jsp:useBean> tag is useless. Remove it and just use usual EL to access it:

${person.firstName} ${person.lastName} 

Or better, to prevent XSS attacks, use JSTL <c:out>.

<c:out value="${person.firstName} ${person.lastName}" /> 
Source Link
BalusC
  • 1.1m
  • 377
  • 3.7k
  • 3.6k

Get rid of the <jsp:useBean>. When using the type attribute instead of class, it won't check if there's already an instance in the scope, it will plain override the Person instance which you created in the servlet with a new, blank, default constructed instance.

When using "MVC architecture", the <jsp:useBean> tag is useless. Remove it and just use usual EL to access it:

${person.firstName} ${person.lastName} 

Or better, to prevent XSS attacks, use JSTL <c:out>.

<c:out value="${person.firstName} ${person.lastName}" />