java.lang.NoClassDefFoundError: javax/el/ValueExpression - exception

i am using tomcat 5.5.12
i have this code in a jsp file :
<jsp:useBean id="abbreviationlist" class="lexicon.contents.types.AbbreviationListType"/>
<jsp:setProperty name="abbreviationlist" property="id"/>
<table>
<c:forEach items="${abbreviationlist.list}" var="abbreviation">
<tr>
</tr>
</c:forEach>
</table>
i get this error message -
javax.servlet.ServletException: javax/el/ValueExpression
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:272)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
root cause
java.lang.NoClassDefFoundError:
javax/el/ValueExpression
i tried downloadin jstl 1.1 (standard.jar, jstl.jar)
and putting them inside catalina/commun/lib and inside the WEB-INF/lib directory.
that didnt help either.
any help will be appreciated.

In my project we have el-api.jar that contains javax/el/ValueExpression. Do you have that jar in classpath?

Related

CFloop through images in a local directory and display in HTML

I'm very new to ColdFusion, I am trying to pull image files from my PC's network directory and display them in an HTML table. This is what I have so far -
<cfdirectory action="list" directory="#ExpandPath('file://///network/path/Share-Install/path')#" name="listRoot">
<cfoutput>
<cfloop query="listRoot">
// Build HTML table here maybe?
</cfloop>
</cfoutput>
If this code is correct its not clear to me how to work with the data brought back from the file/loop. Like I said I'm just now beginning with ColdFusion, so I appreciate any advise with this!
I was using the wrong approach and ended up getting the result I wanted by using <cfimage>.
Here is my code that loops through my directory and displays the images in HTML table -
<cfdirectory action="list" directory="C:\Share-Install\55555" name="listRoot" filter="*.jpg">
<table width="100%">
<tr>
<cfloop query="listRoot">
<tr>
<td ><cfimage action="writetobrowser" source="/Share-Install/55555/#name#" width="300"></td>
</tr>
</cfloop>
</tr>
</table>

ASP.net Server Error/Parser Error

I have a strange problem with my asp.net website.
I want to run it on two different servers. On one server there is no problem at all but on the other i get the following error message when trying to open it with chrome or ie.
Server Error in '/RTA/ETO' Application.
Parser Error
Description: An error occurred during the parsing of a resource
required to service this request. Please review the following specific
parse error details and modify your source file appropriately.
Parser Error Message:
System.Web.UI.HtmlControls.HtmlTableCellCollection must have items of
type 'System.Web.UI.HtmlControls.HtmlTableCell'. 'asp:TextBox' is of
type 'System.Web.UI.WebControls.TextBox'.
Source Error:
Line 170: Line 171: Line 172:
Text="" ValidationGroup="Size" Visible = 'false' Width="100%"
TabIndex="4" > Line 174:
the code:
<tr id="tr_customerMarketOrganization" runat="server">
<td align="left" colspan="1" valign="top" class="auto-style3">
<asp:Label ID="L_CustomerMarketOrganization" runat="server" Font-Bold="True" Font-Size="1em"
ForeColor="#14007F"></asp:Label>
</td>
<td align="left"; class="style19">
**here ist line 172** <asp:TextBox ID="tbCustomer" runat="server"
Text="" ValidationGroup="Size" Visible = 'false' Width="100%" TabIndex="4" ></asp:TextBox>
</td>
<td colspan="2">
<asp:Label ID="L_Error_Customer" runat="server" Font-Names="Arial" ForeColor="Red" Visible="False"></asp:Label>
</td>
</tr>
Source File: /RTA/Konfigurator_ETO/default.aspx Line: 172
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.19028
No idea about why this error occurs but i had this issue too, just i restart my system and run the application, it work fine now.
I solved this problem by simply reupload the files on the server. So the code wasn't the problem.
This is a parsing error. There are single quotes that need to be double quotes around Visible = 'false' --> Visible = "false".

