- Log into Hotmail
- Click Options (on the right), select More options
- From the Manage your account section, click View and edit your personal information
- Find the account you want and click Registered information
- The first option is Name, so click Change
- Enter First name and Last name, then click Save
Plesk generates web statistics using awstats. The "Select Period" drop down box is created with all the month dates in a random order which is not very helpful! It makes selecting the month you want tricky.
The following code checks which domains are using awstats and will re-jig their nav.html
files to put them all in the correct order. Place the following program into your cron to run after awstats has completed.
The simplest way to find out when awstats completes, is to check the creation time of the nav.html
file and add 30 minutes to be safe.
I've called mine: **plesk-awstats-nav-fixer.sh**
#!/bin/bash
#
# This code was written by BigSoft Limited.
# Please include this message when you use the code in any form.
# Code comes as is and without warrenty
#
# David Newcomb (c) BigSoft Limited 2008
#
# Get MySQL's admin password
PSA_PW=`cat /etc/psa/.psa.shadow`
PSA_USER=admin
# Location of webstats folders
VHOST=/var/www/vhosts
STATS=statistics/webstat
# Find enabled domain names that use awstats statistics.
# When a client is deactivated the status of a domain
# becomes non-zero, so there is no need to join on the
# client's table.
SQL=" SELECT d.name"
SQL="$SQL FROM domains d, hosting h"
SQL="$SQL WHERE d.id = h.dom_id"
SQL="$SQL AND d.status = 0"
SQL="$SQL AND h.webstat = 'awstats'"
# Run SQL
DOMAINS=`mysql --skip-column-names -u$PSA_USER -p$PSA_PW -e"$SQL" psa`
for DOMAIN in $DOMAINS
do
AWSTATS_DIR=$VHOST/$DOMAIN/$STATS
echo "Checking $AWSTATS_DIR"
if [ ! -d "$AWSTATS_DIR" ]
then
echo "Sorry awstats folder does not exist: $AWSTATS_DIR"
continue
fi
cd $AWSTATS_DIR
grep '^<option value="' nav.html | sort -r > nav_options.html
grep -v '<option value="' nav.html > nav_nooptions.html
ed nav_nooptions.html << EOF
/^<\/select>
-1r nav_options.html
wq
EOF
rm -f nav_options.html
rm -f nav.html
mv nav_nooptions.html nav.html
done
You have to love ed! It is (as far as I know) the only editor that is described as WYGIWYG (What You Get Is What You Get - wikipedia deleted my entry because no one else seems to have heard of this expression apart from me!).
This is the second problem with Plesk and awstats I have documented. Here's another: Plesk Awstat forgets the monthly statistics.
OpenSessionInViewInterceptor
. There wasn’t much out there. I needed to narrow my search to just the Spring Reference. So here comes the first tip:
site:static.springframework.org OpenSessionInViewInterceptorThis limits all the results to entries which are at the website http://static.springframework.org/. The search was throwing back loads of links to the API documentation so, I needed to restrict the results again to the reference section:
site:static.springframework.org inurl:reference OpenSessionInViewInterceptorThis was now giving me results for all the versions. Next I needed to reduce the search down to include the version number. Google only lets you have 1 colon’ed option per type, so:
site:static.springframework.org inurl:reference inurl:2.5 OpenSessionInViewInterceptorreturns nothing! You must join them together:
site:static.springframework.org inurl:(reference and 2.5) OpenSessionInViewInterceptor
org.springframework.web.util.NestedServletException: Request processing failed; nested exception is org.hibernate.LazyInitializationException: failed to lazily initialize a collection of role: uk.co.bigsoft.proj.bus.Clip.aaf, no session or session was closed org.hibernate.collection.AbstractPersistentCollection.throwLazyInitializationExceptionIfNotConnected(AbstractPersistentCollection.java:372) org.hibernate.collection.AbstractPersistentCollection.readSize(AbstractPersistentCollection.java:119) org.hibernate.collection.PersistentSet.size(PersistentSet.java:162) uk.co.bigsoft.proj.web.MyController.handleRequest(MyController.java:57) org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:48) org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:874) org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:808) org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:476) org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:431) javax.servlet.http.HttpServlet.service(HttpServlet.java:617) javax.servlet.http.HttpServlet.service(HttpServlet.java:717)We want something that can set up the transaction after calling
SimpleControllerHandlerAdapter.handle
and before calling our handleRequest
method and then commit or rollback the session depending on whether our controller throws an exception or not.
There appeared to be 2 choices to use:
OpenSessionInViewFilter
orOpenSessionInViewInterceptor
,
OpenSessionInViewInterceptor
is an interceptor which can be used to wrap any kind of technology, whereas the OpenSessionInViewFilter
is an Interceptor that can only be used in the web servlet environment.
Therefor you can use an interceptor in all cases but you can only use a filter in the web servlet case.
I found a clue in 13.4.3. Intercepting requests - the HandlerInterceptor interface of the reference manual. There is almost no reference to the OpenSessionInViewFilter
, so I think this is being obsoleted where as the OpenSessionInViewInterceptor
is covered in a whole section about interceptors (as a technology).
Interceptors just plug into the org.springframework.web.servlet.handler.SimpleUrlHandlerMapping
in your bean definition configuration.
<bean
id="openSessionInViewInterceptor"
class="org.springframework.orm.hibernate3.support.OpenSessionInViewInterceptor"
>
<property name="sessionFactory" ref="sessionFactory"/>
</bean>
<bean
id="urlMapping"
class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping"
>
<property name="interceptors">
<list>
<ref bean="openSessionInViewInterceptor"/>
</list>
</property>
<property name="mappings">
<props>
<prop key="/getmy.html">myController</prop>
</props>
</property>
</bean>
And it all just worked.
Or if you are using annotations you could just wrap handleRequest
in @Transactional…!
There are pros and cons to annotating the transactions and using an interceptor, and when I find out what they are I’ll update this blog!define:splingo The language used when talking about the workings of application frameworks.In order to have a conversation about an application framework you need to understand a new set of nouns and verbs. Used together they create a descriptive language that needs to be learnt. New people entering the application framework world struggle to integrate and find answers to questions until they have learnt how to speak (or write) splingo. Nouns include (but are not limited to) lazy, interceptor, bean, ejb, proxy, filter, session, transaction, manager. You can pick up parts of the language but until you can speak all of it you will not have an advanced enough understanding of all the technologies to the point that you can understand new concepts. It typically takes about 6 months of studying to get a comprehensive grasp of the language and grammar (or syntax).