How to configure an Ad-Hoc wifi connection

The following steps are needed for setting up a wifi connection in ad-hoc mode:

  • (# iwconfig wlan0 key aaccbbdd09) only if a WEP password is used
  • # iwconfig wlan0 essid mynet
  • # iwconfig wlan0 mode ad-hoc
  • # ifconfig wlan0 up
  • # ifconfig wlan0 192.168.100.x

The above instructions have to be executed on each computer which joins the ad-hoc network.

How to access a Spring bean from a Servlet

Here is a reference:

http://javageek.org/2005/09/23/accessing_a_spring_bean_from_a_servlet.html

In summary:

Basically, you use the WebApplicationContextUtils object from the spring framework to get a reference to your bean. Inside the doGet() method I have:

ApplicationContext context = WebApplicationContextUtils.getWebApplicationContext(getServletContext());
Object myDao = context.getBean("daoBeanName");