JSP :: How Is Classpath Set For JSTL

Sep 9, 2014

I am looking at JSP page, which has code line as follows

<%@ page language="java" contentType="text/html; charset=UTF-8"%>
<%@ taglib uri="http://jakarta.apache.org/struts/tags-bean" prefix="bean" %>
<%@ taglib uri="http://jakarta.apache.org/struts/tags-html" prefix="html" %>
<%@ taglib uri="http://jakarta.apache.org/struts/tags-logic" prefix="logic" %>

This taglib will have to be installed on local environment. How is it referred in jsp ? I dont see any code in jsp, which refers to the location of JSTL. So how does jsp invoke these tags ? Is it through classpath ?If its so , how is classpath set for JSTL ? Is it just as classpath is set for java ?

View Replies


ADVERTISEMENT

Runtime Classpath And Compile Time Classpath?

Jan 9, 2014

I compiled a program with a JAR in the classpath. Also ran it with the JAR passed with classpath. For instance I used MySQL .jar.

So I feel it was required in both classpath. I have heard the Servlet API jar is also an example of what is needed at compile time.

View Replies View Related

Include EAR File In Classpath?

Jan 23, 2014

I am writing an Ant script using the javac command but the library I need is bundled in an ear file, how can I reference this jar in ear file without extracting the ear file.

View Replies View Related

EJB / EE :: Java Classpath Error

Jun 11, 2014

I'm trying to run an enterprise java application running glasssfish server from my university ( the open university, distance learning and i recommend it). I get the following error:

pre-init:
init-private:
init-userdir:
init-user:
init-project:
do-init:
post-init:
init-check:
init:

[code]...

The Java EE server classpath is not correctly set up - server home directory is missing.Either open the project in the IDE and assign the server or setup the server classpath manually.For example like this: ant -Dj2ee.server.home=<app_server_installation_directory> BUILD FAILED (total time: 0 seconds)

View Replies View Related

Classpath With Ant Deployment Not Working

Sep 6, 2013

I am having an issue that I cannot seem to resolve with Ant deployments and my Classpath.
 
I have a module that is needed to run with Open Wonderland but for some reason when I run this particular module deployment it doesn't recognize part of the classpath.
 
On my server I have a class called JadeRunner.class and it is included in my classpath.  I can verify but running the following code:

public class testClassPath{
     public static void main(String args[]){
          String classArg = args[0];
          try{
             Class testClass = Class.forName(classArg);
          }catch(ClassNotFoundException e){
             e.printStackTrace();
          }
     }
}

I just enter the name of the class as an argument and if I get no errors that it can find the class.  This works if I enter it directly from the command line.  However with my ant deployment I get a ClassNotFoundException for this class.
I run my ant deployment as root but I use the -E switch so it picks up my environment variables.  The ant deployment finds all my other environment variables except this one. 

I have some sample outputs:

$ java testClassPath org.jdesktop.wonderland.modules.mas.jade.weblib.JadeRunner  (this give no output, so it finds the class)
$ sudo -E java testClassPath org.jdesktop.wonderland.modules.mas.jade.weblib.JadeRunner  (again no output, so it finds the class)
$ sudo -E ant deploy

This gives ClassNotFoundException: org.jdesktop.wonderland.modules.mas.jade.weblib.JadeRunner

View Replies View Related

JVM - Classpath From A File Or MainClass From Outside Jar?

Sep 19, 2014

I need to start a new JVM. To do this my (production-) code pick a certain jar and starts a class in it. The name of this class is not fix. The picked jar has other jars in its Manifest class path section.
 
For my tests I want to replace my jars red from the main jar with the compile target folders of my Eclipse projects that make up my Application.
 
Getting that folders is quite easy because i configured the Starter project to depend on the other Projects of my app so that they are available via System.getProperty("java.class.path"). But eclipse creates absolute path in there. The result is that I cannot use the output of System.getProperty("java.class.path") as command line parameter, it's simply to long.
 
I tried to put the class path in a temporary jar file but it looks like that the jars class path is not added to the resulting class path when i is simply added as another classpath entry at command line. On the other hand I cannot run this temporary jar file via -jar option because the main class cannot be found if it is not located in the temporary jar...
 
Meanwhile I found that the main problem is not so much the other Projects but the 3rd party libs which eclipse refers them in their maven repository location. They blow up my classpath. I tried to convert their paths to relative but this didn't change that much...
 
