Thanks Rob..Can u plz elaborate what do u mean by
backed off timeouts for authentication failures. What else
do u suggest for application level prevention for DOS attacks?
not allowing
entities in get and delete, so we have created separate
resource URI for delete requests and use POST/PUT to
delete the resource on the server.
Regards
Surjendu
requests.We only
recognize and honor web service request from our recognized partners.
The actual user credentials who is requesting a deletion
goes as part of entity to the deletion webservice call.
I hope this makes sense.
Regards
Surjendu
Can I dynamically read the router attachments from a properties
file or an xml?
Key:/xxx/xxx
Value: XXXResource.class
The problem I am facing is:
1. In the application class If I have a createRoot method the
flow takes me there directly. Now if i abstract the router
attach key and value
Thanks Stephan.
Problem is I just found out that createRoot gets called
before handle() and hence request.getResourceRef().toString()
in createRoot is still null.
If the flow is other way round then it would have solved the
problem.
Do u have any other way??
Does createRoot method gets called before handle method.
In that case i can never get a handle of request in the
createRoot method(though I know i can call super.handle
in handle method later).
But is there a way to get request object in the createRoot
method?
Can't I pass an entity as part of HTTP.DELETE? Does it act
the same way as HTTP.GET?
Even if I am passing entity as part of METHOD.DELETE in my request,
the Resource
class in the server doesn't receive anything.
getRequest().isEntityAvailable() is false.
And if the answer is yes can someone
When I use Tomcat 5.0 with the following restlet jars(1.0.9)
my application works fine.
org.restlet.jar(175,240)
com.noelios.restlet.jar(150,630)
com.noelios.restlet.ext.servlet_2.4.jar(14,115)
When I try to use Tomcat 5.0 with the following
restlet jars (1.1) my applications conks off.
thanks Rob...downloaded M3 and everything works fine
I am receiving the following exception when the entity is
being set in the response.
java.util.zip.ZipException: no current ZIP entry
My code:
File file = new File(c:\\temp.zip);
rep = new FileRepresentation(file,MediaType.APPLICATION_ZIP);
Representation zippedRep = new
that. For your kind information this
question regarding bundling 2 files in a Zip using EncodeRepresentation has been
posted only once.
Regards
Surjendu
Hi Jerome
Sorry, after posting I realized that one of my team members already posted this
question. My team uses the same login-id. My due apologizes to you.
Regards
Surjendu
see any constructor which takes a list of Representations. Something
like
EncodeRepresentation(Encoding encoding, ListwrappedRepresentation)
In that case how will i bundle all the files in one zip.
Regards
Surjendu
of a page)
and an attachment(typically a File) back to the client
as part of Response.
Notwithstanding the drawbacks is there a way to solve this?
Regards
Surjendu
Can someone tell me how to send 4-5 attachments as part of response.
I mean i can create a FileRepresentation using
rep = new FileRepresentation(new File(
xxx), MediaType.TEXT_PLAIN, 0);
and set it in the response using
getResponse().setEntity(rep);
but how do I set multiple files in
In that case how do someone using my web service can send me a request with an
attachment. How to solve this use-case?
Thanks Jerome
What about the server code? Will Restlet be able to handle multi-part? If I use
a http-client library to post the multi-part form request will the server code
of Restlet( handlePost() method in Resource) be able to parse the request. If
not how to achieve the same.
What would
I do understand that GET is read-only. Say u want to retrieve SSN number of an
individual. Before sending the SSN number we also need to see whether the user
asking for the data is authorized to view that or not. I am not talking about
Guard class authentication or authorization( custom
This is my client call using Apache HttpClient Library
public static void addAttachment(String pageId) throws Exception {
HttpClient client = new HttpClient();
MultipartPostMethod mPost = new
MultipartPostMethod(getPageUri(pageId));
I tried that..But i still get the credentials as null..Is there any other way to
figure out whether the credentials are reaching the server.
Thanks..
1. I am using a Apache Http Client library as Restlet does not support
multipart-form. As far as retrieving userid and password is concerned,
thats not
a problem because I have written custom Guard class which does exactly
the same.
When I use a challengeScheme(Restlet Client) in
Even after i am passing an entity in the Request , I am not able to get it in
handleGet() method.
The same logic works for handlePut() and handlePost(). I am able to retrieve the
entities in handlePost() and handlePut().
What is different for handleGet()? Why am I not able to retrieve the
Sending a file:
Client Code:
FileRepresentation rep = new FileRepresentation(C:\\input.txt,
MediaType.MULTIPART_FORM_DATA, 0);
Request request = new Request(Method.PUT,rep);
Response resp = new Client(Protocol.HTTP).handle(request);
My question is how to read the
);
fi.write(saveTo);
i++;
}
}catch(Exception e)
{
e.printstackTrace();
}
I have also seen that I receive a multi-part error.
How to solve this?
Regards
Surjendu
Thanks..Can u plz also tell me How do i send an attachment as part of the
request to the server?
Your earlier example suggest ways to send an attachment via response. I want to
know how to send an attachment to the server via request.
Regards
Surjendu
How to send an attachment using restlet? Please post some code snippet.
Router(getContext());
guard.setNext(DomainResource.class);
router.attach(/domain/{domainname}, guard);
return router;
Jerome/Barrie Plz respond.
Regards
Surjendu
Thank u so much sir...
I want to override the authenticate method in my custom Guard class. But the
authenticate method of my custom Gurad class is never called?? Please help.
The following code guards my router:
@Override
public Restlet createRoot() {
Guard guard = new
If I do
char[] secret = request.getChallengeResponse().getSecret();
I get an encoded value. What do I have to do to get the real password?
How can i guard all the Resources using a single Custom Guard class. By doing
the following i can only guard a resource(which is working fine)
public Restlet createRoot() {
Guard guard = new
SamePageGuard(getContext(),ChallengeScheme.HTTP_BASIC);
Router router =
the client to send me a query parameter asking what type of output he wants
something like
http://xxx/xxx/xxx?output=json
Please help.
Thanks
Surjendu
parameter asking what type of output he wants
something like
http://xxx/xxx/xxx?output=json
Please help.
Thanks
Surjendu
();
form.add(domain[userId], userId);
Everything is hunky-dory at this point.
But What is the client is a JSON client? How do i parse the data in server? I
mean will the same code work if the json string is something like
domain[userId]:test
Regards
Surjendu
How can I parse a JSON request using Restlet? I tried using the following but it
does not work? Do we have a different way of retreiving the JSON params?
Form form = new Form(getRequest().getEntityAsForm());
String userid = form.getFirstValue(userId);
Say I want to create 3 users. A user is designated by an User object. The User
object has 4 attributes( FirstName,LastName,Email,BirthDate).
How do i send this as part of WebForm?
36 matches
Mail list logo