Getting Web Server Path
I am trying to get web server path (currently it has been hard coded)
in ASP we have something like,
Server.Mappath()
do we have any command in Java to do that?
Thanks in advance
thanks.
but getRealPath() will work only with servlets.
i have a case where i shud get the path in applets,
and individual classes.
i know, we can pass params from Servlet to this individual classes, but
is there any other way to get the server path directly?
Similar Messages
-
Problems getting Web server to connect with LDAP server.
Have 4.1.8 iplanet Web and 4.13 LDAP running on Win2000 sp2. Both are working fine separately, i.e. 'have good anonymous LDAP://URL responses, and 'have working application CGI responses from web server. 'Have previously had same setup running on another server. However, with this install on win2000 cannot get Global settings LDAP feature to work ~ getting " An error occured while contacting th LDAP server. A connection to the the directory server could not be opened. Have checked DNS settings, etc. All seems to be in order. Any suggetions?
Hi,
What edition of Win 2K are you using (Pro/Server/Ad Server). The problem could be your DNS settings only.Ensure which machine is your DNS Server is running,is it on NT? if so change it to win 2K server.
Delete your LDAP machines A record from DNS server and add it again. This will solve your problem.
Refer the URL :
http://knowledgebase.iplanet.com/ikb/kb/articles/5135.html -
Can't get Web Server 7 listener to run on port 80
I'm replacing our older web server v6 servers with newer servers running web server 7u8. I can't get the listener to run on port 80 as a non-root user. I've run the usermod -K basic,net_privaddr command, and verified it in /etc/user_attr. When I try to start the instance, however, I get the following error "HTTP3127: http-listener-1: http://sun197d1z2.pseg.com:80: Error creating socket (No access rights)". If I change the listener to run on port 8080 the instance starts. Any ideas, what am I missing.
ThanksIs it necessary to run as a non-root user. If you start up webserver as root, the core processes will run as root, but the virtual server will run as a different user for security. Usually on Linux, that would be the user "nobody". You can also specify the user each virtual server should run as.
Hope that helps.
Tony Z -
Where to get web server 6.0 SP10?
It appears a service pack 10 for Web Server 6.0 was released recently. Any ideas where to dowload this?
Hi
It seems that it is in the process of being released. Also, they are expecting this to be released some time in next week. -
EA6300 Cannot get web server to work
Hi,
I have a Linksys AE6300 router.
I have a webserver set up with IIS to use port 780 for an HTTP site.
It works when I use the internal IP http://192.168.1.150:780
But, not when I use the external one.
This is a new router so, I never had this working on this particular router before. (but, my old router worked fine - was able to view website using external IP).
I tried using both the Single and Port Range forwarding. (My old router used port range).
Here is my Single Port forwarding setup...
And my Basic Firewall settings
I also re-booted the router. But, still cannot view website. (unavailable).
What more should I be doing? Or what am I doing wrong?Thank you for the information.
1 - I unchecked 'Filter Anonymous Internet Requests'
2 - I did the following in port range forwarding.
3 - I did a full powercycle
4 - I tried to access the external IP address using port 780 -- xxxx.xxxx.xxxx.xxxx:780
Still got 'Webpage is not available'
Error code: ERR_CONNECTION_ABORTED
I went to the site http://www.whatsmyip.org/port-scanner/server/
And noticed that port 80 is closed. (as apposed to 'Timeout (Blocked)'
Port 780 is open.
after trying access the webpage (using port 780) ... this is all that was in my linksys log :
Incoming log
Source IP address | Destination port number
Outgoing log
LAN IP address | Destination URL or IP address | Service or port number
192.168.1.108 66.161.xx.xx www
192.168.1.108 173.255.xx.xx https
192.168.1.108 66.161.xx.xx www
192.168.1.108 54.249.xx.xx https
192.168.1.108 216.219.xx.xx https
192.168.1.108 67.217.xx.xx https
192.168.1.108 216.115.xx.xx https
Security log
LAN IP address | MAC address | Timestamp | Authentication result
192.168.1.108 74:2F:68:79:.... 2013-09-30T22:39:19Z Successful
192.168.1.108 74:2F:68:79:.... 2013-09-30T22:38:42Z Successful
DHCP client log
LAN IP address | MAC address | Timestamp | Message type
The external IP address I have is not listed at all anywhere.
Any advice would be appreciated.
NOTE: My isp is Road Runner (Through Time Warner).
Thank you again for your attention. -
Server path in onMessage method
Hi,
getServletContext().getRealPath("./") in Servlet will give the server path of the current web application.
Similarly how to get the server path in onMessage method of Message Driven Bean ?
I have a xml from database. Need to access a xsl in WL server and create a html and then write this html to a flat file. I need to do all this in onMessage method. So, now to access the xsl file i need the server path.
Your help is greatly appreciated.
Thanks in Advance,
AnithaHey Anitha,
Here is a sample that maybe useful.
URL url = (new TestClass()).getClass().getResource(name);
String absPath = url.getFile()Where new TestClass() is the classname where this code goes and fits. The name is a relative path to retrive the xsl file or any other stuff u like. -
How to enable fastcgi on sun one web server 6.1 SP6
Hi, all
I fail to install fastcgi on sun one web server 6.1 SP6. When i access php page, the following errors are displayed in error log.
[18/Oct/2006:14:08:45] failure (21781): for host x.x.x.x trying to GET /chkwww.php, responder-fastcgi reports: FCGI1062: Stat failure
[18/Oct/2006:14:08:45] failure (21781): for host x.x.x.x trying to GET /chkwww.php, responder-fastcgi reports: FCGI1073: Unable to service the request even after trying 0 times
The following is the environment:
Web Server path: /i03_01/SUNWebSP6
PHP 4.4.2 installation path: /i03_01/php-fcgi
PHP library path: /i03_01/php-lib
PHP configuration: ./configure prefix=/i03_01/php-fcgi enable-fastcgi with-mysql=/i03_01/tmp/mysql-standard-4.1.12-sun-solaris2.8-sparc enable-mbstring=all enable-mbregex enable-exif with-gd with-png-dir=/i03_01/php-lib with-zlib-dir=/i03_01/php-lib with-jpeg-dir=/i03_01/php-lib with-t1lib=/i03_01/php-lib with-freetype-dir=/i03_01/php-lib
libfastcgi.so path: /i03_01/SUNWebSP6/bin
The following is my configuration:
In mime.types, add this line at the bottom:
type=magnus-internal/fastcgi exts=php,php3,php4
In magnus.conf, add this line at the bottom:
Init fn=load-modules shlib="/i03_01/SUNWebSP6/bin/libfastcgi.so"
In obj.conf, add these lines at the top.
<Object name="default">
Service type="magnus-internal/fastcgi"
fn="responder-fastcgi"
app-path="/i03_01/php-fcgi/bin/php"
min-procs="1"
app-env="PHP_FCGI_CHILDREN=1"
app-env="PHP_FCGI_MAX_REQUEST=200"
app-env="PHPRC=/i03_01/SUNWebSP6/https-www/config"
</Object>
Anyone can help me? Thanks.
Message was edited by:
polyuitjerryStat failure is caused when either Fastcgistub or app-path is not accessible.
Is "Fastcgistub" executable too in /i03_01/SUNWebSP6/bin directory ? If not, then copy it to that directory. Make sure it has exec permission.
Do you see Fastcgistub process ? If yes, then check the app-path (/i03_01/php-fcgi/bin/php). Is it accessible ?
And also, check "Fastcgistub.log" file under <webserver-temp-dir> directory for any error msgs. -
I have just installed "APOD Grabber". When launched, I get " Web server returns error 64". Can anyone help?
Thanks,Hi jfw222
Welcome to Apple Support Communities
What version and where did you download it from? Cause I just downloaded APOD Grabber 1.3.5 from MacUpdade and it is working fine.
http://www.macupdate.com/app/mac/12461/apod-grabber/
Hey' that's pretty cool, generally I visit the Hubble site and download images from the Gallery and then put them into iPhoto for Desktop backgrounds, slideshows and such. > http://hubblesite.org/
Dennis -
Getting web host name, web-port, oral-report server name and virtual path
Hi.
I have been using oralce forms 6i on oracle application server 10g. I have three servers installed on remote locations.I just want that when i am hosting an application on a server, the web host name, web port , oracle report server name and the path of directory should be selected in a dynaminc variable at application level at run time. In this manner, I will be able to make a single application for all three servers. Any other solution to this problem is also welcomed. Please help anyone and oblige me.Hi Rajesh,
Actually Web AS Host name is <Servername>.<domain name>:<Port no>
Web AS Path for R/3 is </sap/bc/bsp/sapd>
Refer the following link.
<a href="https://forums.sdn.sap.com/thread.jspa?threadID=402561">https://forums.sdn.sap.com/thread.jspa?threadID=402561</a>
<a href="https://www.sdn.sap.com/irj/sdn/thread?threadID=265076">https://www.sdn.sap.com/irj/sdn/thread?threadID=265076</a>
Regards
Hemalatha
/Assign points if helpful/ -
How to get the physical path of my web app root context ?
Hi,
I used this code to initialize my LOG4J logger.
System.out.println(Version + "Servlet context path : " + sctx .getContextPath());
String path = sctx .getRealPath("/");
fullyqualifiedlog4jpath = path + "log4j.xml";
File locallogxml = new File(fullyqualifiedlog4jpath);
if (locallogxml.exists()) {
initialized = true;
DOMConfigurator.configure(fullyqualifiedlog4jpath);
log = Logger.getLogger(Log4j.class.getName());
log.info(Version + "Logger initialized");
else {
System.out.println(Version + "Unable to locate the log4j.xml file");
}It works perfectly when running the application with the embedded Jdev11 WLS.
When deploying the application on a standalone WLS server the path is not returned ;-( I get a null value.
Does someone has three lines of code which get the physical path of my web app root context?
YvesChanged the methiod used to access log4j.xml.
FacesContext ctx = FacesContext.getCurrentInstance();
ServletContext sctx = (ServletContext) ctx.getExternalContext().getContext();
String contextPath = sctx.getContextPath();
HttpServletRequest hsr = (HttpServletRequest)ctx.getExternalContext().getRequest();
String host = hsr.getServerName();
int port = hsr.getServerPort();
try
String urlstring = "http://" + host + ":" + port + contextPath + "/faces/log4j.xml";
DOMConfigurator.configure(new URL(urlstring));
log = Logger.getLogger(Log4j.class.getName());
.....using the URL s OK. -
How do you get Sun One Web Server to read white spacing in a url
Hi guys,
I am currently using Sun One Web Server and this is the problem that i am currently facing.
The url which is i am trying to read from the Sun One Web Server is http://test:8000/test/Testing%20A%20B
The error which i am getting is java.lang.RuntimeException: java.net.URISyntaxException: Illegal character in path
The reason why this is happening is because the original url is http://test:8000/test/Testing A B It has spacing in between the url. I cannot get rid of the spacing thru the code where its bound to a Content Management System. So the only way is to get the Sun One Web Server to be able to read this kind of url. There are about 300 to 400 of this types of url as they are dynamically generated.
I was looking at the obj.conf and magnum.conf file to see whether i can manipulate this url to work for this situation. But with no luck.
Can anyone please let me know if they have came across this problem.
Thanks.Hi,
This is the stack Trace:
Error 500--Internal Server Error
java.lang.RuntimeException: java.net.URISyntaxException: Illegal character in path at index 29: /models/Sportwagon/Sportwagon SS V-Series
at au.com.holden.cs.assembler.FriendlyURLAssembler.getInputURI(FriendlyURLAssembler.java:329)
at au.com.holden.web.mvc.ViewUtil.getInputModelAndView(ViewUtil.java:29)
at au.com.holden.web.mvc.navigation.ModelNavigationController.handleNoSuchRequestHandlingMethod(ModelNavigationController.java:17)
at org.springframework.web.servlet.mvc.multiaction.MultiActionController.handleRequestInternal(MultiActionController.java:375)
at org.springframework.web.servlet.mvc.AbstractController.handleRequest(AbstractController.java:153)
at org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:45)
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:820)
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:755)
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:396)
at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:350)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:292)
at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42)
at weblogic.servlet.internal.RequestEventsFilter.doFilter(RequestEventsFilter.java:27)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3496)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(Unknown Source)
at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2180)
at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2086)
at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1406)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
Caused by: java.net.URISyntaxException: Illegal character in path at index 29: /models/Sportwagon/Sportwagon SS V-Series
at java.net.URI$Parser.fail(URI.java:2809)
at java.net.URI$Parser.checkChars(URI.java:2982)
at java.net.URI$Parser.parseHierarchical(URI.java:3066)
at java.net.URI$Parser.parse(URI.java:3024)
at java.net.URI.(URI.java:578)
at au.com.holden.cs.assembler.FriendlyURLAssembler.getInputURI(FriendlyURLAssembler.java:326)
... 26 more
This is the path which was access by me using Sun One Web Server: http://poll:8006/models/Sportwagon/Sportwagon%20SS%20V-Series
As you can see that Sun One Web Server dont like spacing between url.
Does anyone know how to fix this problem thru configuration in Sun One Web Server? -
From binaries.
1. I was able to get the command line execution of 01.php to work with php w/o
Apache.
2. I am able to get normal PHP to work in Apache and I'm able to load up some php
extensions that come with PHP such as php_zip.dll
which show up as loaded when I execute this php script via the Apache Web server:
<?php
phpinfo();
?>
3. I've tried both the CGI method and the apache module method of linking apache to PHP, but
still get the same following error in my Apache error logs.
PHP Warning: PHP Startup: Unable to load dynamic library 'C:/Progra~1/Oracle/Berkeley DB XML 2.4.16/bin\\php_db4.dll' - The specified module could not be found.\r\n in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library 'C:/Progra~1/Oracle/Berkeley DB XML 2.4.16/bin\\php_dbxml.dll' - The specified module could not be found.\r\n in Unknown on line 0
4. I've tried to move these two dlls to the /ext directory as well, but no joy.
5. What confuses me is that it works on the command line, but not through Apache.
Since they work on the command line, the dlls are proper dlls, correct?
What could be causing them not to work from Apache?
6. In my google searching on other php dlls, there are references that certain php dlls are dependent upon other dlls to be in the path. Does anyone know if there are any other dependecies for two dlls in question? And is it that php command line can find these dlls, but when apache starts up, it doesn't have access to these other dependent dlls?
7. Anyone have any insight, suggestions into this? Behavior?I think 5.2.10 has mainly bug fixes in comparison to 5.2.5. If it works, I'd simply assume everything's fine.
Be aware, though, that there is a general caveat with using DBXML in an Apache/PHP environment. You cannot maintain state at the application level as with a Java application server. On each request, you'll have to reopen the environment and the containers you want to access. So it's not as effiicient as on a more suitable platform. Also, if the need to run recovery arises, it is not clear how you would handle this in a multi-process environment with no built-in means for coordination of those processes.
Michael Ludwig -
How to set the servlet context path manually in Tomcat web server.
I tested some servlets by putting them in the folder , which the tomcats examples application uses (ie Tomcat 4.1\webapps\examples\WEB-INF\classes\) and it appeared to be working fine.
I was calling the servlet like this : http://localhost:2006/examples/servlet/TestServlet
But when I installed my own WAR file in the server , the servlet is not working now. now the new location of my servlets is : Tomcat 4.1\webapps\MyApp\WEB-INF\classes\
and I'm trying to call the servlet like this : http://localhost:2006/MyApp/servlet/TestServlet
The error , what i'm getting is :
description :The requested resource (/MyApp/servlet/TestServlet) is not available.
Some body please tell where I'm making the mistake ? I believe this may have something to do with the servlet context path setting. If anybody has any idea , how to set the path..will be much appreciated.Thanx for your reply , at first I was not using any web.xml(since not mandatory) but even after using the web.xml file the error is coming . Please have a look into the contents of the web.xml file and let me know if you find any problem...
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE web-app
PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
"http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app>
<servlet>
<servlet-name>TestServlet</servlet-name>
<servlet-class>TestServlet</servlet-class>
</servlet>
</web-app>
one more thing I would like to tell you here. I was just looking into the configuration of Iplanet web server..I found that , there are options to set the servlet container path (like : - Prefix: /servlet
Servlet Directory: /ecomm/iplanet/nes60/product/docs/container )
so from here I came to know that "container " is the folder where we should put our servlets and it has URI as "servlet" but yet I'm not able to find any option in the Tomcat Web server to set the servlet container to any different directory.
If you have any idea please let me know. -
Hi, I am using HP11 and iPlanet web server. When trying to upload files over HTTP using FORM ENCTYPE="multipart/form-data" that are bigger than a few Kilobytes i get a 408 error. (client timeout). It is as if the server has decided that the client has timed out during the file upload. The default setting is 30 seconds for AcceptTimeout in the magnus.conf file. This should be ample to get the file across, even increasing this to 2 minutes just produces the same error after 2 minutes. Any help appreciated. Apologies if this is not the correct forum for this, I couldn't see one for iPlanet and Web, many thanks, Kieran.
Hi,
You didnt mention which version of IWS. follow these steps.
(1)Goto Web Server Administration Server, select the server you want to manage.
(2)Select Preference >> Perfomance Tuning.
(3)set HTTP Persistent Connection Timeout to your choice (eg 180 sec for three minutes)
(4) Apply changes and restart the server.
*Setting the timeout to a lower value, however, may prevent the transfer of large files as timeout does not refer to the time that the connection has been idle. For example, if you are using a 2400 baud modem, and the request timeout is set to 180 seconds, then the maximum file size that can be transferred before the connection is closed is 432000 bits (2400 multiplied by 180)
Regards
T.Raghulan
[email protected] -
How can I get the server absolute path of virtual directory?
Problem context:
absolute path of my application at JRUN server is
c:\testing
nd url is
http://kaspak/test
( kaspak is a machine local to server i-e client nd server r at same machine )
I m uploading a file nd saving it at server.
PROBLEM:
server save my uploaded file at
C:\Program Files\Allaire\JRun\servers\default
[ a path where server is installed ]
while I want to save it at directory
c:\testing\uploadfiles
How can I achieve this???
waiting for quick reply..
KasPakhere is a function for which u said,
protected void readAndSaveFile(MultipartInputStreamHandler in,
String boundary,
String filename,
String contentType) throws IOException
A utility method that reads a single part of the multipart request that represents a file, and saves the file to the given directory. A subclass can override this method for a better optimized or differently behaved implementation.
again saving a file, or uploading a file is no problem,
but saving a file at our desired location,
nd this can only be done if we know reall/absolute path of our application at server,
i-e we need an API which can tells the absolute path of our application.
e.g
our application url is http://kaspak/testcode
we need its absolute mapping to directory on server
e.g it it is at c:\testcode
if we get the absolute path then we can pass it in above function or in File class constructor.
isn't it??
I think in this way i can save file at other location.
But how i can get absolute path?????
thanks for ur reply,
nd waiting for ur reply again.
wbw
kaspak
Maybe you are looking for
-
Urgent: getting error while pressing SAVE button on final grid screen
Hi ABAPers, please help me to sort this problem, i want to save the records selected by the user to database table. but when i m pressing save on o/p grid screen its giving error as GETWA_NOT_ASSIGNED. This is my code TABLES: plaf, mara
-
Owerbook g4 not starting up after new hard drive and software update
Hello, I know that there are several postings that are similliar to this query, but none have answered my question. I have a Powerbook g4 15 inch 1.67/1.5 Ghz with 1 gig of Ram. A few months ago I suddenly found myself unable to log into my computer
-
Hi , I am new to SAP XI area, I was trying to post one xml document from one service(Gentran Integration Suite) to SAP XI. I have correct URV which i used in my buisness process model . When i try that URI in my browser and enter user name and pas
-
HOW TO CREATE FORMATTED SEARCH ?????
HOW TO CREATE FORMATTED SEARCH ?? ANYONE KNOWS PLESE EXPLAIN???? Regards, Vinayak
-
hi, how can we call a webservice in an CDC application.i believe that it can be done through jsr172 implementation(j2me-ws.jar) . but it seems to work only with J2me Wireless ToolKit midlets.i tried to copy the stubs generated by the ToolKit and adde