pass sql result to mako template and show in table

I just decided to learn Pyramid and choose Mako as template language. I got a list from view which is a raw sql result, as follow:
[{'sample': 'R1_Y200.fq', 'study': 'GaoQiang1'},{'sample': 'R1_Y300.fq', 'study': 'GaoQiang2'},...]
view.py:
#view_config(route_name='example', renderer='example.html')
def templet_test(request):
...
return {'result':search_result}
html:
<html>
...
<table border="1" width="500" align="center" cellpadding="0">
<tr>
<th >study</th>
<th >sample</th>
</tr>
% for item in result:
<tr>
<td valign=top align=center> ${item['study']} </td>
<td valign=top align=center> ${item['sample']} </td>
</tr>
% endfor
</table>
...
</html>
But it didn't work out. I got this message:
"Internal Server Error
The server encountered an unexpected internal server error
(generated by waitress)"
How to fix it?
The real exception is shown in console - it will contain the cause of your problem.
You may also want to enable debug toolbar in pyramid to have a more friendly way of error handling in development.
Also by looking at your template - and i assume you use sqlalchemy for database interaction, your probably want to access result rows like item.study , not like item['study'].
That's as much as I can guess without a proper traceback.

Browser is showing the text contents of a file instead of the rendered HTML contents of a file

I'm a rookie in webpage development working on my first webpage. I wrote some HTML code in a text editor and saved it as an HTML file. However, when I open it in my browser, I only see the plain HTML text instead of the table. Can anyone help me with this?
The following is my code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
</HEAD>
<BODY>
<CENTER>
<TABLE border=2>
<CAPTION>My Homework</CAPTION>
<TR>
<TD>Link to Homework #1</TD>
<TD>Link to Homework #2</TD>
<TR>
<TD>Link to Homework #3</TD>
<TD>Link to Homework #4</TD>
<TR>
<TD>Link to Homework #5</TD>
<TD>Link to Homework #6</TD>
<TR>
<TD>Link to Homework #7</TD>
<TD>Link to Homework #8</TD>
</TABLE>
</CENTER>
</BODY>
</HTML>
In addition to closing the <TR>'s with </TR>'s make sure you are saving the file with an extension that indicates it's an HTML file. page.html, page.htm etc.
So you are using TextEdit on Mac. Sounds like you might want to read this to ensure you are saving the file correctly.
What Andrew said is correct about proper HTML. But all browsers fix slightly broken HTML when they render the page.
From the sounds of the issue, i think you might have a file with 2 extensions e.g.: test.html.txt
Make sure in windows, you show known file type extensions and the file doesn't have a .txt (or any other extension besides .htm or .html) at the end of it.
The HTML editor you are using may be translating what you type in as HTML - that is, when you type <html> , it becomes something like: <html>
Try opening up the file is a simple text editor to see if this is happening.

How to get an attribute from a JSONObject in a jsp with Struts2?

I have the following situation:
<s:iterator var="doc" value="docList">
<tr>
<td class="lastm">${doc.get("attribute")}</td>
</tr>
</s:iterator>
docList is an ArrayList of JSONObjects.
When I load my page I get the following error:
The function get must be used with a prefix when a default namespace is not specified
I've also tried doing
<td class="lastm">${doc.attribute}</td>
but then I get the following error instead:
Property 'attribute' not found on type org.json.JSONObject
What am I doing wrong?
The ArrayList has been originally built from a bigger JSONObject that contained the smaller "docs", but I needed an Iterable object to build my table. Is there a better way to do this?
I've found a solution.
Instead of using
<s:iterator var="doc" value="docList">
<tr>
<td class="lastm">${doc.get("attribute")}</td>
</tr>
</s:iterator>
I can do
<s:iterator var="doc" value="docList">
<tr>
<td class="lastm"><s:property value="#doc.get('attribute')"/></td>
</tr>
</s:iterator>
Looks like it works!
<s:property value="attribute"/> should also work.