Including .vbs in JSP
Hi all
Can anyone tel me now to include a .vbs(vb script file) in the JSP
i tried like this
<script language="vbscript" src="/essPortal/resources/vbs/emulator.vbs"></script>
but im getting an script error telling "Type mismatch". But when i place the script function directly in the JSP its working fine.
Is there a way we can include .vbs in jsp
guys got teh answer, i was using script header in teh .vbs file
Similar Messages
-
Dynamic include file in JSP page
<span class="value">Hi
i have index.jsp , this page can include jsp
pages dynamically by passing the name of the page to be included to the
index page with out .jsp , so if i want to include page "code.jsp" i
put: .../index.jsp?page=code , this have to include code.jsp page
i made the following code , but it did not find the file
so can any one help plz ?
String pg=request.getParameter("page");
if( pg!= null && ! "".equals(pg)){
File f=new File(request.getParameter("page")+".jsp");
if(f.exists()){
out.print("file exist");
%>
<jsp:include page="<%=request.getParameter("page")+".jsp" %>" />
<%
}else{
out.print("file not exist");
What does the file existing or not really have to do with it?
You can try it like this:
String pg=request.getParameter("page");
if( pg!= null && ! "".equals(pg)){
String webPath = pg + " .jsp";
String realPath = request.getRealPath(webPath);
File f=new File(realPath);
if(f.exists()){
out.print("file exist");
%>
<jsp:include page="<%= webPath %>" />
<%
}else{
out.print("file not exist");
}Alternatively you could try using a request dispatcher:
RequestDispatcher rd = request.getRequestDispatcher(webPath);
if (rd == null){
// doesn't exist
} -
Include file in jsp not working
Hi ,
I have an include file statement in my jsp file which is not working. Not getting any error message either only the page is displayed without the jsp file included.
My include code looks like this :
<%@ include file ="Includes/hello.jsp" %>Also i tried including an html file or an image in the same place neither of the two displayed.
<!--#include virtual="includes/footer.html" -->
My jsp file is hosted on IISnb123 wrote:My jsp file is hosted on IIS
Hi ,
I have an include file statement in my jsp file which is not working. Not getting any error message either only the page is displayed without the jsp file included.
My include code looks like this :
<%@ include file ="Includes/hello.jsp" %>Also i tried including an html file or an image in the same place neither of the two displayed.
<!--#include virtual="includes/footer.html" -->
My jsp file is hosted on IIS
Check the path you've specified. It may well be;
<%@include file="hello.jsp" %>or
<%@include file="/Includes/hello.jsp" %> -
It is possible to include a page .jsp in another page???
How??
thanksPerhaps you mean a page fragment (jspf)?
If so, see http://developers.sun.com/prodtech/javatools/jscreator/learning/tutorials/2/pagefragments.html -
Error when using %@ include file="/test.jsp"%&
UsingNitrox version 2.1 M3 (build 419 06022005):
with jdk version: 1.5.0_03 and Tomcat 5.5.9
This is the error :cry: when using <%@ include file="/test.jsp"%> in jsp:
Severity 2
The type java.lang.Object cannot be resolved. It is indirectly referenced from required .class files (test.jsp)
It used to work in previuos version of Nitrox. I can't use struts tiles because the tiles content is dynamic (run time) and I need it to be static (at compile time).
Have you encountered this problem? What is the fix? Nitrox bug?
I need your help please,
AlbertoM7,
I found the problem :wink: . In the java Build path having the default (ALL) is not picking up the content of the package. I had to use add multiple and include all the folders and subfolders (many L) in my packages. After that I added *.java and *.properties to select all the java files. Now it is working. I assume this is a bug in Nitrox. The default ALL should include the all the files in the path.
Thanks,
Alberto -
"include directive or jsp:include "
Hi,
Which amongst <%@ include file="header.jsp" %> and
<jsp:include page="header.jsp"/>to be used, when performance is taken into account.Code copy from serverside.com
Is it the same as --> jsp:include and %@ include directive.
Actually, <jsp:include> vs. <%@ include %> is a different story.
<%@ include %> is a "compile-time" include. The included file is inserted into the JSP when the JSP compiles.
<jsp:include> is a "run-time" include. If JSP-1 includes JSP-2, JSP-2 is invoked when JSP-1 executes, and the output of JSP-2 is inserted into the output stream of JSP-1.
The run-time include runs a bit slowly, but can save a lot of system memory, so in general, the run-time include is preferable. Only use the compile-time include if the include code must be in the same page.
For example, if you want to use an include that defines a bunch of tag libraries with the taglib directive, it will have to be a compile-time include. If you just want to insert a standard header and footer in your page, a run-time include will be more effecient.
I hope its enough for you to get an clear cut idea, -
My jsp pages use some endcoding as UTF-8.
When I use <%@ include file="myfile.jsp"%> endcoding lose format UTF-8. But
if I use <jsp:forward page="myfile.jsp"/> it work fine.
Pls tell me use <%@include %>
(I use Jbuilder 6 and weblogic server 6.1)
Thanks .
From http://java.sun.com/products/jsp/tags/12/syntaxref1214.html#8828 (emphasis mine):
page="{ relativeURL | <%= expression %> }"
The relative URL that locates the resource to be included, or an expression that evaluates to a String equivalent to the relative URL.
The relative URL looks like a pathname--it cannot contain a protocol name, port number, or domain name. The URL can be absolute or relative to the current JSP page. If it is absolute (beginning with a /), the pathname is resolved by your web or application server.
You could use a servlet in your "path" attribute and have that servlet read and return the page from a different server; there are ways to do what you want, but <jsp:include> isn't one of them. -
Problems with include where the include is a jsp
Hi ,
I have a typical problem. The iplanet server doesn't interpret the code
from a jsp which is included in another jsp. For eg.
code for main jsp
request.getParameter("username");
<%@ include file="/jsp/ui/left_nav.jsp" %>
processing code.
Now when I start the server and the first time I load this page I get a
dearranged page which has the code of the left_nav.jsp present in the html
output.
On opening this page to edit, when a small modification is made and the file
is saved, a reload of the same page gives the proper output with all the
jsp's interpreted.
Thanks to one and all,
Regards,
GurjitYou definitely want to use a jsp include action, not a directive. The directive
happens at translation time and does not process the requested page. An action
happens at request time and treats the requested page as a new request, thus
including the results of the invoked jsp.
BTW, the include action is the tags that looks line <jsp:inculde
page="included_page.jsp" flush="true"/> or something similar (parameters can
also be specified).
The JSP 1.1 spec has more details. See sections 2.7.5 & 2.7.6 (for the include
directive and a quick comparison of the directive vs the action) and 2.13.4 (for
the include action).
Matt
Gurjit wrote:
Hi ,
I have a typical problem. The iplanet server doesn't interpret the code
from a jsp which is included in another jsp. For eg.
code for main jsp
request.getParameter("username");
<%@ include file="/jsp/ui/left_nav.jsp" %>
processing code.
Now when I start the server and the first time I load this page I get a
dearranged page which has the code of the left_nav.jsp present in the html
output.
On opening this page to edit, when a small modification is made and the file
is saved, a reload of the same page gives the proper output with all the
jsp's interpreted.
Thanks to one and all,
Regards,
Gurjit -
Hi,
I am trying to include a html file in a JSP using the tag...
<%@ include file="Header.html" %>
When I keep Header.html file in the Web Server root its not able to include the file and gives an error saying "unable to load the resource.... PropertyResourceBundel error". But when i copy the same html file on the the ApplicationServer root its picking it up and gives me no error.
Can any one help me out what could be the problem.
Thanks in advancehi
the path given in the include tag should be
relative to the JSP page from which you are
calling it. that means the mentioned thing
will work if both the files are in the same
directory. otherwise you have to give the
path where the included file resides.
About the webserver and App. server thing,
i am not sure. may be more information about
the same can help. like the servers which
you are using and all..
Paragk -
Including applets in JSP - problem!!
I'll begin by admitting that I am fairly new to JSP. That said, I am experiencing a ClassNotFoundException when trying to include an applet in a JSP under certain conditions. Here's the detail:
I'm using Tomcat 4.0.4 and am working in the default ROOT webapp directory. This is running on Win2k Pro on port 8080. I HAVE managed to get the applet to load under the following circumstances:
- JSP page in ROOT/jsp directory
- applet class file (and supporting classes) ALSO in ROOT/jsp directory
That's just great... but I want to be able to place the applet class file and supporting classes with all of the other class files in ROOT/WEB-INF/classes. Here's the scenario that fails time and time again:
- JSP page in ROOT/jsp directory
- applet class file (and supporting classes) in ROOT/WEB-INF/classes
- in this scenario I have added a 'codebase' attribute to the applet tag (please be aware that I have tried this with both the APPLET tag and the jsp:plugin tag, each method yielding identical results)
- I have tried several different codebase values, all listed below:
codebase="../WEB-INF/classes/"
codebase="http://localhost:8080/servlet/"
codebase="http://localhost:8080/WEB-INF/classes/"
codebase="."
and I have tried it w/o a codebase at all
None of these help the JSP to find the applet class file. I've really thrown my hands up in the air with this. I realize that every 3rd or 4th thread is typically a beginner with some Class not found error... but I've put my time in on this one, and I cannot figure it out. Thanks.Hi, Ben
You bring up a very good issue that a lot of these books about JSPs and Servlets usually forget to mention.
I dont know what sort of Web Servlet Container you are using, but I know that in Tomcat there is a 'lib' and and 'classes' directory, so if you want to have classes that are used by different applications from different directories then you can place them there. If you want you can compile all these classes into a jar and put that jar either in the 'TOMCAT_HOME/lib' or 'TOMCAT_HOME/common/lib' directories or you can simply put all the .class files into either the 'TOMCAT_HOME/classes' or 'TOMCAT_HOME/common/classes' directories. This way your classes will be known to any applications running on your webserver.
If, however, you want supporting classes to be only used by servlets or jsps, then you should put them in the web-inf directory.
Let me know if this works,
Val. -
can you tell me the information through which we can include psp in our jsp pages with the <jsp:include/> tag ,since it is mentioned by oracle documentation we can include psp pages in our jsp.
So can somebody give me the solution since in my project I have to use psp and jsp both .So please help me out for this.No it is not possible.
Include directive is like copying and pasting some text into a JSP file, and then translating/compiling it.
So the only thing you can include with the <%@ include %> directive is a jsp fragment
It is a static translation/compile time include and thus will always be the same
By contrast <jsp:include> is a runtime include, and includes the result of running the imported url.
That URL has to be a complete/standalone jsp/servlet/whatever. However as it is runtime, it can take parameters where the include directive can not.
Does that answer your homework question?
Cheers,
evnafets -
Including Applets in jsp without using Archive
Can any one help me to include the Applet without using the Archive attribute in either <jsp:plugin> or <applet> tag. I am using WebLogic workshop8.1 on win 200 platform , it builds class files in a seperate directory which starts with .workshop dirctory. I should include that directory as the codebase for the applet.
regards
varada rajulu
Turning Point Software Solutions Indiayeah. don't use it. You specify the code (class) and the codebase tag, and the classes have to be loose on the server under the package directory structure that the classes' package is set up for.
-
Hi @include in a JSP function
Hi,
I wanted to use the @include directive in a jsp function. But when I compile it I get errors.
Is this allowed ?
<%!
private boolean isDisplayAllowed () {
%>
<%@include file="foo.inc"%>
<%@include file="bar.inc"%>
<%
%>
Thanks
RTThanks
I have a code that is needed to be shared between multiple jsp files. So I moved them to an inc, file so as to share between multiple files.
Now I need to use this in jsp functions, so I am not sure how to do this.
If instead of using include approach if there is any other way to share the code, please let me know.
Thanks
RT -
well, With SSI, i can do things like < ! cgi exec="script.cgi" >
but, < jsp : include="script.cgi" > or < %@ include file = "script.cgi" % > just display the source code of the cgi program instead of the result. any simple method i can use?/Bad elty ! <slaps hand> you are about 2 counts away from a time out Mister :p !!!!
/cgi shiver -
Hi,
Is there any way through which I can include the porlet in an external JSP?
If yes then how.
Edited by: axeeeffect on May 14, 2009 12:45 AMThe easiest way is to use a URL item that points to a JSP and
displays it in the folder area. The JSP would run outside of
Portal in it's own servlet container.
You can use a Java Application item type, but you can't make it
display in the folder area.
In the next release of Portal, you'll be able to use JSP to
define a portal page. You will also be able to embed portlets
in a JSP.
Regards,
Jerry
Maybe you are looking for
-
I can't get it working.
This should be a no brainer, but it hasn''t turned out that way. I Have a MacBook pro and an airport extreme. I also have a cable modem. With the cable modem plugged in and responding, I followed the setup helper thing and was told I was connected. G
-
Populating the Signal Express Category on the Functions Palette
Hi Can anybody help with advice on how to populate the signal express category on the block diagram Functions palette ? Thanks Solved! Go to Solution. Attachments: LV Functions Palette.PNG 14 KB
-
White screen then restart at beginning of install.
Hi, I'm struggling with installing on my laptop (Acer Aspire 5532). After it completes loading "archiso.img" I get a white screen for about 3 seconds then a reboot, back to the original menu. I assumed, given that it was a white screen, that it was a
-
Error in function module for inbound processingwhile testing from we19
hi, I have developed a custom function module for processing inbound idoc for creating material using bdc...the problem is that when i am trying to test my idoc using we19 and calling my function module in debug mode an error is displayed showing 'in
-
I have a jpeg image of a particular area map which i need to load in my app using swing, is there a way to fire some event when clicked on specific areas on the jpeg image and then highlight that area. I have googled and tried various ways but still