[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
Re: [aspectj-users] I had a problem please help me
|
Thank you,
I set the class path corect.
I am sending the code
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
public aspect Hello {
protected pointcut sayHello(HttpServletRequest
request,HttpServletResponse response):
execution(protected void doGet(HttpServletRequest,
HttpServletResponse))&&args(request,response);
before(HttpServletRequest request,HttpServletResponse
response):sayHello(request,response){
System.out.println("Hello");
}
after(HttpServletRequest request,HttpServletResponse
response):sayHello(request,response){
System.out.println("Bye");
}
}
public class Controller extends HttpServlet
{
private static final long serialVersionUID = 1L;
protected void doGet(HttpServletRequest request,
HttpServletResponse response) throws ServletException, IOException
{
doPost(request, response);
}
protected void doPost(HttpServletRequest request,
HttpServletResponse response) throws ServletException, IOException
{
String userAgent = request.getHeader("user-agent");
String clientBrowser = "Not known!";
if (userAgent != null)
{
clientBrowser = userAgent;
}
request.setAttribute("client.browser", clientBrowser);
request.getRequestDispatcher("/view.jsp").forward(request, response);
}
}
Thanks,
Vasumathi
> Could you send us your Hello-aspect code? I'm not familiar with servlets
> but with aspects I do. Could you send information about doPost()? It's
> declaration - arguments, return type and package.
>
> vasumathi.guduru@xxxxxxxx napisa?(a):
>> I wrote a simple aspect to say hello when a servlets doPost() is called.
>> But I am AspectNotBoundException. I don't have any idea, why it is
>> coming
>> and how can solve that.
>>
>>
>
> --
> *Bartlomiej Zdanowski*
> Programmer
> Product Research & Development Department
> AutoGuard & Insurance Ltd.
>
> Omulewska 27 street
> 04-128 Warsaw
> Poland
> phone +48 22 611 69 23
> www.autoguard.pl <http://www.autoguard.pl>
> _______________________________________________
> aspectj-users mailing list
> aspectj-users@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/aspectj-users
>