how to make vaadin app components searchable by search engines?

Hi, Guys
I have decided to use Vaadin for one of my clients, for his product Catalog website, very much similar to Vaadin Sampler.

I have noticed that URLs for different components are different, so If i sent link of a perticular URL like http://demo.vaadin.com/sampler/#ProgressIndicators , than It will take directly to Progress Indicator in Vaadin.

But is there anyway, by which we can make vaadin links-content indexable by Search Engine Bots?

I know that by looking at client information in Request, and If its bot than it returns normal HTML page. and if human client than loads Vaadin. How to do that, can anyone show few steps or pseudo code.

If anyone else is thinking of using/testing Vaadin for client apps, you should checkout this post too.
http://vaadin.com/forum/-/message_boards/message/127632

Thanks.

I assume you are running the application as a servlet. You can create your own subclass of AbstractApplicationServlet and override the method writeAjaxPage() or service() that normally calls it.

The method service() is called before anything in the Vaadin application is initialized for the request, whereas in writeAjaxPage() the server side parts of a Vaadin application have been created and started, allowing you to use many standard mechanisms in Vaadin as well as your normal transaction listeners etc.

Thanks Henry.
I got standard Request/Response servlet objects in params of service().

Few more questions, sorry to bug you :slight_smile:

But what should I do for
protected Application getNewApplication(HttpServletRequest request) throws ServletException ;
protected Class<? extends Application> getApplicationClass() throws ClassNotFoundException

Correct me If I am wrong.
Still application will be extending Application class only. But Now in web.xml vaadin servlet will be changed to AbstractApplicationServlet extending custom-servlet (which will determine whether to return Vaadin app or normal HTML). And This custom servlet will load Application object reference in getNewApplication method as required. right?

Lets say I encountered request from Search-Engine Bot and I returned HTML response. thats fine. But If human request comes, what should I call/return in service method?

By the way, do you know any other method for SEO in Vaadin app?

Cheers,

Check out
this thread
.

Henri Muurimaa already gave a link to a forum thread about other SEO techniques, but for this option:

This is as simple as returning “new MyApplication()” and “MyApplication.class”. These methods are called by the default service() implementation when needed - when serving something else than static resources and there is no application instance for the session.

Yes, in your web.xml you should refer to your custom servlet class and you can remove the “application” parameter as that will be handled by the two methods mentioned above. Your application will still extend Application.

Your service method should simply check if the request is from a bot and, if it is, return a custom HTML page. If not, simply call super.service().