So my question is:
1. is there a way to provide the classpath in a text file to java executable on command line?
2. is there a way to run a jar with the -jar option if the main class is outside the jar (but within the classpath in the jars manifest)?
3. is there any other way to solve my problem resulting from the limited command line length?

View Replies View Related

EJB / EE :: Classpath Requirements For Facelets And CDI On Glassfish

Oct 29, 2014

I don't understand the classpath requirements for facelets and CDI on glassfish. I'm using Netbeans, and have the following:

thufir@dur:~/NetBeansProjects/EntAppWeb$ jar -tf dist/EntAppWeb.ear
META-INF/
META-INF/MANIFEST.MF
lib/
EntAppWeb-ejb.jar
EntAppWeb-war.war
lib/javaee-api-7.0.jar
thufir@dur:~/NetBeansProjects/EntAppWeb$

when I look at javaee-api it has javax.enterprise.context.ApplicationScoped and javax.inject.Named which are the particular imports being used in the bean. The facelets part is working, the template navigates correctly. It deploys to Glassfish and runs, except...there's no output from the @Named bean:

package dur.beans;
import javax.enterprise.context.ApplicationScoped;
import javax.inject.Named;
@Named("nextClient")
@ApplicationScoped
public class NextClient implements NextClientLocal {

[code]...

Now it's working. I can't figure what I did for the life of me...that's the desired output, each time the page is accessed the counter increments.Now it works. Is this on the right track? Way off base? I have an entity class from a database which I'd like to link up to this, and output the class.I can inject the entity into NextClient? I'm trying to do the "R" for Read in a CRUD application with CDI and facelets (using templates).

I've found much reference material on EJB, but it seems a mishmash. I just want to use CDI. What am I doing right/wrong, or, besides the PDF from Oracle on Java EE 7, what are good CDI reference material's?

View Replies View Related

How To Add JAR And Config Files To CLASSPATH At Runtime

Jan 23, 2015

During runtime, I need to load the JAR files and relevant config files( .cfg files and .properties file) into CLASSPATH and run a specific java program from one of the JAR which is available in CLASSPATH.

Any relevant Java API details or a sample java program to implement the above use case.

View Replies View Related

Trying To Add Database Driver (JDBC) - Not In CLASSPATH Warning?

Jun 23, 2015

This the output of java from my PC under linux platform (rhel 6.5).
 
[pentaho@vertica-srv1 Downloads]$ java -version
java version "1.7.0_79"
Java(TM) SE Runtime Environment (build 1.7.0_79-b15)
Java HotSpot(TM) 64-Bit Server VM (build 24.79-b02, mixed mode)
 
[Code] ....
 
But the problem is while trying to open ETL program under linux platform [pentaho@vertica-srv1 data-integration]$ ./spoon.sh .... I received the following error messages.
 
[pentaho@vertica-srv1 data-integration]$ ./spoon.sh
 
Trying to add database driver (JDBC): RmiJdbc.RJDriver - Warning, not in CLASSPATH?
Trying to add database driver (JDBC): jdbc.idbDriver - Warning, not in CLASSPATH?
Trying to add database driver (JDBC): org.gjt.mm.mysql.Driver - Warning, not in CLASSPATH?
Trying to add database driver (JDBC): com.mckoi.JDBCDriver - Warning, not in CLASSPATH?
[KnowledgeFlow] Loading properties and plugins...

View Replies View Related

Entering CLASSPATH In Manifest File When Directory Is Not In Root?

Jul 1, 2014

I'm trying to add a CLASSPATH to a manifest file linking (not sure If that's the right word) to an sqljdbc4.jar file.

If I copy the file Into my root folder and use CLASSPATH: sqljdbc4.jar It works fine.

Class-Path: sqljdbc4.jar
Main-Class: com.ncntech.go

If I try CLASSPATH: C:Program FilesMicrosoft JDBC Driver 4.0 for SQL Serversqljdbc_4.0enusqljdbc4.jar I receive a "Could not find or load main class" error.

Class-Path: C:Program FilesMicrosoft JDBC Driver 4.0 for SQL Serversqljdbc_4.0enusqljdbc4.jar
Main-Class: com.ncntech.go

Is the syntax correct for specifying a directory path ?

View Replies View Related

JavaFX 2.0 :: SceneBuilder - Preview Classpath-relative Images

May 7, 2014

