Search Results

Search found 2680 results on 108 pages for 'soft 404'.

Page 86/108 | < Previous Page | 82 83 84 85 86 87 88 89 90 91 92 93  | Next Page >

  • php: autoload exception handling.

    - by YuriKolovsky
    Hello again, I'm extending my previous question (Handling exceptions within exception handle) to address my bad coding practice. I'm trying to delegate autoload errors to a exception handler. <?php function __autoload($class_name) { $file = $class_name.'.php'; try { if (file_exists($file)) { include $file; }else{ throw new loadException("File $file is missing"); } if(!class_exists($class_name,false)){ throw new loadException("Class $class_name missing in $file"); } }catch(loadException $e){ header("HTTP/1.0 500 Internal Server Error"); $e->loadErrorPage('500'); exit; } return true; } class loadException extends Exception { public function __toString() { return get_class($this) . " in {$this->file}({$this->line})".PHP_EOL ."'{$this->message}'".PHP_EOL . "{$this->getTraceAsString()}"; } public function loadErrorPage($code){ try { $page = new pageClass(); echo $page->showPage($code); }catch(Exception $e){ echo 'fatal error: ', $code; } } } $test = new testClass(); ?> the above script is supposed to load a 404 page if the testClass.php file is missing, and it works fine, UNLESS the pageClass.php file is missing as well, in which case I see a "Fatal error: Class 'pageClass' not found in D:\xampp\htdocs\Test\PHP\errorhandle\index.php on line 29" instead of the "fatal error: 500" message I do not want to add a try/catch block to each and every class autoload (object creation), so i tried this. What is the proper way of handling this?

    Read the article

  • Decompiling an old Program

    - by Pedro Laranjeiro
    Hi. I have been asked to update a program written in 1987 in Delphi (I guess). I have no documentation about this program only a few side notes the programmer took that don't make too much sense to make. The cd show this files: Size | Filename - 19956 VP.DTA - 142300 VP.LEX - 404 VP.NDX - 126502 VP.RCS - 131016 VP.SCR - 150067 VP.XEL - 101791 vp.exe Is anyone of this files a database? If so can I access it's data? I tried several code decompilers but they show a message saying it was not a Win32 compatible application. The program run in MS-DOS. Is it possible to obtain the source code? Can I use this code in any way to build a new application? Thanks Update01: I can run the program in MSDOS. The program conjugate verbs and shows an example sentence where the verb can be used. The GUI is a little bit confusing and there is no help menu so I can't see all the capabilities of the program.

    Read the article

  • ASP.NET MVC 2.0 + Implementation of a IRouteHandler goes not fire

    - by Peter
    Can anybody please help me with this as I have no idea why public IHttpHandler GetHttpHandler(RequestContext requestContext) is not executing. In my Global.asax.cs I have public class MvcApplication : System.Web.HttpApplication { public static void RegisterRoutes(RouteCollection routes) { routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); routes.MapRoute( "Default", // Route name "{controller}/{action}/{id}", // URL with parameters new { controller = "Home", action = "Index", id = "" } // Parameter defaults ); routes.Add("ImageRoutes", new Route("Images/{filename}", new CustomRouteHandler())); } protected void Application_Start() { RegisterRoutes(RouteTable.Routes); } } //CustomRouteHandler implementation is below public class CustomRouteHandler : IRouteHandler { public IHttpHandler GetHttpHandler(RequestContext requestContext) { // IF I SET A BREAK POINT HERE IT DOES NOT HIT FOR SOME REASON. string filename = requestContext.RouteData.Values["filename"] as string; if (string.IsNullOrEmpty(filename)) { // return a 404 HttpHandler here } else { requestContext.HttpContext.Response.Clear(); requestContext.HttpContext.Response.ContentType = GetContentType(requestContext.HttpContext.Request.Url.ToString()); // find physical path to image here. string filepath = requestContext.HttpContext.Server.MapPath("~/logo.jpg"); requestContext.HttpContext.Response.WriteFile(filepath); requestContext.HttpContext.Response.End(); } return null; } } Can any body tell me what I'm missing here. Simply public IHttpHandler GetHttpHandler(RequestContext requestContext) does not fire. I havn't change anything in the web.config either. What I'm missing here? Please help.

    Read the article

  • Django URL Conf Returns Incorrect "Current URL"

    - by natnit
    I have a django app that is mostly done, and the URLs work perfectly when I run it with the manage.py runserver command. However, I've recently tried to get it running via lighttpd, and many links have stopped working. For example: http://mysite.com/races/32 should work, but instead throws this error message. Page not found (404) Request Method: GET Request URL: http://mysite.com/races/32 Using the URLconf defined in racetrack.urls, Django tried these URL patterns, in this order: ^admin/ ^create/$ ^races/$ ^races/(?P<race_id>\d+)/$ ^races/(?P<race_id>\d+)/manage/$ ^races/(?P<text>\w+)/$ ^user/(?P<kol_id>\d+)/$ ^$ ^login/$ ^logout/$ The current URL, 32, didn't match any of these. The request URL is accurate, but the last line (which displays the current URL) is giving 32 instead of races/32 as expected. Here is my urlconf: from django.conf.urls.defaults import * from django.contrib import admin admin.autodiscover() urlpatterns = patterns('racetrack.races.views', (r'^admin/', include(admin.site.urls)), (r'^create/$', 'create'), (r'^races/$', 'index'), (r'^races/(?P<race_id>\d+)/$', 'detail'), (r'^races/(?P<race_id>\d+)/manage/$', 'manage'), (r'^races/(?P<text>\w+)/$', 'index'), (r'^user/(?P<kol_id>\d+)/$', 'user'), # temporary for index page replace with welcome page (r'^$', 'index'), ) urlpatterns += patterns('django.contrib.auth.views', (r'^login/$', 'login', {'template_name': 'races/login.html'}), (r'^logout/$', 'logout', {'next_page': '/'}), ) Thank you.

    Read the article

  • javax.xml.ws.soap.SOAPFaultException: Could not send Message - at JaxWsClientProxy.invoke - caused by HTTP response code: 401 for URL

    - by Mikkis
    I moved a working code from dev to test and encountered the following error(s) in test: javax.xml.ws.soap.SOAPFaultException: Could not send Message. at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:143) ...... at org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:64) at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:236) at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:472) at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:302) at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:254) at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:73) at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:123) at $Proxy739.copyIntoItems(Unknown Source) Caused by: java.io.IOException: Server returned HTTP response code: 401 for URL: http:///_vti_bin/Copy.asmx at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1436) at java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:379) at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponseInternal(HTTPConduit.java:2046) Environment specs: Java 1.6 Tomcat 6 Eclipse Helios Maven2 CXF 2.2.3 As a background work, tried to explore about the error in similar category bad URL (ruled out as i am using same URL in dev and test. and the url, userid, password are all accessible from both the machines), connection timeout( error is not 404 or it doesnt specify connection timed out... it says 401 response code for url) Checked if all the jars and same versions are included in the test environment. Can someone shed some light to understand and resolve the error? please let me know if any more details are to be included.

    Read the article

  • Javascript and jQuery (Fancybox) question

    - by songdogtech
    Javascript and jQuery (Fancybox) question I'm using the Javascript function below for Twitter sharing (as well as other services; the function code is simplified to just Twitter for this question) that grabs the to-be-shared page URL and title and it is invoked in the link with onclick. That results in the Twitter share page loading in a pop up browser window, i.e.<img src="/images/twitter_16.png" onclick="share.tw()" /> In order to be consistent with other design aspects of the site, what I'd like to be able to do is have the Twitter share page open not in a standard browser window but in a Fancybox (jQuery) window. Fancybox can load an external page in an iFrame when the img or href link contains a class (in this case class="iframe" ) in the link and in the document ready function in the header. Right now, of course, when I give the iframe class to the link that also has the onclick share.tw(), I get two popups: one browser window popup with the correct Twitter share page loaded, and a Fancybox jQuery popup that shows a site 404. How can I change the function to use Fancybox to present the Twitter share page? Is that a correct way to approach it? Or is there a better way, such as implementing the share function in jQuery, too? Thanks... Javascript share function: var share = { tw:function(title,url) { this.share('http://twitter.com/home?status=##URL##+##TITLE##',title,url); }, share:function(tpl,title,url) { if(!url) url = encodeURIComponent(window.location); if(!title) title = encodeURIComponent(document.title); tpl = tpl.replace("##URL##",url); tpl = tpl.replace("##TITLE##",title); window.open(tpl,"sharewindow"+tpl.substr(6,15),"width=640,height=480"); } }; It is invoked, i.e.: <img src="/images/twitter_16.png" onclick="share.tw()" /> Fancybox function, invoked by adding class="iframe" in the img or href link $(".iframe").fancybox({ 'width' : '100%', 'height' : '100%', 'autoScale' : false, 'transitionIn' : 'none', 'transitionOut' : 'none', 'type' : 'iframe' });

    Read the article

  • Why would paperclip not assign an ID to my uploaded photos?

    - by Trip
    I just deployed to a cluster server, and my delayed_jobs recipe was overwritten in the process. I solved that, delayed_jobs is up and running but can't find the ID of images that are uploaded. The images are saved correctly : Processing PhotosController#create (for 173.161.167.41 at 2010-06-01 05:09:14) [POST] Parameters: {"Filename"="1.jpg", "gallery_id"="1298", "action"="create", "amp"=nil, "authenticity_token"="qmbnpwFY8a5E3YtS/4fMWF/Z8evCE4hMxqKVJw0I7Ek=", "Upload"="Submit Query", "controller"="photos", "organization_id"="470", "_hq_channel_session"="BAh7CSIYdXNlcl9jcmVkZW50aWFsc19pZGkHIhV1c2VyX2NyZWRlbnRpYWxzIgGAOGRlZDc0NGJlOWU3NTNlNDFlYmVlMDdjMzIzYjA1ZjQxNGE5ZDY4YjNmYjFmNjNkMDQ2OWY2ZDQyOTljZDhiMDFlNmRkMDljNThmMzBmOWJhMTIwNDhkMDI5MTMxYmU5MDczYjIxZmI4YmQxMDVlMTBmNjZmOWFhODE1ZTBjMGM6EF9jc3JmX3Rva2VuIjFxbWJucHdGWThhNUUzWXRTLzRmTVdGL1o4ZXZDRTRoTXhxS1ZKdzBJN0VrPToPc2Vzc2lvbl9pZCIlMjAwMDQ3ZDQ3ZWUyZTgzODIxYzdjOGI3OTdmZGJiMDM=--ac6aa580262938bf5a4d6b9a740722b680eb5d48", "Filedata"=#} [paperclip] Saving attachments. [paperclip] saving /data/HQ_Channel/releases/20100530153454/public/system/photos/9253/original/1.jpg [paperclip] Saving attachments. [paperclip] Saving attachments. Completed in 127ms (View: 2, DB: 91) | 200 OK [http://invent.hqchannel.com/organizations/470/media/galleries/1298/photos?_hq_channel_session=BAh7CSIYdXNlcl9jcmVkZW50aWFsc19pZGkHIhV1c2VyX2NyZWRlbnRpYWxzIgGAOGRlZDc0NGJlOWU3NTNlNDFlYmVlMDdjMzIzYjA1ZjQxNGE5ZDY4YjNmYjFmNjNkMDQ2OWY2ZDQyOTljZDhiMDFlNmRkMDljNThmMzBmOWJhMTIwNDhkMDI5MTMxYmU5MDczYjIxZmI4YmQxMDVlMTBmNjZmOWFhODE1ZTBjMGM6EF9jc3JmX3Rva2VuIjFxbWJucHdGWThhNUUzWXRTLzRmTVdGL1o4ZXZDRTRoTXhxS1ZKdzBJN0VrPToPc2Vzc2lvbl9pZCIlMjAwMDQ3ZDQ3ZWUyZTgzODIxYzdjOGI3OTdmZGJiMDM%3D--ac6aa580262938bf5a4d6b9a740722b680eb5d48&authenticity_token=qmbnpwFY8a5E3YtS%2F4fMWF%2FZ8evCE4hMxqKVJw0I7Ek%3D] And then delayed_jobs keeps spinning around in circles on this one : 2010-06-01T05:09:02-0700: * [Worker(delayed_job host:ip-10-251-197-159 pid:19994)] acquired lock on PhotoJob 2010-06-01T05:09:02-0700: * [JOB] delayed_job host:ip-10-251-197-159 pid:19994 failed with ActiveRecord::RecordNotFound: Couldn't find Photo with ID=9247 - 0 failed attempts 2010-06-01T05:09:02-0700: * [Worker(delayed_job host:ip-10-251-197-159 pid:19994)] acquired lock on PhotoJob 2010-06-01T05:09:02-0700: * [JOB] delayed_job host:ip-10-251-197-159 pid:19994 failed with ActiveRecord::RecordNotFound: Couldn't find Photo with ID=9245 - 0 failed attempts 2010-06-01T05:09:02-0700: * [Worker(delayed_job host:ip-10-251-197-159 pid:19994)] acquired lock on PhotoJob So what I get is that the photos are not being assigned ID's by paperclip. Anyone know where I could poke and pry from here? UPDATE: I created a clone application on a single server. And there are no problems. The images on the cluster do show up (occassionally). If I keep clicking on the folders that lead to photos, it will 50% of the time return a 404 with it not being able to find the photo, and the other half it will present the photo. So the problem has got to be with the server interaction between the ActiveRecord through multiple servers.

    Read the article

  • Perl 500 internal server error. Something wrong with my code.

    - by Nitish
    I get a 500 internal server error when I try to run the code below in a web server which supports perl: #! /usr/bin/perl use LWP; my $ua = LWP::UserAgent->new; $ua->agent("TestApp/0.1 "); $ua->env_proxy(); my $req = HTTP::Request->new(POST => 'http://www.google.com/loc/json'); $req->content_type('application/jsonrequest'); $req->content('{ "cell_towers": [{"location_area_code": "55000", "mobile_network_code": "95", "cell_id": "20491", "mobile_country_code": "404"}], "version": "1.1.0", "request_address": "true"}'); my $res = $ua->request($req); if ($res->is_success) { print $res->content,"\n"; } else { print $res->status_line, "\n"; return undef; } But there is no error when I run the code below: #! /usr/bin/perl use CGI::Carp qw(fatalsToBrowser); print "Content-type: text/html\n\n"; print "<HTML>\n"; print "<HEAD><TITLE>Hello World!</TITLE></HEAD>\n"; print "<BODY>\n"; print "<H2>Hello World!</H2> <br /> \n"; foreach $key (sort keys(%ENV)) { print "$key = $ENV{$key}<p>" ; } print "</BODY>\n"; print "</HTML>\n"; So I think there is some problem with my code. When I run the first perl script in my local machine with the -wc command, it says that the syntax is OK. Help me please.

    Read the article

  • Using tarantula to test a Rails app

    - by Benjamin Oakes
    I'm using Tarantula to test a Rails app I'm developing. It works pretty well, but I'm getting some strange 404s. After looking into it, Tarantula is following DELETE requests (destroy actions on controllers) throughout my app when it tests. Since Tarantula gets the index action first (and seems to keep a list of unvisited URLs), it eventually tries to follow a link to a resource which it had deleted... and gets a 404. Tarantula is right that the URL doesn't exist anymore (because it deleted the resource itself). However, it's flagging it as an error -- that's hardly the behavior I would expect. I'm basically just using the Rails scaffolding and this problem is happening. How do I prevent Tarantula doing this? (Or, is there a better way of specifying the links?) Updates: Still searching, but I found a relevant thread here: http://github.com/relevance/tarantula/issues#issue/3 Seems to be coming from relying on JS too much, in a way (see also http://thelucid.com/2010/03/15/rails-can-we-please-have-a-delete-action-by-default/)

    Read the article

  • ASP.NET MVC 2 - Custom route doesn't find controller action

    - by mcfroob
    For some reason my application isn't routing to my controller method correctly. I have a routelink like this in my webpage - <%= Html.RouteLink("View", "Blog", new { id=(item.BlogId), slug=(item.Slug) }) %> In global.asax.cs I have the following routes - routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); routes.MapRoute( "MoreBlogs", "Blog/Page/{page}", new { controller = "Blog", action = "Index" } ); routes.MapRoute( "Blog", "Blog/View/{id}/{slug}", new { controller = "Blog", action = "View"} ); routes.MapRoute( "Default", // Route name "{controller}/{action}/{id}", // URL with parameters new { controller = "Blog", action = "Index", id = UrlParameter.Optional } // Parameter defaults ); And then I have a class BlogController that has a method - public ActionResult View(int id, string slug) { ... etc. } I put a breakpoint in the first line of the View method but it's not getting hit at all. I checked with a route debugger for the format localhost/Blog/View/1/test and it matched my custom route. All I'm getting is a 404 while running this, I can't work out why the route won't post to the view method in my controller - any ideas?

    Read the article

  • Multiple webroot folders with Jetty

    - by Lóránt Pintér
    I'm using Jetty (version 6.1.22) to service a Java web application. I would like to make Jetty look in two different folders for web resources. Take this layout: +- project1 | +- src | +- main | +- webapp | +- first.jsp | +- project2 +- src +- main +- webapp +- second.jsp I would like to make Jetty serve both URLs: http://localhost/web/first.jsp http://localhost/web/second.jsp I tried starting Jetty like this: Server server = new Server(); SocketConnector connector = new SocketConnector(); connector.setPort(80); server.setConnectors(new Connector[] { connector }); WebAppContext contextWeb1 = new WebAppContext(); contextWeb1.setContextPath("/web"); contextWeb1.setWar("project1/src/main/webapp"); server.addHandler(contextWeb1); WebAppContext contextWeb2 = new WebAppContext(); contextWeb2.setContextPath("/web"); contextWeb2.setWar("project2/src/main/webapp"); server.addHandler(contextWeb2); server.start(); But it only serves first.jsp, and it returns 404 for second.jsp. How can I get this to work?

    Read the article

  • Ruby on Rails: Uploading a modifed site.

    - by Califer
    I'm having a heck of a time getting a site I modified to work correctly. I didn't set the site up originally, and since the person that set it up no longer works with me I had to learn ruby just to make some changes. I made all the changes in the development server and everything worked fine. Then I did a diff on the production and development and moved only my changes over. Unfortunately when I loaded my changes onto the production server I got a lot of errors. I've changed all of the permissions to 755, which took care being able to access anything at all, but after that I started getting a lot of 500 errors. Nothing showed up in the production.log file. I really have no clue what's going wrong except that perhaps things are not noticing the new changes. I moved the old site to a backup folder, and the new site crashes whenever it goes to anything that I've changed. In particular, I added a link to a new setup with an extra controller/model/view group. It works fine on development but in production it gives me a 404. Yes, I did copy all the files up. I even put everything back how it was, but the website is still showing the broken version of it. I checked the tmp/cache folder but it was empty. Running dispatch.fcgi shows the old site (which I expected) but it still shows the flawed new site when I connect through a browser. I've been tearing my hair out trying to get this to work. Any ideas as to how I can get this to work?

    Read the article

  • Apache mod_rewrite - forward domain root to subdirectory

    - by DuFace
    I have what I originally assumed to be a simple problem. I am using shared hosting for my website (so I don't have access to the Apache configuration) and have only been given a single folder to store all my content in. This is all well and good but it means that all my subdomains must have their virtual document root's inside public_html, meaning they effectively become a folder on my main domain. What I'd like to do is organise my public_html something like this: public_html/ www/ index.php ... sub1/ index.php ... some_library/ ... This way, all my web content is still in public_html but only a small fraction of it will be served to the client. I can easily achieve this for all the subdomains, but it's the primary domain that I'm having issues with. I created a .htaccess file in public_html with the following: Options +SymLinksIfOwnerMatch # I'm not allowed to use FollowSymLinks RewriteEngine on RewriteBase / RewriteCond %{REQUEST_URI} !^/www [NC] RewriteRule ^(.*)$ /www/$1 [L] This works fairly well, but for some strange reason www.example.com/stuff is translated into a request for www.example.com/www/stuff and hence a 404 error is given. It was my understanding that unless an 'R' flag was specified, mod_rewrite was purely internal so I can't understand why the request is generated as that implies (to me at least) redirection. I assumed this would be a trivial problem to solve as all I actually want to do is forward all requests for the root of www.example.com to a subdirectory, but I've spent hours searching for answers and none are quite correct. I find it difficult to believe I'm the only person to have this issue. I apologise if this question has been answered on here before, I did search and trawl but couldn't find an appropriate answer. Please could someone shed some light on this?

    Read the article

  • UI - How I can make users effectively read what my program says?

    - by Magnetic_dud
    I have a simple form that searches through the 2000+ issues of a 3rd party webcomic. (Easy, it's like xkcd: http://url/number That form is as easy as possible, is like this: What number do you want? User writes a number, clicks ok, and goes on the 3rd party website on a new tab Then, my form asks a question: "Did you find that issue memorable? Enter the name here, and we will add it to the "best issues" in home page" When the user will write the name of the issue, it is added to the database (pending moderation by me) So, I supposed this design is the easiest and convenient that users can find. Unfortunately, NONE of the users (maybe a 2% behaved correctly) will actually read what I asked. Some of the issues are offline, and gives a 404. On that issues users will write in the textbox a completely wrong title, and correctly capitalized! It's like if i would name http://xkcd.com/627/ as "The Great Adventures of Jack Smith" Users are from around all over the country, with different browsers, and have a different cookie. I cannot believe that my users will not read what I ask, it is a WHITE PAGE with a button that disappears when clicked and a textbox.... easier than that??? Maybe i should put a checkbox with "I acknowledge that this form is for submitting memorable issues, not for fun"? Oh, who will read that? Or maybe i could enable the textbox only if the user has effectively clicked the link?

    Read the article

  • Process data BEFORE a 301 Redirect?

    - by Jesse
    So, I've been working on a PHP link shortener (I know, just what the world needs). Basically when the page loads, php determines where it needs to go and sends a 301 Header to redirect the browser, like so... Header( "HTTP/1.1 301 Moved Permanently" ); header("Location: http://newsite.com"; Now, I'm trying to add some tracking to my redirects and insert some custom analytics data into a MySQL table before the redirect happen. It works perfectly if I don't specify the a redirect type and just use: header("Location: http://newsite.com"; But, of course as soon as you add in the 301 header, nothing else gets processed. Actually, on the first request, it sends the data to MySQL, but on any subsequent requests there's no communication with the database. I assume it's a browser caching issue, once it's seen the 301 it decides they're no reason to parse anything on future requests. But, does anyone know if there's any way to get around this? I'd really like to keep it as a 301 for SEO purposes (I believe if you don't specify it sends a 404 by default?). I thought about using .htaccess to prepend a file to the page that will do the MySQL work, but with the 301, wouldn't that just get ignored as well? Anyway, I'm not sure if there's any solution other than using a different type of redirect, but I'm ready to give up just yet. So, any suggestions would be much appreciated. Thanks!

    Read the article

  • Simple problem with mod_rewrite in the Fat Free Framework

    - by ian
    I am trying to setup and learn the Fat Free Framework for PHP. http://fatfree.sourceforge.net/ It's is fairly simple to setup and I am running it on my machine using MAMP. I was able to get the 'hello world' example running just fin: require_once 'path/to/F3.php'; F3::route('GET /','home'); function home() { echo 'Hello, world!'; } F3::run(); But when I try to add in the second part, which has two routes: require_once 'F3/F3.php'; F3::route('GET /','home'); function home() { echo 'Hello, world!'; } F3::route('GET /about','about'); function about() { echo 'About Us.'; } F3::run(); I get a 404 error if I try the second URL: /about Not sure why one of the mod_rewrite commands would be working and not the other. Below is my .htaccess file: # Enable rewrite engine and route requests to framework RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME} !-l RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule .* index.php [L,QSA] # Disable ETags Header Unset ETag FileETag none # Default expires header if none specified (stay in browser cache for 7 days) <IfModule mod_expires.c> ExpiresActive On ExpiresDefault A604800 </IfModule>

    Read the article

  • How should I handle expected errors? eg. "username already exists"

    - by Pheter
    I am struggling to understand how I should design the error handling parts of my code. I recently asked a similar question about how I should go about returning server error codes to the user, eg. 404 errors. I learnt that I should handle the error from within the current part of the application; seem's simple enough. However, what should I do when I can't handle the error from the current link in the chain? For example, I may have a class that is used to manage authentication. One of it's methods could be createUser($username, $password). Within that function, I need to determine if the username already exists. If this is true, how should I alert the calling code about this? Returning null instead of a user object is one way. But how do I then know what caused the error? How should I handle errors in such a way that calling code can easily find out what caused the error? Is there a design pattern commonly used for this kind of situation?

    Read the article

  • Can you do this with Hudson?

    - by damian
    I want to create a hudson job, that takes an id as a parameter. And use that id to calculate the svn-repo path. Where I work you have a svn path for every issue that you resolve. And then all the issues are joined into a single svn-path. What I want to do is to run static code analysis on the partial issues. So I think maybe having an Ant build.xml that I use for every issue, then, parametrize the job with the issue id. I have tried to achieve that but the svn path doesn't replace the parameter. I have tried with #issueId, %issueId%, ${issueId} and ${env.issueId} without success. Jump error like: Location 'http://svn-path:8181/svn/devSet/issues/${env.chuid}' does not exist Checking out a fresh workspace because C:\Documents and Settings\dnoseda\.hudson\jobs\test\workspace\${env.chuid} doesn't exist Checking out http://svn-path:8181/svn/devSet/issues/${env.chuid} ERROR: Failed to check out http://svn-path:8181/svn/devSet/issues/${env.chuid} org.tmatesoft.svn.core.SVNException: svn: '/svn/!svn/bc/46190/devSet/issues/$%7Benv.chuid%7D' path not found: 404 Not Found (http://svn-path:8181) at org.tmatesoft.svn.core.internal.wc.SVNErrorManager.error(SVNErrorManager.java:64) at org.tmatesoft.svn.core.internal.wc.SVNErrorManager.error(SVNErrorManager.java:51) at I am think that I can not do what I want. Do you know how I can setup the correct configuration to achieve this matter? Thanks for any help. Edit The section of the configurate job that I want to put this parameter is this: <scm class="hudson.scm.SubversionSCM"> <locations> <hudson.scm.SubversionSCM_-ModuleLocation> <remote>http://svn-path:8181/svn/devSet/issues/${env.issueid}</remote> </hudson.scm.SubversionSCM_-ModuleLocation> </locations>

    Read the article

  • GET is not working for firstResource Rest example

    - by Anandan
    Hi, I am newbie to rest. I am using the following code example to understand the RESTlet. http://www.restlet.org/documentation/1.1/firstResource I am using RESTClient addon to firefox for testing. When i do GET on http://localhost/rest, i get a response "ok". But when i do GET on http://localhost/items, I get an error "404 Not found" Here's the sample code: public synchronized Restlet createRoot() { Router router = new Router(getContext()); router.attach("/items", ItemsResource.class); router.attach("/items/{itemName}", ItemResource.class); Restlet restlet = new Restlet() { @Override public void handle(Request request, Response response) { StringBuilder stringBuilder = new StringBuilder(); stringBuilder.append("ok"); response.setEntity(new StringRepresentation(stringBuilder .toString(), MediaType.TEXT_HTML)); } }; router.attach("/rest", restlet); return router; } ItemResource is same as provided in the link. and I use tomcat to run the servlet. Why am I getting the "Not found" error? Am i missing something here? Thanks & Regards, Anandan

    Read the article

  • If not following correct procedure?

    - by ct2k7
    Hi, I'm working on a Content Management System, and so far so good. I'm trying to get the system to work with a maintenance mode system. This is the code in the script to display the maintenance stuff: if ($maintenance['value'] == "1") {?> <div id="content"> <div id="errmsg"> <?php echo $maintenance['notes']; ?> </div> </div> <? } else {?> <h1><?php echo $title; ?></h1> <hr /><br /> <div id="content"> <?php echo $contents; if (!$content) { include ('includes/error/404.php');}?> </div> <? } ?> I can verify that the $maintenance['value'] variable is working as it should, but this portion o the script isn't working as it should. The value is currently set to 1, but it still displays the stuff in the else. Any ideas?

    Read the article

  • Changing the href attribute on hover with jQuery

    - by AverageJoe
    Ok, I have an html page that is loaded into another html page via PHP (ok so its a PHP page, whatever). The page that is loaded is a list of hyperlinks. I need to change the href attribute to make the hyperlinks relative to the location of the stored images they refer too. When i load the page containing the hyperlinks the links are relative to the web host server, not the server that the page is actually hosted from. Somthing like this: <div #screenshots) <p><a href="image1.htm">Image1</a></p> <p><a href="image2.htm">Image2</a></p> <p><a href="image3.htm">Image3</a></p> <p><a href="image4.htm">Image4</a></p> <p><a href="image5.htm">Image5</a></p> </div> When I mouse over the links, the status bar shows the reference as "http://webHostServer.com/image1.htm". If I click it I get a 404 error. I need the href to change to something like this when I mouse over it: "http://www.actualImageHostServerIPaddress/image1.htm" I looked at this for assitance and came out with the following jQuery code, but for some reason none of it works: $(document).ready(function(){ $("button").click(function() { $("#screenshots a").addClass('ss'); }); $(".ss").each(function() { $(this).data("oldHref", $(this).attr("href")); orig = $(this).attr("href"); over = "http://208.167.244.33/208.167.244.33/"; $(this).hover(function() { $(this).attr("href", $(this).attr("href").replace(orig, over+orig)); }, function() { $(this).attr("href", $(this).data("oldHref")); }); }); When I click the button it dosen't add the class to the anchor tags, so when I hover over them nothing changes. Any help here would be great.

    Read the article

  • Converting WAR to EAR and other Glassfish stories

    - by Random
    Hello! I am really new in this so I hopefully don't make any terrible mistake. I apologize before hand if I have. In my project I was using tomcat and deploying WAR files. But now some bosses wants to deploy EAR files. So there we go. I first downloaded Glassfish (don't know if it's the apropiate application server for a newbie like me), instaled it and all (I even deployed the hello.war in the autodeploy _< ). Then prepared an EAR file. From what I know, I just need to create an Enterprise Application Project in Eclipse and add to the module my war file. This changes the application.xml file automatically (thanks eclipse project!). So I exported it to an EAR file and uploaded it to the glassfish server. Wonders of wonders, it doesn't work. I also tried deploying the old WAR file in this new shiny glassfish but it goes on http-404 not found error. The glassfish seems to say that my project is not in ~/domains/domain1/docroot. By the way I am using windows and I am aware of some problems between glassfish and windows due to some updating open files or such. So I have to questions: First, Am I doing the EAR package correctly? Second, Do I need to do some especial configuration to the glassfish server to deploy EAR and WAR files? Thanks!

    Read the article

  • Error running web project in eclipse

    - by DarkKnight
    I am a newbie to servlets. I created a dynamic web project in eclipse. I have following files in my project home.html validateServlet.java I have defined validated servlet as an action in home.html form. However when I run it, I get http status 404. Below is the hierarchy of my project Project Java Resources src com.servlets ValidateServlet.java build WebContent META-INF WEB-INF web.xml hello.html Contents of my web.xml are as follows: <?xml version="1.0" encoding="UTF-8"?> <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web- app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" id="WebApp_ID" version="3.0"> <display-name>Website</display-name> <servlet> <description></description> <display-name>ValidateServlet</display-name> <servlet-name>validate</servlet-name> <servlet-class>com.oracle.coen235.servlets.ValidateServlet</servlet-class> </servlet> </web-app> In my hello.html, action is specified as , What might be the issue? I guess I am not able to generate the class file for my servlet. Can anyone guide me through this problem?

    Read the article

  • Nginx - Treats PHP as binary

    - by Think Floyd
    We are running Nginx+FastCgi as the backend for our Drupal site. Everything seems to work like fine, except for this one url. http:///sites/all/modules/tinymce/tinymce/jscripts/tiny_mce/plugins/smimage/index.php (We use TinyMCE module in Drupal, and the url above is invoked when user tries to upload an image) When we were using Apache, everything was working fine. However, nginx treats that above url Binary and tries to Download it. (We've verified that the file pointed out by the url is a valid PHP file) Any idea what could be wrong here? I think it's something to do with the NGINX configuration, but not entirely sure what that is. Any help is greatly appreciated. Config: Here's the snippet from the nginx configuration file: root /var/www/; index index.php; if (!-e $request_filename) { rewrite ^/(.*)$ /index.php?q=$1 last; } error_page 404 index.php; location ~* \.(engine|inc|info|install|module|profile|po|sh|.*sql|theme|tpl(\.php)?|xtmpl)$|^(code-style\.pl|Entries.*|Repository|Root|Tag|Template)$ { deny all; } location ~* ^.+\.(jpg|jpeg|gif|png|ico)$ { access_log off; expires 7d; } location ~* ^.+\.(css|js)$ { access_log off; expires 7d; } location ~ .php$ { include /etc/nginx/fcgi.conf; fastcgi_pass 127.0.0.1:8888; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_param QUERY_STRING $query_string; fastcgi_param REQUEST_METHOD $request_method; fastcgi_param CONTENT_TYPE $content_type; fastcgi_param CONTENT_LENGTH $content_length; } location ~ /\.ht { deny all; }

    Read the article

  • Behavior of Struts2 and convention-plugin when there is Index(extends ActionSupport)

    - by hanishi
    We have an Action class named 'Index' immediately under com.example.common.action and is annotated @ParentPackage('default') which is declared in package directive in struts.xml and has "/" for its namespace and extends "struts-default". It also declares @Result so that it responses with jsp files corresponding the string values returned by its execute() method. In our struts.xml, the following struts setting is configured along with other necessary configurations that are needed for convention-plugin. <constant name="struts.action.extension" value=","/> When accessing /my_context/none_existing_path, the request apparently hits this Index class and the contents of the jsp declared in the Index's @Result section gets returned. However, if we provide /my_context/, we receive the following error: HTTP Status 404-There is no Action mapped for namespace[/] and action name [] associated with context path [/my_context]. We want to know the reason why accessing /my_context/none_existing_path, where none_existing_path has no matching action, can fallback to Index class, but error is returned when when the URL requested is just /my_context/. Currently, our convention-plugin settings are declared as follows: <constant name="struts.convention.package.locators.basePackage" value="com.example"/> <constant name="struts.convention.package.locators" value="action"/> Strangely, if we changed the value of the struts.convention.package.locators.basePackage to om.example.common, in which the aforementioned Index file can be immediately found by narrowing the search scope, requesting /my_context/ displays the content of the jsps declared in @Result section of the Index class. However, as our action classes are distributed throughout the com.example.[a-z].action packages, where [a-z] represents the large volume of directories we have in our package structure, we cannot use this trick as a workaround. We have also tried placing index.jsp at the top level of the class path, and have the index.jsp redirect to /my_context/index, which worked but not what we want. Could this be a bug? We appreciate your responses. Thank you in advance. EDIT: JIRA registered, problem solved (from Struts 2.3.12 up)

    Read the article

< Previous Page | 82 83 84 85 86 87 88 89 90 91 92 93  | Next Page >