• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Knute Snortum
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Ganesh Patekar
  • Stephan van Hulst
  • Pete Letkeman
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Ron McLeod
  • Vijitha Kumara

Runtime Errors with Dynamic EL Code  RSS feed

 
Ranch Hand
Posts: 1869
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am trying to make my jsp container as dynamic as possible. However, in my js I get an error when the container is called on line 85 of code.



Console output:

...
[9/17/18 16:46:58:693 CDT] 00000080 ServletWrappe I com.ibm.ws.webcontainer.servlet.ServletWrapper init SRVE0242I: [QMSWebAppEAR] [/QMSWebApp] [/NCRV8/NCRV8-Queue/NCRQueueDisplayForm.jsp]: Initialization successful.
[9/17/18 16:46:58:679 CDT] 00000080 SystemErr     R javax.el.PropertyNotFoundException: Property 'optionValue' not found on type java.lang.String
[9/17/18 16:46:58:679 CDT] 00000080 SystemErr     R at javax.el.BeanELResolver$BeanProperties.get(BeanELResolver.java:232)
[9/17/18 16:46:58:679 CDT] 00000080 SystemErr     R at javax.el.BeanELResolver$BeanProperties.access$400(BeanELResolver.java:209)
[9/17/18 16:46:58:679 CDT] 00000080 SystemErr     R at javax.el.BeanELResolver.property(BeanELResolver.java:319)
[9/17/18 16:46:58:679 CDT] 00000080 SystemErr     R at javax.el.BeanELResolver.getValue(BeanELResolver.java:89)
[9/17/18 16:46:58:679 CDT] 00000080 SystemErr     R at javax.el.CompositeELResolver.getValue(CompositeELResolver.java:55)
[9/17/18 16:46:58:679 CDT] 00000080 SystemErr     R at org.apache.el.parser.AstValue.getValue(AstValue.java:174)
[9/17/18 16:46:58:680 CDT] 00000080 SystemErr     R at org.apache.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:283)
[9/17/18 16:46:58:680 CDT] 00000080 SystemErr     R at org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate(PageContextImpl.java:778)
...
 
Author and ninkuma
Marshal
Posts: 66806
168
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What is it that you are trying to do here:?
 
Steve Dyke
Ranch Hand
Posts: 1869
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Bear Bibeault wrote:What is it that you are trying to do here:?



My first select list each option has a data attribute that associates to a session defined list. I want to assign this data attribute to the wValue3 variable.

After thinking about this the only way I may get it to work is by using ajax. But you may have a better way I am hoping. 
 
Steve Dyke
Ranch Hand
Posts: 1869
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Steve Dyke wrote:

Bear Bibeault wrote:What is it that you are trying to do here:?



My first select list each option has a data attribute that associates to a session defined list. I want to assign this data attribute to the wValue3 variable.

After thinking about this the only way I may get it to work is by using ajax. But you may have a better way I am hoping. 



I have tried the AJAX method, the list displays but is not populated as expected.



Servlet code:



Console display:
NCRV8ControllerServlet: jReturnString: {"testThisReturn": "<select class='ncrquefilterinputs_select ncrvc r-margin' data-inputfield='vendorcode' data-quefiltersource='search'>
<c:forEach var='itemName3' varStatus='status3' items='${defaultpramsObj.vendorList}'><option value='${itemName3.optionValue}'>${itemName3.optionDesc}</option>
</c:forEach></select>"}


Return code:

 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66806
168
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You got my point exactly. The JSP is evaluated on the server long before the generated page is sent to the browser where JavaScript is executed. So trying to mix JavaScript into the JSP requires temporal anomalies and likely subatomic particles that can cause subspace shifts and phasic distortions¹.

Likely what you need to consider is doing in JavaScript the manipulations that you were thinking about doing in JSP.



¹ Apologies if you're not a Star Trek fan.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66806
168
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In your Ajax logic, where do you do anything with the response?

And why is it a POST?
 
Steve Dyke
Ranch Hand
Posts: 1869
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Bear Bibeault wrote:In your Ajax logic, where do you do anything with the response?

And why is it a POST?



Return code:(I thought this handled the response.)



I thought you used a post if the servlet response was not dispatching another view.

I learn every day and I thank you for all the help you have been over the years.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66806
168
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
OK, the formatting of the code made me miss where the handler was passed.

No, as it simplest, a POST is mostly used when a non-idempotent operation is to be executed on the server. There's a little more than that to it, but that'll do for our purposes.

Getting data, even if its pre-formatted HTML, is clearly a GET.

And, if the intent is to load the formatted HTML returned as the response into the DOM, that's where the jQuery .load() method is really handy.
 
Steve Dyke
Ranch Hand
Posts: 1869
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Bear Bibeault wrote:OK, the formatting of the code made me miss where the handler was passed.

No, as it simplest, a POST is mostly used when a non-idempotent operation is to be executed on the server. There's a little more than that to it, but that'll do for our purposes.

Getting data, even if its pre-formatted HTML, is clearly a GET.

And, if the intent is to load the formatted HTML returned as the response into the DOM, that's where the jQuery .load() method is really handy.



Still is not working as expected, but closer.

My AJAX call:



My servlet code:



Console output:

<select class='ncrquefilterinputs_select ncrvc r-margin' data-inputfield='vendorcode' data-quefiltersource='search'>
<c:forEach var='itemName3' varStatus='status3' items='${defaultpramsObj.vendorList}'>
<option value='${itemName3.optionValue}'>${itemName3.optionDesc}</option>
</c:forEach></select>

My container code:



The select2 list is displayed with only one item - "${itemName3.optionDesc}"
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!