Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8902501
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T01:37:49+00:00 2026-06-15T01:37:49+00:00

Iwas trying to get values from an arraylist (sending this arraylist from a servlet

  • 0

Iwas trying to get values from an arraylist (sending this arraylist from a servlet class) and show them on a jsp page. I’m using jstl tags. I looked at some example and I don’t know why but program always gives error. Here is my error message:

org.apache.jasper.JasperException: An exception occurred processing JSP page /result.jsp at line 26

23:    </br></br>Match Score: <c:out value="${score}"/>
24:    <c:forEach items="${alternativedrugs}" var="alternativedrug">
25:    </br></br>
26:    </br></br>Drug <c:out value="${alternativedrug.name}"></c:out>  
27:    </br></br>Drug Description: <c:out value="${alternativedrug.description}"></c:out>  
28:    </br></br>Drug Targets:  <c:out value="${alternativedrug.targets}"></c:out>  
29:    </br></br>Drug Interactions: <c:out value="${alternativedrug.interactions}"></c:out> 

And here is my jstl code:

This Drug Found
<c:forEach items="${alternativedrugs}" var="alternativedrug">
</br></br>Drug Name: <c:out value="${alternativedrug.getName()}"/>
</br></br>Drug Description:     <c:out value="${alternativedrug.getDescription()}"/>
</br></br>Drug Targets:     <c:out value="${alternativedrug.getTargets()}"/>
</br></br>Drug Interactions:    <c:out value="${alternativedrug.getInteractions()}"/>
</br></br>Match Score:  <c:out value="${score}"/>

Object Class:

package drugtargetdisease;

import java.util.ArrayList;


public class MyDrug {

ArrayList<String> partner = new ArrayList();

private String targets = "";
private String name ="";
private String description ="";
private String interactions = "";
public MyDrug(){

}
public String getTargets() {
    return targets;
}
public void setTargets(String targets) {
    this.targets = targets;
}
public String getName() {
    return name;
}
public void setName(String name) {
    this.name = name;
}
public String getDescription() {
    return description;
}
public void setDescription(String description) {
    this.description = description;
}
public String getInteractions() {
    return interactions;
}
public void setInteractions(String interactions) {
    this.interactions = interactions;
}

}

Servlet Part (alternativedrugs is an ArrayList of MyDrug Objects):

otherdrug.setName((String) myentity.getProperty("drug"));
        otherdrug.setDescription(((Text) myentity.getProperty("description")).getValue());
        otherdrug.setInteractions(((Text) myentity.getProperty("interactions")).getValue());
        otherdrug.setTargets(((Text) myentity.getProperty("target")).getValue());
        if(!otherdrug.getName().equals(maindrug.getName())){
        if(MaxScore <= compare.getExpected(maindrug.getTargets(), otherdrug.getTargets(),maindrug.getInteractions(), otherdrug.getInteractions())){
            MaxScore = compare.getExpected(maindrug.getTargets(), otherdrug.getTargets(),maindrug.getInteractions(), otherdrug.getInteractions());
            alternativedrugs.add(otherdrug);
        }
req.setAttribute("alternativedrugs", alternativedrugs);
    req.setAttribute("score", MaxScore);
        try {
            rd.forward(req, resp);
        } catch (ServletException e) {
            e.printStackTrace();
        }    

Full trace:

 Stacktrace:
at org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:510)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:419)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
at com.google.appengine.tools.development.PrivilegedJspServlet.access$101(PrivilegedJspServlet.java:23)
at com.google.appengine.tools.development.PrivilegedJspServlet$2.run(PrivilegedJspServlet.java:59)
at java.security.AccessController.doPrivileged(Native Method)
at com.google.appengine.tools.development.PrivilegedJspServlet.service(PrivilegedJspServlet.java:57)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511)
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1166)
at com.google.appengine.tools.development.BackendServersFilter.doFilter(BackendServersFilter.java:97)
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:388)
at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182)
at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765)
at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:418)
at com.google.appengine.tools.development.DevAppEngineWebAppContext.handle(DevAppEngineWebAppContext.java:94)
at org.mortbay.jetty.servlet.Dispatcher.forward(Dispatcher.java:327)
at org.mortbay.jetty.servlet.Dispatcher.forward(Dispatcher.java:126)
at guestbook.CompareServlet.doPost(CompareServlet.java:85)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511)
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1166)
at com.google.appengine.api.socket.dev.DevSocketFilter.doFilter(DevSocketFilter.java:74)
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
at com.google.appengine.tools.development.ResponseRewriterFilter.doFilter(ResponseRewriterFilter.java:110)
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
at com.google.appengine.tools.development.HeaderVerificationFilter.doFilter(HeaderVerificationFilter.java:34)
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
at com.google.appengine.api.blobstore.dev.ServeBlobFilter.doFilter(ServeBlobFilter.java:61)
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
at com.google.apphosting.utils.servlet.TransactionCleanupFilter.doFilter(TransactionCleanupFilter.java:43)
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
at com.google.appengine.tools.development.StaticFileFilter.doFilter(StaticFileFilter.java:125)
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
at com.google.appengine.tools.development.BackendServersFilter.doFilter(BackendServersFilter.java:97)
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:388)
at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182)
at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765)
at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:418)
at com.google.appengine.tools.development.DevAppEngineWebAppContext.handle(DevAppEngineWebAppContext.java:94)
at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
at com.google.appengine.tools.development.JettyContainerService$ApiProxyHandler.handle(JettyContainerService.java:380)
at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
at org.mortbay.jetty.Server.handle(Server.java:326)
at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542)
at org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:938)
at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:755)
at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:218)
at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:409)
at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:582)
Caused by: javax.el.PropertyNotFoundException: Could not find property name in class guestbook.MyDrug
at javax.el.BeanELResolver.toBeanProperty(BeanELResolver.java:430)
at javax.el.BeanELResolver.getValue(BeanELResolver.java:290)
at javax.el.CompositeELResolver.getValue(CompositeELResolver.java:231)
at org.apache.el.parser.AstValue.getValue(AstValue.java:123)
at org.apache.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:186)
at org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate(PageContextImpl.java:935)
at org.apache.jsp.result_jsp._jspx_meth_c_005fout_005f1(result_jsp.java:201)
at org.apache.jsp.result_jsp._jspx_meth_c_005fforEach_005f0(result_jsp.java:156)
at org.apache.jsp.result_jsp._jspService(result_jsp.java:99)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:377)
... 55 more
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T01:37:50+00:00Added an answer on June 15, 2026 at 1:37 am

    So, the error message is Could not find property name in class guestbook.MyDrug.

    This means that the is no method

    public String getName()
    

    in guestbook.MyDrug. (Note that it could return anything, and not just String. But since the property is name, I assumed it’s of type String).

    The JSP EL accesses bean properties. It doesn’t access public fields of your class. Using public fields is a bad practice, and JSP doesn’t encourage that. Make your fields private, and provide accessors (getters and setters) if necessary. If you want to read a field from a JSP, you need a getter.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Here's an ASPX code snippet from when I was trying to get multiple values
What I'm trying to do is get 3 values from a key into separate
I was trying to get the contacts using a query through the ContactsContract The
I was trying to get clarification on this: Method-1: Dim request = CreateRequest(uri) //some
I was trying to get PJAX working with my PHP site, this is the
I have sugar crm instance and i was trying to get some data from
I was trying to parse a JSON string from USGS . However I get
I am trying to get some data from the user and send it to
I'm trying to send a lot of data from a form using the $.post
In my application I am trying to retreve data from server using api.Since I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.