When I assign a classpath-relative URL to an ImageView's 'Image' property, SceneBuilder is unable to display the Image in the Preview. It shows the text "Image not found" instead as a placeholder, which makes sense. What I'd like to do is add a classpath entry to SceneBuilder such that it is able to locate and display the Images. Any way to accomplish this (or similar)?

View Replies View Related

JSP :: JSTL To Put Value In Request?

Mar 12, 2014

I am fetching records from result set and displaying on JSP with <c:forEach> tag

<c:forEach var="outer" items='${ProductList}' varStatus="seq1">
<tr>
<td class='center' nowrap><input type="radio" name="view" id = "view" value="Y" ></td>
<td class='left' nowrap><c:out value='${outer.sourceIndex}' /></td>
<td class='left' nowrap><c:out value='${outer.prodNameAbbr}' /></td>
<td class='left' nowrap><c:out value='${outer.productName}' /></td>
<td class='left' nowrap><c:out value='${outer.effectiveDate}' /></td>
<td class='left' nowrap><c:out value='${outer.uuName}' /></td>
</tr>
</c:forEach>

Below is one row with radio button

SourceIndex ProductAbbreviation Product Name Effective Date UseID
ABC PQR Test123 03/12/2014 smj

I have a view button also to select above radio button. When I select that I need all above values to be set in request.

View Replies View Related

JSP :: Translate To JSTL And EL

May 25, 2014

translate this part to jstl and el?

