request

URL not showing the right address after using servlet request forwarding.

Hi guys, I am having a weird problem here, and I am really stuck, need to get this work badly. so i have a page say index.jsp with a link say "a href=servlet?action=viewMenu". when I click on this link it will go to doGet() on my servlet and here is the code in my servlet. protected void doGet(HttpServletRequest request, HttpServletR...

Deny direct request using .htaccess

Is there any way to use .htaccess to deny direct Request to a specific part of my website e.g. www.example.com/XXXXX I only want to allow Referer only to XXXXXX. I know that I have to use HTTP_REFERER somehow to accomplish my goal but currently I am using other .htaccess rules and not sure how to combine all rules together. This is what...

Most efficient way - PHP/MYSQL requests - Real time news system

Hi there, I've got a quick performance question for my real time news system. This is a community news system, where everybody can post his news, and vote for it, or vote for other news. Every 20secs in jQuery I search in the DB to refresh the 20 last news/votes. But at the moment, I extract every 20sec the last 20 questions, even if ...

Django decorator, adding method to WSGIRequest

Hello Djangoists, Using a decorator I was trying to add a method to WSGIRequest request, just like is_ajax(). Since I could not find a proper way I just updated request.META with the info needed. Should I look into adding method at runtime in Python ? ...

php request/post/get/session expiration

I know a SESSION can expire but what about $_REQUEST/$_POST/$_GET variables? My question is, I have users that submit information and I need to set a Id for that information before I insert it into a database. Now I thought about using a SESSION but the problem is if the session expires before the user has submitted the information to...

three20 TTURLRequest resend

I have a REST service that uses an auth_token that expires every so often. when a request fails, I want to re-authenticate (which I'm able to do) and then resend the same exact TTURLRequest in the following generic way: - (void)request:(TTURLRequest*)request didFailLoadWithError: (NSError*)error { NSLog(@"error %@ %@ %@", [erro...

Make a HTTPS request through PHP and get response

I want to make HTTPS request through PHP to a server and get the response. something similar to this ruby code http = Net::HTTP.new("www.example.com", 443) http.use_ssl = true path = "uri" resp, data = http.get(path, nil) Thanks Wa'el ...

JSF datatable, request parameters and actions

Hi guys, I'm currently struggling with request parameters in JSF 2 and Icefaces 2 (shouldn't make a difference to only JSF 2) and would like to ask you about the recommended way to handle / process parameters. The problem I encounter occurs when using an ice:dataTable. Every time I hit the submit button (or fire a row selection event by...

How do I use JSONRequest.POST to get parameters from a url?

how to get POST parameters at a URL, using JSONRequest. The original site will be www.abc.com/aServlet. For example, www.abc.com/aServlet?user=tom I want to get the paramter of"user" which is "tom". I am actually keying in the user manually in aServlet which is a servlet. The problem is I dont know how to use JSONRequest to retrieve th...

Threading in Rails - do params[] persist?

Hi, I am trying to spawn a thread in rails. I am usually not comfortable of using threads as I will need to have a in-depth knowledge of Rails' request/response cycle, yet I cannot avoid using one as my request times out. In order to avoid the time out, I am using a thread within a request. My question here is simple. The thread that I...

Get LatLon from Google with Mootools Request.JSONP

Hi, I am trying to fetch the LatLon data from a request to Google. The Request.JSONP request works fine and returns the data perfect, but at the onSucces it returns a 'Invalid label' error. Here is my script: var G = {} var googleURL = 'http://maps.googleapis.com/maps/api/geocode/json?address='; G.google = function(id){ var addre...

Php requests through proxy

Hi, I have local apache server, and I need to pass all requests from php script (running on my local server) through a proxy. So I need to se a proxy to apache/php. Is it doable ? Can somebody tell me how ? Thanks. ...

Can AJAX request data from a remote server?

Hello! Can I use XMLHttpRequests in JavaScript to request a file on a different server than the one from where the request was made? Thank you. ...

Why are CherryPy object attributes persistent between requests?

I was writing debugging methods for my CherryPy application. The code in question was (very) basically equivalent to this: import cherrypy class Page: def index(self): try: self.body += 'okay' except AttributeError: self.body = 'okay' return self.body index.exposed = True cherryp...

Prevent timeout during large request in PHP

Hi all, I'm making a large request to the brightcove servers to make a batch change of metadata in my videos. It seems like it only made it through 1000 iterations and then stopped - can anyone help in adjusting this code to prevent a timeout from happening? It needs to make about 7000/8000 iterations. <?php include 'echove.php'; $e =...

Google Analytics ga.js keeps changing for each request - why?

If you keep on refreshing https://ssl.google-analytics.com/ga.js you will notice that the contents keeps switching between two versions. One starting with: function(){var s=true,t=false,aa=window,u=undefined,v=Math,ba="push",fa="slice",ga="cookie",y="charAt",z="indexOf",A="gaGlobal",ha="getTime",ja="toString",B="window",D="length and t...

In ASP.NET, what is the quickest way to get the base URl for a request?

Is there a fast way to get the scheme, host, port (only if not 80) and application path in ASP.NET? As far as I know, I need to assemble the following pieces: Request.Url.Scheme Request.Url.SchemeDelimiter Request.Url.Authority (although that will probably always include the port even when it's 80) Request.ApplicationPath Isn't ther...

Is it really possible to POST files with python ?

So I'm struggling with this for a second day in a row and still nothing. Found few solutions on the internet but still I'm getting "Internal Server Error" when trying to send files with POST. The idea is as follows : I'm sending a file opened in python's shell to a django function on my server that will read and store the file there. I'v...

Spring MVC - Session - Request

I have a Spring MVC (3) Controller and I trying to put in the annotations but failed Heres my code outline @Controller public class SpringController{ @RequestMapping("/welcome") public String myHandler(@RequestParam("id" String id)){ //My RequestParm is able to do the job of request.getParameter("id") HttpSession session = request...

How do I update an instance of a Django Model with request.POST if POST is a nested array?

I have a form that submits the following data: question[priority] = "3" question[effort] = "5" question[question] = "A question" That data is submitted to the URL /questions/1/save where 1 is the question.id. What I'd love to do is get question #1 and update it based on the POST data. I've got some of it working, but I don't know how ...