<%
while(i<nrows){
if(i==0){
%>
<tr>
<td ><b>id_article</b></td>
<td ><b><font color="#FF0033">nbr_stock</font></b></td>
<td ><b>critical_nbr</b></td>
<td ><b><font color="#FF0033">date_first_stock</font></b></td>

[code]....

View Replies View Related

JSP :: Sorting Query In JSTL?

Jun 21, 2006

i am doing a code using JSTL to fire a query. everything come fine except the resule is not sorted as desired. i am putting the code below--

String sort_order=(String)request.getAttribute("sort_order");
request.setAttribute("sort_order",sort_order);
<sql:query var="viewQueryj" sql= "select USER_ID, PERMISSION_ID, USER_NAME from administrator order by ?">
<sql:param value="${sort_order}"/>
</sql:query>

now the resule is always sorted by USER_ID. if i want to sort it using USER_NAME i pass parameter from controller to this page in sort_oredr variable which comes fine but the result doesn't sort by name, only by id. if i hardcode USER_NAME in query then the result is as desired.

View Replies View Related

JSP :: Using List From JSTL To Scriptlets?

Aug 29, 2014

I want to use the list element inside my scriptlet. Below is my code which is not working.

<c:forEach var="social" items="${sociallist}">
<%
callToFunction(%>${social}<%);
%>
</c:forEach>

How can i access social var inside scriptlet.

View Replies View Related

JSP :: How To Use Join In JSTL Function

Jul 31, 2014

In JSP page: firstly set the setter of a entity in bean and then set it in session,request etc. and gvet values using foreach loop as follow :

<jsp:useBean id="st" class="beans.student">
<jsp:setProperty name="st" property="roll_no"/>
</jsp:useBean>
<%

[Code]....

Here start is the variable whose value will vary after every time i visit this function.So how would i be able to use above query.

P.S. i was using scriplet before and i was able to deal these issues with scriplet easily.

View Replies View Related

JSP :: JSTL Import Not Working?

Jan 25, 2014

I have the following data in a file called books.xml in my WEB-INF folder:

<?xml version="1.0"?>
<books>
<book>
<name>Padam History</name>

[Code] ....

I'm using the following code in a jsp:

<c:import var="bookInfo" url="/WEB-INF/books.xml" />

I know that it's finding the file because if I delete books.xml from the WEB-INF folder I get a FileNotFound exception.

However, for some reason it doesn't appear to be importing the data into the bookInfo variable.

I noticed this problem because when I try to parse it via:

<x:parse xml="${bookInfo}" var="output"/>

I get org.xml.sax.SAXParseException: Premature end of file.

When I try to display the data in the variable either by:

<c:out value="${bookInfo}" />

...or by means of a scriptlet (which I realize is not a best practice):

<%
String myVariable = (String)pageContext.getAttribute("bookInfo");
System.out.print("bookInfo=" + myVariable);
%>

...I get nothing.

BTW when I do:

<c:import var="data" url="http://www.tutorialspoint.com"/>
<c:out value="${data}"/>

that works fine!

View Replies View Related

Accessing HashMap With JSTL

Aug 18, 2014

I have a HashMap returned from the server. There are two conditions

1. HashMap returned with only one set of key value pair or

2. HashMap with multiple set of data key value pairs.

Now in UI I have to display either text box or drop down box depending upon the size of map for that I am using length method

Java Code:

<c:choose>
<c:when test="${fn:length(myDto.mayMapInDto) eq 1}">
display text box
</c:when>
<c:otherwise>
display drop box
</c:otherwise>
</c:choose> mh_sh_highlight_all('java');

I can display drop box by looping but not sure how I can get only one element for text box. Tricky is I can't use key value to access since UI don't know what key will be returned.

View Replies View Related

JSP :: JSTL Tag To Select Dropdown Value

Mar 14, 2014

I have for values in drop down:

<SELECT name = "productCodeDefault" id="productCodeDefault" value="<c:out value ='${ProductDefBean.productCodeDefault}'/>" >
<OPTION value="" ></OPTION>
<OPTION value="a" >A1</OPTION>
<OPTION value="b" >B1</OPTION>
<OPTION value="c" >C1</OPTION>
<OPTION value="d" >D1</OPTION>
</SELECT>

When I am getting value = "a" from ProductDefBean, In the dropdown 'A1' should get selected. This is not happening. What I need to modify?

Note** When I am doing view Source of my JSP, I am getting value='a'

View Replies View Related

JSP / JSTL :: How To Open CHM File

Sep 13, 2012

Is there a way we can open a .chm file stored at server through jsp application without downloading the file and saving it to the local machine.

What I googled is : we cannot download .chm files from a web browser and simply click Open.  Download the .chm file to your computer first, right-mouse click it in Windows Explorer and select Properties.  Then click Unblock.

But I want my users to simply view the file without downloading it.

View Replies View Related

JSP / JSTL :: How To Group Expressions In EL

Nov 12, 2013

In jsp when using EL the parenthesis are not allowed for grouping of expressions. I mean

${(2+3)-1}

is not allowed so if i have to group expressions in EL how do i achieve it?
 
I wanted to do the following in EL

${(a==b && b==c) || (v==r && r==d)}

so how do i achieve this?

View Replies View Related

JSP / JSTL :: Pass Value And Validate

Feb 15, 2013

Why will this NOT validate correctly in my IF Statement? Basically, a user chooses an option from the drop down list. The value is passed to t.jsp (itself) and if the option "All" is chosen, then it does something. If any of the years are chosen, then it does something else.

t.jsp (simplified version of what I want)

<%@ page import="java.sql.*" %>
<%@ page import="java.io.*" %>
<html>
<form method="get" action="t.jsp">
Select Year:

[Code] ....

View Replies View Related

JSP :: Pass Parameter From Jstl To Expression Tag

Mar 7, 2015

I have a variable <c:set var="var1" value = "myvalue" /> , I want to pass var1 as <%= new customclass().method1(var1) %>.what is the syntax to pass this value.

View Replies View Related

JSP :: How To Convert String Into Integer In JSTL

Feb 17, 2015

I am having problem in converting JSTL variable into integer type in JSP (not using Spring). I am looking to do something like below:

<c:set var="total_amt">${list.totalAmount}</c:set>
<c:when test="${new Integer(total_amt) > 500}">

View Replies View Related

JSP :: Using JSTL To Format Date And Time

Jul 14, 2014

How to format this "2014-07-14T19:40:46" date to dd-mm-yyyy with time using jstl?

View Replies View Related

JSP :: JSTL And EL - Long Value Cast To String

Mar 27, 2015

I'm trying to write a condition to jstl if tag,

<c:forEach var="ledg" items="user_ledgers">
<c:if test="${ledg.transactionID == param['trns']}">
<c:out value="${ledg.name}"/>
</c:if>
</c:forEach>

Ledg is an object of ledger class and transactionID is a field of type long.

I found this error while runtime.

javax.el.PropertyNotFoundException: Property 'transactionID' not found on type java.lang.String

I tried to convert transactioID value to String by several ways. But not working.

String concatenation
<c:if test="${(ledg.transactionID+’’) == param['trns']}">
Using custom tag
<c:set var="equals" scope="page">
<z:doTheyEquals v1="${ledg.transactionID}" v2="${param['trns']}"/>
</c:set>

It also expects String type.

View Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved